Ejemplo n.º 1
0
        //saves direct ticket into the database
        public static void saveTikect(string bzItem, string baseId, string lotId, string splitId, string leg, string opn, string employeeId, Decimal hourlyCost, string hoursworked, string overtime, string date, string workprod, string task, string premili, string currmili, string comment, string instance)
        {
            //open con to the api
            conOpen();

            //new labor ticket
            LaborTicket ticket = new LaborTicket(instName);

            ticket.Prepare();

            //preparing the data
            DataRow dr = (DataRow)ticket.NewRunLaborRow(1);

            dr["BASE_ID"]          = baseId;
            dr["LOT_ID"]           = lotId;
            dr["SPLIT_ID"]         = splitId;
            dr["SUB_ID"]           = leg;
            dr["SEQ_NO"]           = Int32.Parse(opn);
            dr["TRANSACTION_TYPE"] = "RUN";
            dr["EMPLOYEE_ID"]      = employeeId;
            dr["HOURLY_COST"]      = hourlyCost;
            dr["HOURS_WORKED"]     = hoursworked;
            dr["MULTIPLIER_1"]     = overtime.Equals("OT") ? 1.500 : 1.000;
            dr["TRANSACTION_DATE"] = date;
            bzItem = bzItem.Equals("") ? "-" : "B" + bzItem;
            if (overtime.Equals("OT"))
            {
                dr["DESCRIPTION"] = workprod + "," + task + "," + premili + "," + currmili + "," + bzItem + "," + "OT" + ",&" + comment;
            }
            else if (overtime.Equals("BK"))
            {
                dr["DESCRIPTION"] = workprod + "," + task + "," + premili + "," + currmili + "," + bzItem + "," + "BK" + ",&" + comment;
            }
            else
            {
                dr["DESCRIPTION"] = workprod + "," + task + "," + premili + "," + currmili + "," + bzItem + "," + "" + ",&" + comment;
            }
            dr["SHIFT_DATE"] = date;
            dr["SITE_ID"]    = "BACH";

            //api method to save
            try
            {
                ticket.Save();
            }
            catch (Exception ex)
            {
                Dbms.Close(instName);
            }

            Dbms.Close(instName);
        }
Ejemplo n.º 2
0
        //save indirect ticket into the database
        public static void saveTikectInd(string indirectId, string bzItem, string employeeId, string hoursworked, string overtime, string date, string workprod, string task, string premili, string currmili, string comment, string instance)
        {
            //open con to the api
            conOpen();

            //new labor ticket
            LaborTicket ticket = new LaborTicket(instName);

            ticket.Prepare();

            //preparing the data
            DataRow dr = (DataRow)ticket.NewRunLaborRow(1);

            dr["TRANSACTION_TYPE"] = "INDIRECT";
            dr["EMPLOYEE_ID"]      = employeeId;
            dr["HOURS_WORKED"]     = hoursworked;
            dr["MULTIPLIER_1"]     = overtime.Equals("OT") ? 1.500 : 1.000;
            dr["TRANSACTION_DATE"] = date;
            bzItem = bzItem.Equals("") ? "-" : "B" + bzItem;
            if (overtime.Equals("OT"))
            {
                dr["DESCRIPTION"] = workprod + "," + task + "," + premili + "," + currmili + "," + bzItem + "," + "OT" + ",&" + comment;
            }
            else if (overtime.Equals("BK"))
            {
                dr["DESCRIPTION"] = workprod + "," + task + "," + premili + "," + currmili + "," + bzItem + "," + "BK" + ",&" + comment;
            }
            else
            {
                dr["DESCRIPTION"] = workprod + "," + task + "," + premili + "," + currmili + "," + bzItem + "," + "" + ",&" + comment;
            }
            dr["INDIRECT_ID"] = indirectId;
            dr["SHIFT_DATE"]  = date;
            dr["SITE_ID"]     = "BACH";

            //api method to save
            try
            {
                ticket.Save();
            }
            catch
            {
                Dbms.Close(instName);
            }

            Dbms.Close(instName);
        }