Пример #1
0
        protected void PoPuP(object sender, DirectEventArgs e)
        {
            try
            {
                int dayId      = Convert.ToInt32(e.ExtraParams["dayId"]);
                int employeeId = Convert.ToInt32(e.ExtraParams["employeeId"]);
                CurrentDay.Text      = dayId.ToString();
                CurrentEmployee.Text = employeeId.ToString();
                CurrentCA.Text       = e.ExtraParams["ca"];
                CurrentSC.Text       = e.ExtraParams["sc"];
                string type = e.ExtraParams["type"];
                switch (type)
                {
                case "imgEdit":



                    break;

                case "LinkRender":

                    TimeApprovalWindow.Show();

                    break;

                default:
                    break;
                }
            }
            catch (Exception exp)
            {
                X.MessageBox.Alert(GetGlobalResourceObject("Common", "Error").ToString(), exp.Message);
            }
        }
Пример #2
0
        protected void PoPuP(object sender, DirectEventArgs e)
        {
            string dayId      = e.ExtraParams["dayId"];
            int    employeeId = Convert.ToInt32(e.ExtraParams["employeeId"]);

            CurrentDay.Text      = dayId.ToString();
            CurrentEmployee.Text = employeeId.ToString();
            CurrentCA.Text       = e.ExtraParams["ca"];
            CurrentSC.Text       = e.ExtraParams["sc"];
            string type = e.ExtraParams["type"];

            switch (type)
            {
            case "imgEdit":
                //Step 1 : get the object from the Web Service
                AttendanceShiftListRequest request = new AttendanceShiftListRequest();
                request.EmployeeId = employeeId;
                request.DayId      = dayId;
                ListResponse <AttendanceShift> shifts = _timeAttendanceService.ChildGetAll <AttendanceShift>(request);
                if (shifts.Success)
                {
                    attendanceShiftStore.DataSource = shifts.Items;
                    attendanceShiftStore.DataBind();
                    AttendanceShiftWindow.Show();
                }

                break;

            case "LinkRender":
                FillTimeApproval(dayId, employeeId);
                TimeApprovalWindow.Show();

                break;

            default:
                break;
            }
        }
Пример #3
0
        public void DisplayApprovals(string dayId, string employeeId, string shiftId, string code)
        {
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = "1|" + employeeId + "^2|" + dayId + "^3|" + dayId + "^5|" + code;
            ListResponse <Time> resp = _timeAttendanceService.ChildGetAll <Time>(req);

            if (!resp.Success)
            {
                Common.errorMessage(resp);
                return;
            }
            timeCode = ConstTimeVariationType.TimeCodeList(_systemService);
            resp.Items.ForEach(x =>
            {
                x.timeCodeString = timeCode.Where(y => y.key == Convert.ToInt16(x.timeCode)).Count() != 0 ? timeCode.Where(y => y.key == Convert.ToInt32(x.timeCode)).First().value : string.Empty;

                x.statusString = FillApprovalStatus(x.status);
            });
            Store3.DataSource = resp.Items;
            Store3.DataBind();
            TimeApprovalWindow.Show();
        }
