Exemplo n.º 1
0
        void client_GetEmployeeSalaryRecordByIDCompleted(object sender, GetEmployeeSalaryRecordByIDCompletedEventArgs e)
        {
            if (e.Error != null && !string.IsNullOrEmpty(e.Error.Message))
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
            }
            else
            {
                if (e.Result == null)
                {
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTFOUND"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                    //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTFOUND"));
                    return;
                }
                if (e.Result.T_HR_SALARYRECORDBATCH != null)
                {
                    try
                    {
                        T_HR_SALARYRECORDBATCH temp = e.Result.T_HR_SALARYRECORDBATCH as T_HR_SALARYRECORDBATCH;
                        string strCollection        = string.Empty;
                        strCollection = temp.BALANCEOBJECTTYPE + "," + temp.BALANCEOBJECTID + "," + temp.BALANCEYEAR.ToString() + "," + temp.BALANCEMONTH.ToString() + "," + temp.CHECKSTATE + "," + temp.MONTHLYBATCHID;
                        Form.Salary.SalaryRecordMassAudit form = new Form.Salary.SalaryRecordMassAudit(FormTypes.Audit, strCollection);

                        EntityBrowser browser = new EntityBrowser(form);
                        //browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
                        //browser.AuditCtrl.Auditing += new EventHandler<SMT.SaaS.FrameworkUI.AuditControl.AuditEventArgs>(AuditCtrl_Auditing);
                        browser.FormType = FormTypes.Audit;
                        browser.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
                        EntityBrowser entBrowser = this.FindParentByType <EntityBrowser>();
                        entBrowser.Close();
                    }
                    catch { }
                    return;
                }
                SalaryRecord     = e.Result;
                this.DataContext = SalaryRecord;
                client.GetEmployeeSalaryRecordItemByIDAsync(SalaryRecord.EMPLOYEESALARYRECORDID);

                //EntityBrowser browsers = new EntityBrowser(this);
                ////browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
                ////browser.AuditCtrl.Auditing += new EventHandler<SMT.SaaS.FrameworkUI.AuditControl.AuditEventArgs>(AuditCtrl_Auditing);
                ////browsers.FormType = FormTypes.Audit;
                //browsers.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });

                RefreshUI(RefreshedTypes.AuditInfo);
                SetToolBar();
            }
        }
Exemplo n.º 2
0
 public void SalaryRecordBatchUpdate(T_HR_SALARYRECORDBATCH entity)
 {
     using (SalaryRecordBatchBLL bll = new SalaryRecordBatchBLL())
     {
         bll.SalaryRecordBatchUpdate(entity);
     }
 }
Exemplo n.º 3
0
 public bool SalaryRecordBatchAdd(T_HR_SALARYRECORDBATCH entity, string[] salaryrecordids)
 {
     using (SalaryRecordBatchBLL bll = new SalaryRecordBatchBLL())
     {
         return bll.SalaryRecordBatchAdd(entity, salaryrecordids);
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// 获取批量审核的信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void client_GetSalaryRecordBatchByIDCompleted(object sender, GetSalaryRecordBatchByIDCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result != null)
                {

                    SalaryRecordBatch = e.Result as T_HR_SALARYRECORDBATCH;
                    if (!string.IsNullOrEmpty(salaryRecordBatch.BALANCEOBJECTNAME))
                        cbxAuditType.Visibility = Visibility.Collapsed;
                    txtBalanceYear.Text = SalaryRecordBatch.BALANCEYEAR.ToString();
                    nuYear = SalaryRecordBatch.BALANCEYEAR.ToString();
                    nuStartmounth = SalaryRecordBatch.BALANCEMONTH.ToString();
                    nudBalanceMonth.Value = SalaryRecordBatch.BALANCEMONTH.ToDouble();
                    CheckState = SalaryRecordBatch.CHECKSTATE;
                    cbxkAssignedObjectType.SelectedIndex = Convert.ToInt32(SalaryRecordBatch.BALANCEOBJECTTYPE);
                    ObjectType = Convert.ToInt32(SalaryRecordBatch.BALANCEOBJECTTYPE);
                    ObjectValue = SalaryRecordBatch.BALANCEOBJECTID;
                    tbBalanceYearMonth.Text = nuYear + Utility.GetResourceStr("YEAR") + nuStartmounth.ToString() + Utility.GetResourceStr("MONTH");
                    monthlyBatchid = SalaryRecordBatch.MONTHLYBATCHID;
                    BindAssignObjectLookup();
                    LoadData();
                    this.DataContext = SalaryRecordBatch;
                    RefreshUI(RefreshedTypes.AuditInfo);
                    SetToolBar();
                }
            }
            else
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
            }
        }
Exemplo n.º 5
0
        void SalaryRecordMassAudit_Loaded(object sender, RoutedEventArgs e)
        {
            tbDpepart.Visibility = Visibility.Collapsed;
            lkdepart.Visibility = Visibility.Collapsed;
            if ((FormType == FormTypes.Audit || FormType == FormTypes.Resubmit) && !string.IsNullOrWhiteSpace(FormID))
            {
                InitParas();
                //  basePage.GetEntityLogo("T_HR_SALARYRECORDBATCH");
                tbAuditType.Visibility = Visibility.Collapsed;
                cbxAuditType.Visibility = Visibility.Collapsed;
               

                client.GetSalaryRecordBatchByIDAsync(FormID, "AUDIT");

                return;
            }

            txtBalanceYear.Text = paras[2];
            nuYear = paras[2];
            nuStartmounth = paras[3];
            nudBalanceMonth.Value = Convert.ToDouble(paras[3]);
            CheckState = paras[4];
            cbxkAssignedObjectType.SelectedIndex = paras[0].ToInt32();
            ObjectType = paras[0].ToInt32();
            ObjectValue = paras[1];
            tbBalanceYearMonth.Text = paras[2] + Utility.GetResourceStr("YEAR") + paras[3] + Utility.GetResourceStr("MONTH");
            monthlyBatchid = paras[5];

            #region 初始化批量审核实体
            SalaryRecordBatch = new T_HR_SALARYRECORDBATCH();
            SalaryRecordBatch.MONTHLYBATCHID = Guid.NewGuid().ToString();
            SalaryRecordBatch.BALANCEOBJECTNAME = string.Empty;
            SalaryRecordBatch.BALANCEOBJECTID = ObjectValue;
            SalaryRecordBatch.BALANCEOBJECTTYPE = ObjectType.ToString();
            SalaryRecordBatch.BALANCEYEAR = Convert.ToDecimal(txtBalanceYear.Text);
            SalaryRecordBatch.BALANCEMONTH = Convert.ToDecimal(nudBalanceMonth.Value);
            SalaryRecordBatch.CHECKSTATE = Convert.ToInt32(CheckStates.UnSubmit).ToString();
            SalaryRecordBatch.CREATEDATE = System.DateTime.Now;
            SalaryRecordBatch.EDITSTATE = Convert.ToInt32(EditStates.UnActived).ToString();

            SalaryRecordBatch.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
            SalaryRecordBatch.CREATECOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            SalaryRecordBatch.CREATEDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
            SalaryRecordBatch.CREATEPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;

            string strOwnerCompanyId = string.Empty, strOwnerDepartmentId = string.Empty, strOwnerPostId = string.Empty;

            if (SalaryRecordBatch.CHECKSTATE == Convert.ToInt32(CheckStates.UnSubmit).ToString())
            {
                SaaS.LocalData.UserPost curPost = null;

                if (ObjectType == 0)
                {
                    var temp = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts.Where(c => c.CompanyID == ObjectValue);
                    if (temp != null)
                    {
                        curPost = temp.FirstOrDefault();
                    }
                }
                else if (ObjectType == 1)
                {
                    var temp = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts.Where(c => c.DepartmentID == ObjectValue);
                    if (temp != null)
                    {
                        strOwnerCompanyId = temp.FirstOrDefault().CompanyID;
                        strOwnerDepartmentId = temp.FirstOrDefault().DepartmentID;
                        strOwnerPostId = temp.FirstOrDefault().PostID;
                    }
                }
                else if (ObjectType == 2)
                {
                    var temp = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts.Where(c => c.PostID == ObjectValue);
                    if (temp != null)
                    {
                        strOwnerCompanyId = temp.FirstOrDefault().CompanyID;
                        strOwnerDepartmentId = temp.FirstOrDefault().DepartmentID;
                        strOwnerPostId = temp.FirstOrDefault().PostID;
                    }
                }

                if (curPost == null)
                {
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("WARNING"), "提交月薪操作已被终止,请确认是否已选择正确的提交机构(选择左边组织架构树上的公司或部门再点提交),如果已选择,请确认您在选择的机构上有生效的主职或兼职岗位。", Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                    this.IsEnabled = false;
                    return;
                }


                strOwnerCompanyId = curPost.CompanyID;
                strOwnerDepartmentId = curPost.DepartmentID;
                strOwnerPostId = curPost.PostID;
            }
            else
            {
                strOwnerCompanyId = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                strOwnerDepartmentId = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                strOwnerPostId = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
            }

            if (!string.IsNullOrWhiteSpace(strOwnerCompanyId) && !string.IsNullOrWhiteSpace(strOwnerDepartmentId) && !string.IsNullOrWhiteSpace(strOwnerPostId))
            {
                SalaryRecordBatch.OWNERCOMPANYID = strOwnerCompanyId;
                SalaryRecordBatch.OWNERDEPARTMENTID = strOwnerDepartmentId;
                SalaryRecordBatch.OWNERPOSTID = strOwnerPostId;
                SalaryRecordBatch.OWNERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

                salaryRecordBatch.BALANCEOBJECTNAME = "0";
                this.DataContext = SalaryRecordBatch;
                monthlyBatchid = SalaryRecordBatch.MONTHLYBATCHID;
                RefreshUI(RefreshedTypes.AuditInfo);
                SetToolBar();

                BindAssignObjectLookup();
                InitParas();
                LoadData();
            }
            else
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
            }

            #endregion
        }
Exemplo n.º 6
0
        private string GetXmlString(string StrSource, T_HR_SALARYRECORDBATCH Info)
        {

            decimal? stateValue = Convert.ToDecimal("1");
            string checkState = string.Empty;
            SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY checkStateDict = (Application.Current.Resources["SYS_DICTIONARY"] as List<SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY>).Where(s => s.DICTIONCATEGORY == "CHECKSTATE" && s.DICTIONARYVALUE == stateValue).FirstOrDefault();
            checkState = checkStateDict == null ? "" : checkStateDict.DICTIONARYNAME;
            SMT.SaaS.MobileXml.MobileXml mx = new SMT.SaaS.MobileXml.MobileXml();
            List<SMT.SaaS.MobileXml.AutoDictionary> AutoList = new List<SMT.SaaS.MobileXml.AutoDictionary>();
            AutoList.Add(basedata("T_HR_SALARYRECORDBATCH", "CHECKSTATE", "1", checkState));
            AutoList.Add(basedata("T_HR_SALARYRECORDBATCH", "PAYTOTALMONEY", tbTotalMoney.Text, ""));
            AutoList.Add(basedata("T_HR_SALARYRECORDBATCH", "PAYAVERAGE", tbAvgMoney.Text, ""));
            AutoList.Add(basedata("T_HR_SALARYRECORDBATCH", "BALANCEOBJECTID", Info.BALANCEOBJECTID, lkAssignObject.TxtLookUp.Text));
            AutoList.Add(basedata("T_HR_SALARYRECORDBATCH", "PAYDATE", Info.BALANCEYEAR + Utility.GetResourceStr("YEAR") + Info.BALANCEMONTH + Utility.GetResourceStr("MONTH"), ""));
            AutoList.Add(basedata("T_HR_SALARYRECORDBATCH", "CURRENTEMPLOYEENAME", Common.CurrentLoginUserInfo.EmployeeName, Common.CurrentLoginUserInfo.EmployeeName));
            if (Info.T_HR_EMPLOYEESALARYRECORD != null)
            {
                Info.T_HR_EMPLOYEESALARYRECORD.Clear();
            }

            string a = mx.TableToXml(Info, null, StrSource, AutoList);

            return a;
        }