예제 #1
0
        protected void GenerateAttendance(object sender, DirectEventArgs e)
        {
            GenerateAttendanceDay GD = new GenerateAttendanceDay();
            PostRequest <GenerateAttendanceDay> request = new PostRequest <GenerateAttendanceDay>();

            GD.employeeId = Convert.ToInt32(employeeFilter.Value);
            //GD.fromDayId = startingDate.SelectedDate.ToString("yyyyMMdd");
            //GD.toDayId = endingDate.SelectedDate.ToString("yyyyMMdd");
            //if (string.IsNullOrEmpty(branchId.Value.ToString()))
            //    GD.branchId = 0;
            //else
            //   GD.branchId =Convert.ToInt32(branchId.Value);
            request.entity = GD;


            PostResponse <GenerateAttendanceDay> resp = _timeAttendanceService.ChildAddOrUpdate <GenerateAttendanceDay>(request);

            if (!resp.Success)
            { //Show an error saving...
                X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                Common.errorMessage(resp);
                return;
            }
            else
            {
                X.Msg.Alert("", GetGlobalResourceObject("Common", "GenerateAttendanceDaySucc").ToString()).Show();
            }
        }
예제 #2
0
        private void LongAction(object state)
        {
            object[]      array = state as object[];
            SessionHelper h     = (SessionHelper)array[0];



            //if (HttpRuntime.Cache["TotalRecords"] == null)
            //    HttpRuntime.Cache.Insert("TotalRecords",0);
            //if (HttpRuntime.Cache["LongActionProgress"] == null)
            //    HttpRuntime.Cache.Insert("LongActionProgress", 0);



            _time = new TimeAttendanceService(h, new TimeAttendanceRepository());


            try
            {
                GenerateAttendanceDay GD = new GenerateAttendanceDay();
                PostRequest <GenerateAttendanceDay> request = new PostRequest <GenerateAttendanceDay>();
                GD.employeeId = Convert.ToInt32(employeeFilter.Value);
                //GD.fromDayId = startingDate.SelectedDate.ToString("yyyyMMdd");
                //GD.toDayId = endingDate.SelectedDate.ToString("yyyyMMdd");
                //if (string.IsNullOrEmpty(branchId.Value.ToString()))
                //    GD.branchId = 0;
                //else
                //    GD.branchId = Convert.ToInt32(branchId.Value);

                request.entity = GD;


                PostResponse <GenerateAttendanceDay> resp = _time.ChildAddOrUpdate <GenerateAttendanceDay>(request);
                if (!resp.Success)
                { //Show an error saving...
                    if (resp.ErrorCode == "Error_1")
                    {
                        HttpRuntime.Cache.Insert("ErrorMsgGenAD", Resources.Errors.Error_1);
                        HttpRuntime.Cache.Insert("ErrorLogIdGenAD", " ");
                    }
                    else
                    {
                        HttpRuntime.Cache.Insert("ErrorMsgGenAD", resp.Error);
                        HttpRuntime.Cache.Insert("ErrorLogIdGenAD", resp.LogId);
                    }
                    //      HttpRuntime.Cache.Insert("ErrorErrorCodeGenAD", resp.ErrorCode);
                }
                else
                {
                    HttpRuntime.Cache.Insert("genFS_RecordId", resp.recordId);
                }



                //if (HttpRuntime.Cache["TotalRecords"] != null)
                //    HttpRuntime.Cache.Remove("TotalRecords");
                //HttpRuntime.Cache["TotalRecords"] = emps.count;
            }

            catch (Exception exp)
            {
                HttpRuntime.Cache.Insert("ErrorMsgGenAD", exp.Message);
            }
        }