Forum d'entraide Acomba
Pourquoi ne pas devenir membre du forum ?

Identifiez-vous ou Inscrivez-vous afin d'accéder à l'inrégralité du forum:
Accès à toutes les catégories du forum,
Entraide entre les 6 500 membres, et ce nombre s'accroît quotidiennement!

Notez que ce forum est indépendant de la société Acceo Solutions, éditrice du logiciel Acomba.

Rejoignez le forum, c’est rapide et facile

Forum d'entraide Acomba
Pourquoi ne pas devenir membre du forum ?

Identifiez-vous ou Inscrivez-vous afin d'accéder à l'inrégralité du forum:
Accès à toutes les catégories du forum,
Entraide entre les 6 500 membres, et ce nombre s'accroît quotidiennement!

Notez que ce forum est indépendant de la société Acceo Solutions, éditrice du logiciel Acomba.
Forum d'entraide Acomba
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Connexion
Le Deal du moment : -21%
LEGO® Icons 10329 Les Plantes Miniatures, ...
Voir le deal
39.59 €

Aller en bas
avatar
servlinksfg
Nombre de messages : 3
Date d'inscription : 07/07/2014

Ajout timesheet Empty Ajout timesheet

Lun 7 Juil 2014 - 11:27
Bonjour,

j'ai un problème pour ajouter un timesheet, j'essaie d'utiliser ReserveCardNumber mais le problème est que j'ai pas de clé primaire alors ça ne fonctionne pas. Quelqu'un à une idée comment faire?

L'erreur retourné est la suivante:
Error reserve card number 2147483647 : Erreur de ToolKit
Fonction = ReserveCardNumber
Champ =
Erreur = Function not supported for this CardID

Voici mon code en c# après des heures de test :

Code:
int totalcard = timesheet.NumCards();
int emp = GetEmployeCardPos(ts.employeenumber[j]);
int project = GetProjectCardPos(ts.projectnumber);
int function = GetFunctionCardPos(emp);
int salary = GetSalaryCardPos(emp);

timesheet.BlankCard();
http://timesheet.CardPos = totalcard + 1;
timesheet.ReserveEmployee(emp);
timesheet.TSProjectCP = project;
timesheet.TSStartDate = ts.startdate[j];
timesheet.TSEmployeeCP = emp;
timesheet.TSFunctionCP = function;
timesheet.TSSalaryCP = salary;
timesheet.TSTotalHours = ts.totalhours[j];
timesheet.TSComment = ts.comment[j];
timesheet.TSType = PA_TimeSheetType.PA_TSType_Hour;
timesheet.Key_TSEmployeeCP = emp;
timesheet.Key_TSFunctionCP = function;
timesheet.Key_TSSalaryCP = salary;
timesheet.Key_TSStartDate = ts.startdate[j];
timesheet.Key_TSCardPos = timesheet.CardPos;
//Error = timesheet.ReserveCard(timesheet.CardPos);
Error = timesheet.ReserveCardNumber();

//Error = 0;
if (Error == 0)
{
    //Error = timesheet.ModifyCard(true);
    Error = timesheet.AddCard();
    if (Error != 0)
        write_error("Error "+Error.ToString()+" : " + acomba.GetErrorMessage(Error));
    timesheet.FreeCardNumber();
   
}
else
{
    write_error("Error reserve card number " + timesheet.CardPos+" : " + acomba.GetErrorMessage(Error));
}
timesheet.FreeEmployee(emp);
avatar
servlinksfg
Nombre de messages : 3
Date d'inscription : 07/07/2014

Ajout timesheet Empty Update

Jeu 4 Juin 2015 - 13:17
Finalement mon problème majeur était que j'utilisais AcoSDK.dll au lieu de AcoX0127.dll.
Voici mon nouveau code:
Code:

try
                    {
                        int emp = GetEmployeCardPos(ts.employeenumber[j]);
                        int project = GetProjectCardPos(ts.projectnumber);
                        int function = GetFunctionCardPos(emp);
                        int salary = 0;

                        timesheet.BlankCard();
                        timesheet.ReserveEmployee(emp);
                        timesheet.TSProjectCP = project;
                        timesheet.TSStartDate = ts.startdate[j];
                        timesheet.TSEmployeeCP = emp;
                        timesheet.TSFunctionCP = function;
                        timesheet.TSSalaryCP = salary;
                        timesheet.TSTotalHours = ts.totalhours[j];
                        timesheet.TSComment = ts.comment[j];
                        timesheet.TSType = PA_TimeSheetType.PA_TSType_Hour;


                        Error = 0;
                        if (Error == 0)
                        {
                            Object TransCP = AcoX0127.Constant.IsBeingCreated;
                            Error = timesheet.XModifyCard(ref TransCP, 1);
                            if (Error != 0)
                            {
                                write_error("Error " + Error.ToString() + " : " + acomba.GetErrorMessage(Error));
                                write_error("Ajout TS projet : " + project.ToString() + " Employe : " + emp.ToString() + " Function : " + function.ToString() + " Salary : " + salary.ToString() + " Comment : " + ts.comment[j]);
                            }
                            timesheet.FreeCardNumber();

                        }
                        else
                        {
                            write_error("Error reserve card number " + timesheet.RecCardPos + " : " + acomba.GetErrorMessage(Error));

                        }
                        timesheet.FreeEmployee(emp);
                        
                    }
                    catch (Exception exline)
                    {
                        write_error("Error write time sheet line " + j + " - Message: " + exline.Message);
                    }

Code:

public int GetProjectCardPos(string Numero)
        {

            ProjectKey ProjectIndex = new ProjectKeyClass();
            ProjectIndex.BlankKey();
            int Index = 1;
            int Error = -1;

            ProjectIndex.PrNumber = Numero;

            Error = ProjectIndex.FindKey(Index);
            if (Error == 0)

                return ProjectIndex.PrCardPos;

            else

                return 0;

        }

        public int GetEmployeCardPos(string Numero)
        {

            EmployeeKey EmployeeIndex = new EmployeeKeyClass();
            EmployeeIndex.BlankKey();
            int Index = 1;
            int Error = -1;

            EmployeeIndex.EmNumber = Numero;

            Error = EmployeeIndex.FindKey(Index);
            if (Error == 0)

                return EmployeeIndex.EmCardPos;

            else

                return 0;

        }

        public int GetFunctionCardPos(int NumeroEmp)
        {
            FunctionXKey FunctionIndex = new FunctionXKeyClass();
            FunctionIndex.BlankKey();
            int Index = 1;
            int Error = -1;

            FunctionIndex.FnEmployeeCP = NumeroEmp;
            FunctionIndex.FnOrder = 1;
            FunctionIndex.FnReference = 1;


            Error = FunctionIndex.XFindKey(Index);
            if (Error == 0)

                return FunctionIndex.FnCardPos;

            else

                return 0;
        }

avatar
Tunisiano
Nombre de messages : 1
Date d'inscription : 23/01/2023

Ajout timesheet Empty Récuperer un timesheet d'un employee donnée

Dim 7 Mai 2023 - 4:25
Bonjour, y a-t-il quelqu'un qui a réussi à récupérer les données d'un time sheet pour un employé spécifique s'il vous plaît ?
Contenu sponsorisé

Ajout timesheet Empty Re: Ajout timesheet

Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum