Ejemplo n.º 1
0
        void Save()
        {
            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            RefreshUI(RefreshedTypes.ProgressBar);
            if (validators.Count > 0)
            {
                RefreshUI(RefreshedTypes.ProgressBar);
                return;
            }
            else if (lkCustomSalary.DataContext == null)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "COMPANY"));
                RefreshUI(RefreshedTypes.ProgressBar);
                return;
            }
            else
            {
                if (FormType == FormTypes.Edit)
                {
                    AttendMachineSet.UPDATEDATE   = System.DateTime.Now;
                    AttendMachineSet.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                    client.AttendMachineSetUpdateAsync(AttendMachineSet);
                }
                else
                {
                    AttendMachineSet.CREATEDATE         = System.DateTime.Now;
                    AttendMachineSet.CREATEUSERID       = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                    AttendMachineSet.OWNERCOMPANYID     = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                    AttendMachineSet.OWNERDEPARTMENTID  = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                    AttendMachineSet.OWNERID            = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                    AttendMachineSet.OWNERPOSTID        = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                    AttendMachineSet.CREATECOMPANYID    = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                    AttendMachineSet.CREATEDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                    AttendMachineSet.CREATEPOSTID       = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                    client.AttendMachineSetAddAsync(AttendMachineSet);
                }
            }
        }