Пример #4
0
        protected void PoPuP(object sender, DirectEventArgs e)
        {
            try {
                BasicInfoTab.Reset();
                FillDamageStore();
                string id                 = e.ExtraParams["id"];
                int    dayId              = Convert.ToInt32(e.ExtraParams["dayId"]);
                int    employeeId         = Convert.ToInt32(e.ExtraParams["employeeId"]);
                string damageLavel        = e.ExtraParams["damage"];
                string durationValue      = e.ExtraParams["duration"];
                string timeCodeParameter  = e.ExtraParams["timeCode"];
                string shiftId            = e.ExtraParams["shiftId"];
                string apStatus           = e.ExtraParams["apStatus"];
                string type               = e.ExtraParams["type"];
                string justificationParam = e.ExtraParams["justification"];
                string clockDuration      = e.ExtraParams["clockDuration"];
                string arId               = e.ExtraParams["arId"];


                switch (type)
                {
                case "imgEdit":
                    //Step 1 : get the object from the Web Service

                    //Step 2 : call setvalues with the retrieved object

                    damage.Select(damageLavel);
                    duration.Text = durationValue;
                    clock.Text    = clockDuration;
                    // recordId.Text = id;
                    justification.Text = justificationParam;
                    TimeApprovalReasonControl.setApprovalReason(arId);
                    if (apStatus == "2" || apStatus == "-1")
                    {
                        disableEditing(false);
                    }
                    else
                    {
                        disableEditing(true);
                    }

                    recordId.Text = id;
                    this.EditRecordWindow.Title = Resources.Common.EditWindowsTitle;
                    this.EditRecordWindow.Show();
                    break;

                case "imgDelete":
                    X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig
                    {
                        Yes = new MessageBoxButtonConfig
                        {
                            //We are call a direct request metho for deleting a record
                            Handler = String.Format("App.direct.DeleteRecord({0})", id),
                            Text    = Resources.Common.Yes
                        },
                        No = new MessageBoxButtonConfig
                        {
                            Text = Resources.Common.No
                        }
                    }).Show();
                    break;



                case "imgReject":
                    X.Msg.Confirm(Resources.Common.Confirmation, GetLocalResourceObject("RejectRecord").ToString(), new MessageBoxButtonsConfig
                    {
                        Yes = new MessageBoxButtonConfig
                        {
                            //We are call a direct request metho for deleting a record
                            Handler = String.Format("App.direct.RejectRecord({0})", id),
                            Text    = Resources.Common.Yes
                        },
                        No = new MessageBoxButtonConfig
                        {
                            Text = Resources.Common.No
                        }
                    }).Show();
                    break;

                case "imgAttach":
                    overrideForm.Reset();
                    RecordRequest req = new RecordRequest();
                    //req.employeeId = employeeId.ToString();
                    //req.dayId = dayId.ToString();
                    //req.shiftId = shiftId;
                    //req.timeCode = timeCodeParameter;
                    req.RecordID = id;
                    RecordResponse <DashBoardTimeVariation> resp = _timeAttendanceService.ChildGetRecord <DashBoardTimeVariation>(req);
                    if (!resp.Success)
                    {
                        Common.errorMessage(resp);
                        return;
                    }

                    ORId.Text = resp.result.recordId;
                    timeCodeStore.DataSource = ConstTimeVariationType.TimeCodeList(_systemService).Where(x => x.key == Convert.ToInt32(timeCodeParameter)).ToList();
                    timeCodeStore.DataBind();

                    FillBranch();
                    EmployeeQuickViewRecordRequest QVReq = new EmployeeQuickViewRecordRequest();
                    QVReq.RecordID = employeeId.ToString();

                    QVReq.asOfDate = DateTime.Now;
                    RecordResponse <EmployeeQuickView> qv = _employeeService.ChildGetRecord <EmployeeQuickView>(QVReq);

                    if (!qv.Success)
                    {
                        Common.errorMessage(qv);
                        return;
                    }
                    overrideForm.SetValues(resp.result);


                    branchId.Select(qv.result.branchId);

                    ListRequest UdIdReq = new ListRequest();

                    UdIdReq.Filter = "";
                    ListResponse <BiometricDevice> UdIdResp = _timeAttendanceService.ChildGetAll <BiometricDevice>(UdIdReq);
                    if (!UdIdResp.Success)
                    {
                        Common.errorMessage(UdIdResp);
                        return;
                    }
                    udIdStore.DataSource = UdIdResp.Items;
                    udIdStore.DataBind();
                    FlatPunchesListRequest FPreq = new FlatPunchesListRequest();
                    FPreq.shiftId = shiftId;
                    FPreq.sortBy  = "clockStamp";
                    FPreq.StartAt = "0";
                    FPreq.Size    = "30";
                    ListResponse <FlatPunch> FPresp = _timeAttendanceService.ChildGetAll <FlatPunch>(FPreq);

                    if (!FPresp.Success)
                    {
                        Common.errorMessage(FPresp);
                        return;
                    }

                    punchesList.Text = "";
                    FPresp.Items.ForEach(x =>
                    {
                        punchesList.Text += x.clockStamp.ToString(_systemService.SessionHelper.GetDateformat() + " HH:mm", CultureInfo.CurrentUICulture) + System.Environment.NewLine;
                    }


                                         );


                    inOutStore.DataSource = Common.XMLDictionaryList(_systemService, "34");
                    inOutStore.DataBind();
                    overrideWindow.Show();

                    break;

                case "LinkRender":
                    FillTimeApproval(id);
                    TimeApprovalWindow.Show();

                    break;

                case "imgHistory":

                    TimeVariationHistoryControl1.Show("41203", id);
                    break;

                default:
                    break;
                }
            }
            catch (Exception exp)
            {
                X.Msg.Alert(Resources.Common.Error, exp.Message).Show();
            }
        }
Пример #5
0
        protected void PoPuP(object sender, DirectEventArgs e)
        {
            try
            {
                string id            = e.ExtraParams["id"];
                int    dayId         = Convert.ToInt32(e.ExtraParams["dayId"]);
                int    employeeId    = Convert.ToInt32(e.ExtraParams["employeeId"]);
                string damageLavel   = e.ExtraParams["damage"];
                string durationValue = e.ExtraParams["duration"];
                string timeCode      = e.ExtraParams["timeCode"];
                string shiftId       = e.ExtraParams["shiftId"];

                string type = e.ExtraParams["type"];


                switch (type)
                {
                case "imgEdit":
                    //Step 1 : get the object from the Web Service

                    //Step 2 : call setvalues with the retrieved object

                    damage.Select(damageLavel);
                    duration.Text = durationValue;
                    recordId.Text = id;

                    this.EditRecordWindow.Title = Resources.Common.EditWindowsTitle;
                    this.EditRecordWindow.Show();
                    break;

                case "imgDelete":
                    X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig
                    {
                        Yes = new MessageBoxButtonConfig
                        {
                            //We are call a direct request metho for deleting a record
                            Handler = String.Format("App.direct.DeleteRecord({0})", id),
                            Text    = Resources.Common.Yes
                        },
                        No = new MessageBoxButtonConfig
                        {
                            Text = Resources.Common.No
                        }
                    }).Show();
                    break;

                case "imgAttach":

                    //Here will show up a winow relatice to attachement depending on the case we are working on
                    break;

                case "LinkRender":
                    FillTimeApproval(dayId, employeeId, timeCode, shiftId);
                    TimeApprovalWindow.Show();

                    break;

                default:
                    break;
                }
            }
            catch (Exception exp)
            {
                X.Msg.Alert(Resources.Common.Error, exp.Message).Show();
            }
        }