private void AuthorizationBtn_Click(object sender, RoutedEventArgs e)
        {
            Button AuthorBtn = sender as Button;

            SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE AuthorUser = AuthorBtn.Tag as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
            permclient.GetUserByEmployeeIDAsync(AuthorUser.EMPLOYEEID);
        }
        private void btnLookUpOwner_Click(object sender, RoutedEventArgs e)
        {
            SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
            lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel;
            lookup.SelectedClick  += (obj, ev) =>
            {
                List <SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj> ent = lookup.SelectedObj as List <SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj>;
                if (ent != null && ent.Count > 0)
                {
                    SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj companyInfo = ent.FirstOrDefault();
                    SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE           empInfo     = (SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE)companyInfo.ObjectInstance;
                    vehicleDispatch.OWNERCOMPANYID    = empInfo.OWNERCOMPANYID;
                    vehicleDispatch.OWNERDEPARTMENTID = empInfo.OWNERDEPARTMENTID;
                    vehicleDispatch.OWNERID           = empInfo.EMPLOYEEID;
                    vehicleDispatch.OWNERNAME         = empInfo.EMPLOYEEENAME;
                    vehicleDispatch.OWNERPOSTID       = empInfo.T_HR_EMPLOYEEPOST.FirstOrDefault().EMPLOYEEPOSTID;

                    txtDriverName.Text = companyInfo.ObjectName;
                    txtDriverID.Text   = companyInfo.ObjectID;
                    if (!string.IsNullOrEmpty(empInfo.OFFICEPHONE))
                    {
                        txtTel.Text = empInfo.OFFICEPHONE;
                    }
                }
            };
            lookup.MultiSelected = false;
            lookup.Show();
        }
        private void DtGrid_LoadingRow(object sender, DataGridRowEventArgs e)
        {
            SetRowLogo(DtGrid, e.Row, "T_SYS_USER");
            SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE UserT = (SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE)e.Row.DataContext;

            Button MyAuthorBtn = DtGrid.Columns[6].GetCellContent(e.Row).FindName("AuthorizationBtn") as Button;

            MyAuthorBtn.Tag = UserT;
        }
        void DtGrid_CurrentCellChanged(object sender, EventArgs e)
        {
            DataGrid grid = sender as DataGrid;

            if (grid.SelectedItem != null)
            {
                SelectedEmployee = (SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE)grid.SelectedItems[0];
            }
        }
        /// <summary>
        /// DataGrid序号
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DtGrid_LoadingRow(object sender, DataGridRowEventArgs e)
        {
            SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE tmp = (SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE)e.Row.DataContext;
            int index = e.Row.GetIndex();
            var cell  = DtGrid.Columns[0].GetCellContent(e.Row) as TextBlock;

            cell.Text = (index + 1).ToString();
            var IdNum = DtGrid.Columns[4].GetCellContent(e.Row) as TextBlock;
        }
Exemple #6
0
        /// <summary>
        /// 点击列表的单元格改变事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void DtGrid_CurrentCellChanged(object sender, EventArgs e)
        {
            DataGrid grid = sender as DataGrid;

            if (grid.SelectedItem != null)
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE employee = (SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE)grid.SelectedItems[0];
                SelectedPerson = GetPersonFromList(employee.EMPLOYEEID);
                //kpiClient.GetRandomGroupPersonByIDAsync(employee.EMPLOYEEID);
            }
        }
Exemple #7
0
        /// <summary>
        /// 读取每行的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DtGrid_LoadingRow(object sender, DataGridRowEventArgs e)
        {
            //获取该行人员信息
            SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = e.Row.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
            //获取该行的CheckBox
            CheckBox ckh = DtGrid.Columns[0].GetCellContent(e.Row).FindName("chkMyChkBox") as CheckBox;

            //是否已经是抽查组人员
            if (personIDList != null && personIDList.IndexOf(ent.EMPLOYEEID) != -1)
            {
                ckh.IsChecked = true;
            }
            //增加CheckBox事件
            ckh.Click += new RoutedEventHandler(chkMyChkBox_Click);
        }
Exemple #8
0
        /// <summary>
        /// 选择员工
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LookUp_FindClick(object sender, EventArgs e)
        {
            //Dictionary<string, string> cols = new Dictionary<string, string>();
            //cols.Add("EMPLOYEECODE", "T_HR_EMPLOYEE.EMPLOYEECODE");
            //cols.Add("EMPLOYEECNAME", "T_HR_EMPLOYEE.EMPLOYEECNAME");
            //cols.Add("EMPLOYEEENAME", "T_HR_EMPLOYEE.EMPLOYEEENAME");
            //LookupForm lookup = new LookupForm(SMT.Saas.Tools.OrganizationWS.EntityNames.Employee,
            //    typeof(SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST[]), cols);

            //lookup.SelectedClick += (o, ev) =>
            //{
            //    SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST ent = lookup.SelectedObj as SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST; ;

            //    if (ent != null)
            //    {
            //        lkEmployeeName.DataContext = ent.T_HR_EMPLOYEE;
            //    }
            //};

            //lookup.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
            OrganizationLookup lookup = new OrganizationLookup();

            lookup.SelectedObjType = OrgTreeItemTypes.Personnel;
            lookup.SelectedClick  += (obj, ev) =>
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lookup.SelectedObj[0].ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                if (ent != null)
                {
                    lkEmployeeName.DataContext = ent;
                    //  SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE temp = lkEmployeeName.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                    T_HR_EMPLOYEE entity = new T_HR_EMPLOYEE();
                    entity.EMPLOYEEID        = ent.EMPLOYEEID;
                    entity.EMPLOYEECNAME     = ent.EMPLOYEECNAME;
                    entity.OWNERPOSTID       = ent.OWNERPOSTID;
                    entity.OWNERDEPARTMENTID = ent.OWNERDEPARTMENTID;
                    entity.OWNERCOMPANYID    = ent.OWNERCOMPANYID;

                    PensionMaster.OWNERCOMPANYID    = ent.OWNERCOMPANYID;
                    PensionMaster.OWNERDEPARTMENTID = ent.OWNERDEPARTMENTID;
                    PensionMaster.OWNERPOSTID       = ent.OWNERPOSTID;
                    PensionMaster.OWNERID           = ent.EMPLOYEEID; //ent.OWNERID; ownerid为空 改成employeeid
                    PensionMaster.T_HR_EMPLOYEE     = entity;
                }
            };

            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Exemple #9
0
        /// <summary>
        /// 选择员工
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LookUp_FindClick(object sender, EventArgs e)
        {
            OrganizationLookup lookup = new OrganizationLookup();

            lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel;
            lookup.SelectedClick  += (obj, ev) =>
            {
                List <SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj> ent = lookup.SelectedObj as List <SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj>;
                if (ent != null && ent.Count > 0)
                {
                    SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj userInfo = ent.FirstOrDefault();

                    SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj post = (SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj)userInfo.ParentObject;
                    postId = post.ObjectID;
                    string postName = post.ObjectName;//岗位

                    SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj dept = (SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj)post.ParentObject;
                    deptId = dept.ObjectID;
                    string deptName = dept.ObjectName;//部门

                    SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY corp = (dept.ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT).T_HR_COMPANY;
                    corpId   = corp.COMPANYID;
                    corpName = corp.CNAME; //公司

                    SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE emp = userInfo.ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                    empId = emp.EMPLOYEEID;
                    T_HR_EMPLOYEEPOST empPost = emp.T_HR_EMPLOYEEPOST.Where(t => t.T_HR_POST.POSTID == postId).FirstOrDefault();
                    if (empPost == null)
                    {
                        ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), "检测员工当前岗位异常,请重试",
                                                       Utility.GetResourceStr("CONFIRM"), MessageIcon.Information);
                        return;
                    }
                    //if (empPost.ISAGENCY == "1")
                    //{
                    //    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), "请选择员工主岗位",
                    //                                                     Utility.GetResourceStr("CONFIRM"), MessageIcon.Information);
                    //    return;
                    //}
                    string StrEmployee = userInfo.ObjectName + "-" + post.ObjectName + "-" + dept.ObjectName + "-" + corp.CNAME;
                    lkEmployeeName.TxtLookUp.Text = StrEmployee;
                    lkEmployeeName.DataContext    = emp;
                    ToolTipService.SetToolTip(lkEmployeeName.TxtLookUp, StrEmployee);
                }
            };

            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Exemple #10
0
 /// <summary>
 /// 在内存中增加抽查组人员
 /// </summary>
 private void AddRandomGroupPerson()
 {
     //获取当前人员信息
     SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = DtGrid.SelectedItem as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
     //如果在删除列表中,则从删除列表中删除该记录
     if (delList.IndexOf(SelectedPerson) != -1)
     {
         delList.Remove(SelectedPerson);
     }
     //如果在抽查组人员列表中不存在,而且在添加列表中也不存在,则添加到内存中的添加列表中
     else if ((groupPersonList == null || groupPersonList.IndexOf(SelectedPerson) == -1) && addList.IndexOf(SelectedPerson) == -1)
     {
         addList.Add(SelectedPerson);
         //添加到已关联的ID列表中
         personIDList.Add(ent.EMPLOYEEID);
     }
 }
Exemple #11
0
 /// <summary>
 /// 删除内存中的抽查组人员
 /// </summary>
 private void DeleteRandomGroupPerson()
 {
     //获取当前人员信息
     SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = DtGrid.SelectedItem as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
     //如果在添加列表中,则从添加列表中删除该记录
     if (addList.IndexOf(SelectedPerson) != -1)
     {
         addList.Remove(SelectedPerson);
         //从已关联的ID列表中删除
         personIDList.Remove(ent.EMPLOYEEID);
     }
     //如果在抽查组人员列表中存在,而且在删除列表中不存在,则添加到内存中的删除列表中
     else if (groupPersonList != null && groupPersonList.IndexOf(SelectedPerson) != -1 && delList.IndexOf(SelectedPerson) == -1)
     {
         delList.Add(SelectedPerson);
     }
 }
Exemple #12
0
 private void btnLookUpOwner_Click(object sender, RoutedEventArgs e)
 {
     SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
     lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel;
     lookup.SelectedClick  += (obj, ev) =>
     {
         List <SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj> ent = lookup.SelectedObj as List <SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj>;
         if (ent != null && ent.Count > 0)
         {
             SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj companyInfo = ent.FirstOrDefault();
             SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE           empInfo     = (SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE)companyInfo.ObjectInstance;
             txtDriverName.Text = companyInfo.ObjectName;
             txtDriverID.Text   = companyInfo.ObjectID;
         }
     };
     lookup.MultiSelected = true;
     lookup.Show();
 }
Exemple #13
0
        private void AddMembersObj()
        {
            SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup();
            lookup.SelectedObjType = SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel;

            lookup.SelectedClick += (obj, ev) =>
            {
                List <ExtOrgObj> ent = lookup.SelectedObj as List <ExtOrgObj>;
                if (ent != null && ent.Count > 0)
                {
                    foreach (var h in ent)
                    {
                        V_EMPLOYEEVIEW view = new V_EMPLOYEEVIEW();
                        SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj userInfo = ent.FirstOrDefault();

                        SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj post = (SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj)userInfo.ParentObject;
                        view.OWNERPOSTID = post.ObjectID;
                        view.POSTNAME    = post.ObjectName;//岗位

                        SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj dept = (SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj)post.ParentObject;
                        view.OWNERDEPARTMENTID = dept.ObjectID;
                        view.DEPARTMENTNAME    = dept.ObjectName;//部门

                        SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY corp = (dept.ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT).T_HR_COMPANY;
                        view.OWNERCOMPANYID = corp.COMPANYID;
                        view.COMPANYNAME    = corp.CNAME;//公司

                        SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE emp = userInfo.ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                        view.EMPLOYEEID    = emp.EMPLOYEEID;
                        view.EMPLOYEECNAME = emp.EMPLOYEECNAME;

                        listEmpolyeeView.Add(view);
                    }
                    //issuanceExtOrgObj = ent;
                    tmpMeetingMember = ent;
                    // personclient.GetEmployeeDetailByIDsAsync(StrStaffList);
                    BindData();
                }
            };
            lookup.MultiSelected       = true;
            lookup.SelectSameGradeOnly = true;
            lookup.Show();
        }
Exemple #14
0
        private void LookUp_FindClick(object sender, EventArgs e)
        {
            //Dictionary<string, string> cols = new Dictionary<string, string>();
            //cols.Add("EMPLOYEECODE", "T_HR_EMPLOYEE.EMPLOYEECODE");
            //cols.Add("EMPLOYEECNAME", "T_HR_EMPLOYEE.EMPLOYEECNAME");
            //cols.Add("EMPLOYEEENAME", "T_HR_EMPLOYEE.EMPLOYEEENAME");
            //LookupForm lookup = new LookupForm(SMT.Saas.Tools.OrganizationWS.EntityNames.Employee,
            //    typeof(SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST[]), cols);

            //lookup.SelectedClick += (o, ev) =>
            //{
            //    SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST ent = lookup.SelectedObj as SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST; ;

            //    if (ent != null)
            //    {
            //        lkEmployeeName.DataContext = ent.T_HR_EMPLOYEE;
            //        client.GetEmployeeEntryByEmployeeIDAsync(ent.T_HR_EMPLOYEE.EMPLOYEEID);
            //    }
            //};

            //lookup.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
            OrganizationLookup lookup = new OrganizationLookup();

            lookup.SelectedObjType = OrgTreeItemTypes.Personnel;
            lookup.SelectedClick  += (obj, ev) =>
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lookup.SelectedObj[0].ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                if (ent != null)
                {
                    lkEmployeeName.DataContext = ent;
                    EmployeePost = ent.T_HR_EMPLOYEEPOST.Where(t => t.ISAGENCY == "0").FirstOrDefault();
                    client.GetEmployeeEntryByEmployeeIDAsync(ent.EMPLOYEEID);
                }
            };

            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Exemple #15
0
 void DtGrid_CurrentCellChanged(object sender, EventArgs e)
 {
     DataGrid grid = sender as DataGrid;
     if (grid.SelectedItem != null)
     {
         SelectedEmployee = (SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE)grid.SelectedItems[0];
     }
 }
Exemple #16
0
        void client_GetSalaryArchiveMasterByIDCompleted(object sender, GetSalaryArchiveMasterByIDCompletedEventArgs 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);
                    return;
                }
                SalaryArchive = e.Result.archive;
                this.DataContext = SalaryArchive;

                //显示员工名
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = new SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE();
                ent.EMPLOYEEID = SalaryArchive.EMPLOYEEID;
                ent.EMPLOYEECODE = SalaryArchive.EMPLOYEECODE;
                ent.EMPLOYEECNAME = SalaryArchive.EMPLOYEENAME;
                lkEmployee.DataContext = ent;
                string fullName = string.Empty;
                //if (string.IsNullOrEmpty(e.Result.PostName))
                //{
                //    fullName = SalaryArchive.EMPLOYEENAME;
                //}
                //else
                //{
                //    fullName = SalaryArchive.EMPLOYEENAME + " - " + e.Result.PostName + " - " + GetFullOrgName(e.Result.DepartmentID);
                //}
                lkEmployee.TxtLookUp.Text = SalaryArchive.EMPLOYEENAME;

                //显示薪资方案名
                T_HR_SALARYSOLUTION tmp = new T_HR_SALARYSOLUTION();
                tmp.SALARYSOLUTIONNAME = SalaryArchive.SALARYSOLUTIONNAME;
                tmp.SALARYSOLUTIONID = SalaryArchive.SALARYSOLUTIONID;
                lkSalarySolution.DataContext = tmp;

                //发薪机构
                var companys = Application.Current.Resources["SYS_CompanyInfo"] as List<OrganizationWS.T_HR_COMPANY>;
                if (companys != null)
                {
                    OrganizationWS.T_HR_COMPANY company = companys.Where(s => s.COMPANYID == SalaryArchive.PAYCOMPANY).FirstOrDefault();
                    lkSalaryCompany.DataContext = company;
                }

                //考勤机构
                if (!string.IsNullOrWhiteSpace(SalaryArchive.ATTENDANCEORGNAME))
                {
                    lkAttendanceCompany.TxtLookUp.Text = SalaryArchive.ATTENDANCEORGNAME;
                }

                //结算岗位
                if (!string.IsNullOrWhiteSpace(SalaryArchive.BALANCEPOSTNAME))
                {
                    lkBalancePost.TxtLookUp.Text = SalaryArchive.BALANCEPOSTNAME;
                }

                //薪资标准
                salaryStand = new T_HR_SALARYSTANDARD();
                salaryStand.SALARYSTANDARDID = e.Result.standerID;
                salaryStand.SALARYSTANDARDNAME = e.Result.standerName;
                SalaryArchive.T_HR_SALARYSTANDARD = salaryStand;

                //传给流程的参数
                createCompanyID = e.Result.CompanyID;
                createDepartmentID = e.Result.DepartmentID;
                createPostID = e.Result.PostID;

                //加载薪资项
                LoadData();

                //重新提交把审核状态修改为未提交
                if (FormType == FormTypes.Resubmit)
                {
                    SalaryArchive.CHECKSTATE = Convert.ToInt32(CheckStates.UnSubmit).ToString();
                    SalaryArchive.EDITSTATE = Convert.ToInt32(EditStates.UnActived).ToString();
                }
                //禁用控件
                if (SalaryArchive.CHECKSTATE != Convert.ToInt32(CheckStates.UnSubmit).ToString())
                {
                    EnableControl();
                }
                if (SalaryArchive.POSTLEVEL != null)
                {
                    BindPostLevel(SalaryArchive.POSTLEVEL);
                    PostLevel = SalaryArchive.POSTLEVEL.ToString();
                }

                if (SalaryArchive.OLDSALARYLEVEL != null)
                {
                    oldsalaryLevel = SalaryArchive.OLDSALARYLEVEL;
                    oldpostlevel = SalaryArchive.OLDPOSTLEVEL == null ? 0 : SalaryArchive.OLDPOSTLEVEL;
                    foreach (SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY item in cbxOldSalaryLevel.Items)
                    {
                        if (item.DICTIONARYVALUE == oldsalaryLevel)
                        {
                            cbxOldSalaryLevel.SelectedItem = item;
                            break;
                        }
                    }
                    foreach (SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY item in cbxOldPostLevel.Items)
                    {
                        if (item.DICTIONARYVALUE == oldpostlevel)
                        {
                            cbxOldPostLevel.SelectedItem = item;
                            break;
                        }
                    }

                }
                if (SalaryArchive.BALANCE != null)
                {
                    txtbBalance.Text = SalaryArchive.BALANCE.ToString();
                }

                RefreshUI(RefreshedTypes.AuditInfo);
                SetToolBar();
            }
        }
Exemple #17
0
        void ckh_Click(object sender, RoutedEventArgs e)
        {
            CheckBox chk = sender as CheckBox;
            var ent = dgEmployeeList.SelectedItem as PersonnelWS.V_EMPLOYEEVIEW;

            var tmps = from n in SelectedEmployees
                       where n.EMPLOYEEID == ent.EMPLOYEEID
                       select n;

            //这里判断了,但是可能会导致存入不了相同EMPLOYEEID的数据,例如一个员工有两个岗位,
            //那么后面就会只有一条数据,所以注释掉
            //bool bIsNotExists = false;
            //if (tmps != null)
            //{
            //    if (tmps.Count() > 0)
            //    {
            //        bIsNotExists = true;
            //    }
            //}

            //PersonnelWS.T_HR_EMPLOYEE temp = new PersonnelWS.T_HR_EMPLOYEE();
            //temp.EMPLOYEEID = ent.EMPLOYEEID;
            //temp.EMPLOYEECNAME = ent.EMPLOYEECNAME;
            //temp.EMPLOYEECODE = ent.EMPLOYEECODE;
            //temp.SEX = ent.SEX;
            //temp.IDNUMBER = ent.IDNUMBER;
            //temp.OWNERCOMPANYID = ent.OWNERCOMPANYID;
            //temp.OWNERDEPARTMENTID = ent.OWNERDEPARTMENTID;
            //temp.OWNERPOSTID = ent.OWNERPOSTID;


            /// <summary>
            /// Modify Desc:在信息的处理中,在初始值中不能加入列表选择信息,所以在checkbox选择中
            ///             进行数据加入和移除,然后传入到初始值中进行初始化,而且也要注意不同表单
            ///             要传入的值可能不一样,这是目前发现用到的信息,以后有需要可继续加入
            /// Modify Date:2012-8-8

            //信息存入视图
            PersonnelWS.V_EMPLOYEEVIEW temp = new PersonnelWS.V_EMPLOYEEVIEW();
            temp.EMPLOYEEID = ent.EMPLOYEEID;
            temp.EMPLOYEECNAME = ent.EMPLOYEECNAME;
            temp.EMPLOYEECODE = ent.EMPLOYEECODE;
            temp.SEX = ent.SEX;
            temp.IDNUMBER = ent.IDNUMBER;
            temp.OWNERCOMPANYID = ent.OWNERCOMPANYID;
            temp.OWNERDEPARTMENTID = ent.OWNERDEPARTMENTID;
            temp.OWNERPOSTID = ent.OWNERPOSTID;
            temp.ISAGENCY = ent.ISAGENCY;
            temp.POSTLEVEL = ent.POSTLEVEL;
            temp.EMPLOYEEPOSTID = ent.EMPLOYEEPOSTID;
            temp.COMPANYNAME = ent.COMPANYNAME;
            temp.DEPARTMENTNAME = ent.DEPARTMENTNAME;
            temp.POSTNAME = ent.POSTNAME;
            temp.MOBILE = ent.MOBILE;
            temp.OFFICEPHONE = ent.OFFICEPHONE;

            //存入数据到V_EMPLOYEEVIEW视图和部门,岗位表
            PersonnelWS.V_EMPLOYEEVIEW vTemp = new PersonnelWS.V_EMPLOYEEVIEW();
            vTemp.EMPLOYEEID = ent.EMPLOYEEID;
            vTemp.EMPLOYEECNAME = ent.EMPLOYEECNAME;
            vTemp.EMPLOYEECODE = ent.EMPLOYEECODE;
            vTemp.SEX = ent.SEX;
            vTemp.IDNUMBER = ent.IDNUMBER;
            vTemp.OWNERCOMPANYID = ent.OWNERCOMPANYID;
            vTemp.OWNERDEPARTMENTID = ent.OWNERDEPARTMENTID;
            vTemp.OWNERPOSTID = ent.OWNERPOSTID;
            vTemp.DEPARTMENTNAME = ent.DEPARTMENTNAME;
            vTemp.POSTNAME = ent.POSTNAME;
            vTemp.POSTLEVEL = ent.POSTLEVEL;
            vTemp.ISAGENCY = ent.ISAGENCY;
            vTemp.EMPLOYEEPOSTID = ent.EMPLOYEEPOSTID;
            vTemp.MOBILE = ent.MOBILE;
            vTemp.OFFICEPHONE = ent.OFFICEPHONE;

            //信息存入PersonnelWS.T_HR_POSTDICTIONARY里
            PersonnelWS.T_HR_POSTDICTIONARY postDicTemp = new PersonnelWS.T_HR_POSTDICTIONARY();
            postDicTemp.POSTNAME = ent.POSTNAME;
            postDicTemp.POSTLEVEL = ent.POSTLEVEL;

            //信息存入PersonnelWS.T_HR_DEPARTMENTDICTIONARY里
            PersonnelWS.T_HR_DEPARTMENTDICTIONARY departmentTemp = new PersonnelWS.T_HR_DEPARTMENTDICTIONARY();
            departmentTemp.DEPARTMENTNAME = ent.DEPARTMENTNAME;


            //把信息存入PersonnelWS.T_HR_POST,然后再把PersonnelWS.T_HR_POST数据存入PersonnelWS.T_HR_EMPLOYEEPOST
            //最后把数据存入PersonnelWS.T_HR_EMPLOYEEPOST
            //注意他们之间数据类型转换
            PersonnelWS.T_HR_POST tempPerWSPost = new PersonnelWS.T_HR_POST();
            tempPerWSPost.POSTLEVEL = ent.POSTLEVEL;
            tempPerWSPost.POSTID = ent.OWNERPOSTID;


            PersonnelWS.T_HR_EMPLOYEE tempEmployee = new PersonnelWS.T_HR_EMPLOYEE();
            tempEmployee.EMPLOYEECNAME = ent.EMPLOYEECNAME;
            tempEmployee.EMPLOYEEID = ent.EMPLOYEEID;
            tempEmployee.EMPLOYEEENAME = ent.EMPLOYEEENAME;
            tempEmployee.EMPLOYEECODE = ent.EMPLOYEECODE;

            //把PersonnelWS.T_HR_EMPLOYEEPOST信息存入,有些表单可能会用到
            PersonnelWS.T_HR_EMPLOYEEPOST tempPerWSEmployeePost = new PersonnelWS.T_HR_EMPLOYEEPOST();
            tempPerWSEmployeePost.EMPLOYEEPOSTID = ent.EMPLOYEEPOSTID;
            tempPerWSEmployeePost.ISAGENCY = ent.ISAGENCY;
            tempPerWSEmployeePost.POSTLEVEL = ent.POSTLEVEL;
            tempPerWSEmployeePost.T_HR_POST = tempPerWSPost;
            tempPerWSEmployeePost.T_HR_EMPLOYEE = tempEmployee;



            try
            {
                if (chk.IsChecked.Value)
                {
                    //if (!bIsNotExists)
                    //{
                    //单多选进行判断,这段代码目前是为了解决员工考勤方案分配时,
                    //同一员工的考勤分配,一个人有两个岗位情况,那么只算一个考勤分配
                    //到底分配什么考勤方案,那就看情况,目前还不懂考勤分配
                    if (this.MultiSelected == true)
                    {
                        if (SelectedEmployees.Count() == 0)
                        {
                            SelectedDepartment.Add(departmentTemp);
                            SelectedPost.Add(postDicTemp);
                            SelectedEmployees.Add(temp);
                            SelectedPersonnelEmloyeePostNew.Add(tempPerWSEmployeePost);
                        }
                        else
                        {

                            for (int i = 0; i < SelectedEmployees.Count(); i++)
                            {
                                //岗位一样则只算一个,这个地方想了好久的逻辑
                                if (SelectedEmployees[i].EMPLOYEEID == temp.EMPLOYEEID && SelectedEmployees[i].EMPLOYEECNAME==temp.EMPLOYEECNAME)
                                {
                                    break;
                                }
                                if (i == SelectedEmployees.Count() - 1)
                                {
                                    //加入字典信息这两个没有用到,写着为了测试盒调试使用,以后可能有用
                                    SelectedDepartment.Add(departmentTemp);
                                    SelectedPost.Add(postDicTemp);
                                    SelectedEmployees.Add(temp);
                                    SelectedPersonnelEmloyeePostNew.Add(tempPerWSEmployeePost);
                                }
                               
                            }
                        }
                    }
                    if (this.MultiSelected == false)
                    {
                        SelectedDepartment.Add(departmentTemp);
                        SelectedPost.Add(postDicTemp);
                        SelectedEmployees.Add(temp);
                        SelectedPersonnelEmloyeePostNew.Add(tempPerWSEmployeePost);
                    }
                    //}
                }
                else
                {
                    //这里显然是个悲剧,原始的移除根本不起作用,所以在这加个判断,
                    //如果信息一致就移除相应序号的信息,考虑到一个人可能有几个岗位
                    //所以这里不仅要判断员工ID还要判断部门ID和岗位ID,我就不信这人
                    //在一个部门里面还有两个岗位,如果有那他可能就是程序员兼客服兼测试……
                    //那就没办法了
                    for (int i = 0; i < SelectedEmployees.Count(); i++)
                    {
                        if ((SelectedEmployees[i].EMPLOYEEID == temp.EMPLOYEEID) && (SelectedEmployees[i].OWNERDEPARTMENTID == temp.OWNERDEPARTMENTID) && (SelectedEmployees[i].OWNERPOSTID == temp.OWNERPOSTID))
                        {
                            SelectedDepartment.Remove(departmentTemp);
                            SelectedPost.Remove(postDicTemp);
                            SelectedEmployees.RemoveAt(i);
                            SelectedPersonnelEmloyeePostNew.RemoveAt(i);
                        }
                    }

                }
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("CAUTION"), "数据存入缓存错误,可关掉重新选择");
            }
            //if (chk.IsChecked.Value)
            //{
            //    if (!bIsNotExists)
            //    {
            //        SelectedEmployees.Add(temp);
            //    }
            //}
            //else
            //{
            //    if (bIsNotExists)
            //    {
            //        SelectedEmployees.Remove(temp);
            //    }
            //}
        }
Exemple #18
0
        void DocDistrbuteClient_GetDocDistrbuteInfosCompleted(object sender, GetDocDistrbuteInfosCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        distributeList = e.Result;

                        
                        

                        foreach (var h in distributeList)
                        {
                            object obj = new object();
                            SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj extOrgObj = new SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj();
                            if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company).ToString())
                            {
                                SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY tmp = new SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY();
                                tmp.COMPANYID = h.VIEWER;

                                tmp.CNAME = Utility.GetCompanyName(tmp.COMPANYID);
                                obj = tmp;
                                StrCompanyIDsList.Add(h.VIEWER);
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Department).ToString())
                            {
                                SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT tmp = new SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT();
                                tmp.DEPARTMENTID = h.VIEWER;
                                SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENTDICTIONARY tmpdict = new SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENTDICTIONARY();
                                tmpdict.DEPARTMENTNAME = Utility.GetDepartmentName(h.VIEWER);
                                tmp.T_HR_DEPARTMENTDICTIONARY = tmpdict;
                                obj = tmp;
                                StrDepartmentIDsList.Add(h.VIEWER);
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Post).ToString())
                            {
                                SMT.Saas.Tools.OrganizationWS.T_HR_POST tmp = new SMT.Saas.Tools.OrganizationWS.T_HR_POST();
                                tmp.POSTLEVEL = System.Convert.ToDecimal(h.VIEWER);
                                SMT.Saas.Tools.OrganizationWS.T_HR_POSTDICTIONARY tmpdict = new SMT.Saas.Tools.OrganizationWS.T_HR_POSTDICTIONARY();
                                tmpdict.POSTNAME = Utility.GetPostName(h.VIEWER);
                                tmp.T_HR_POSTDICTIONARY = tmpdict;
                                
                                obj = tmp;
                                StrPositionIDsList.Add(h.VIEWER);
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel).ToString())
                            {
                                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE tmp = new SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE();
                                tmp.EMPLOYEEID = h.VIEWER;
                                tmp.EMPLOYEECNAME = Utility.GetDistrbuteUserName(tmp.EMPLOYEEID,vemployeeObj);
                                obj = tmp;
                                if (!(StrStaffList.IndexOf(h.VIEWER) >0))
                                {
                                    StaffList.Add(h.VIEWER);
                                }
                            }
                            extOrgObj.ObjectInstance = obj;
                            issuanceExtOrgObj.Add(extOrgObj);
                        }
                        //personclient.GetEmployeeDetailByParasAsync(StrCompanyIDsList, StrDepartmentIDsList, StrPositionIDsList, StaffList);
                        //RefreshUI(RefreshedTypes.ShowProgressBar);
                        //personclient.GetEmployeeIDsByParasAsync(StrCompanyIDsList,StrDepartmentIDsList,StrPositionIDsList);
                        //StaffList.Clear();//将对象员工清除
                        //personclient.GetEmployeeIDsWithParasAsync(StrCompanyIDsList, true, StrDepartmentIDsList, true, StrPositionIDsList);
                        BindData();
                    }
                }
                else
                {
                    //HtmlPage.Window.Alert(e.Error.ToString());

                    //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), e.Error.Message);
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                }
            }
            catch (Exception ex)
            {
                //HtmlPage.Window.Alert(ex.ToString());
                //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message.ToString()));
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
            }
        }
Exemple #19
0
        private bool Save()
        {
            string strMsg = "";

            //  List<SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();
            RefreshUI(RefreshedTypes.ShowProgressBar);
            if (!CheckData())
            {
                needsubmit = false;
                isSubmit   = false;
                return(false);
            }

            if (lkEmployeeName.DataContext is SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE)
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE employee = lkEmployeeName.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                T_HR_EMPLOYEE ent = new T_HR_EMPLOYEE();
                ent.EMPLOYEEID        = employee.EMPLOYEEID;
                ent.EMPLOYEECNAME     = employee.EMPLOYEECNAME;
                ent.OWNERPOSTID       = employee.OWNERPOSTID;
                ent.OWNERDEPARTMENTID = employee.OWNERDEPARTMENTID;
                ent.OWNERCOMPANYID    = employee.OWNERCOMPANYID;

                EmployeeContract.OWNERCOMPANYID    = employee.OWNERCOMPANYID;
                EmployeeContract.OWNERDEPARTMENTID = employee.OWNERDEPARTMENTID;
                EmployeeContract.OWNERPOSTID       = employee.OWNERPOSTID;
                EmployeeContract.OWNERID           = employee.OWNERID;
                EmployeeContract.T_HR_EMPLOYEE     = ent;
            }


            //上传的文件
            //ctrFile.FormID = EmployeeContract.EMPLOYEECONTACTID;
            //ctrFile.Save();
            //日期转换
            if (falseRabtn.IsChecked == true)
            {
                EmployeeContract.TODATE    = Convert.ToDateTime(dpEndDate.Text).ToShortDateString();
                EmployeeContract.NOENDDATE = "0";
            }
            else
            {
                EmployeeContract.NOENDDATE = "1";
                dpEndDate.Text             = "";
                nudDay.Value          = 0;
                nudDay.IsEnabled      = false;
                employeeContractIsSet = false;
            }

            if (FormType == FormTypes.New)
            {
                //所属
                EmployeeContract.CREATECOMPANYID    = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                EmployeeContract.CREATEDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                EmployeeContract.CREATEPOSTID       = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;

                //EmployeeContract.CHECKSTATE = Convert.ToInt32(CheckStates.UnSubmit).ToString();

                client.EmployeeContractAddAsync(EmployeeContract, strMsg);
            }
            else
            {
                EmployeeContract.UPDATEDATE   = System.DateTime.Now;
                EmployeeContract.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;;
                //client.GetEmployeeContractEngineXmlAsync(EmployeeContract);
                client.EmployeeContractUpdateAsync(EmployeeContract, "Edit");
            }
            return(true);
        }
        void DocDistrbuteClient_GetDocDistrbuteInfosCompleted(object sender, GetDocDistrbuteInfosCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        List<SMT.SaaS.OA.UI.SmtOACommonOfficeService.T_OA_DISTRIBUTEUSER> distributeList = e.Result.ToList();

                        foreach (var h in distributeList)
                        {
                            object obj = new object();
                            SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj extOrgObj = new SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj();
                            if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company).ToString())
                            {
                                SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY tmp = new SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY();
                                tmp.COMPANYID = h.VIEWER;
                                //tmp.CNAME = "";
                                tmp.CNAME = Utility.GetCompanyName(tmp.COMPANYID);
                                obj = tmp;
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Department).ToString())
                            {
                                SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT tmp = new SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT();
                                tmp.DEPARTMENTID = h.VIEWER;
                                SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENTDICTIONARY tmpdict = new SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENTDICTIONARY();
                                //tmpdict.DEPARTMENTNAME = "";
                                tmpdict.DEPARTMENTNAME = Utility.GetDepartmentName(h.VIEWER);
                                tmp.T_HR_DEPARTMENTDICTIONARY = tmpdict;
                                obj = tmp;
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Post).ToString())
                            {
                                SMT.Saas.Tools.OrganizationWS.T_HR_POST tmp = new SMT.Saas.Tools.OrganizationWS.T_HR_POST();
                                tmp.POSTLEVEL = System.Convert.ToDecimal(h.VIEWER);
                                SMT.Saas.Tools.OrganizationWS.T_HR_POSTDICTIONARY tmpdict = new SMT.Saas.Tools.OrganizationWS.T_HR_POSTDICTIONARY();
                                //tmpdict.POSTNAME = "";
                                tmpdict.POSTNAME = Utility.GetPostName(h.VIEWER);
                                tmp.T_HR_POSTDICTIONARY = tmpdict;

                                obj = tmp;
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel).ToString())
                            {
                                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE tmp = new SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE();
                                tmp.EMPLOYEEID = h.VIEWER;
                                tmp.EMPLOYEECNAME = Utility.GetDistrbuteUserName(tmp.EMPLOYEEID, vemployeeObj);
                                obj = tmp;
                                //T_HR_EMPLOYEE tmp = new T_HR_EMPLOYEE();
                                //tmp.EMPLOYEEID = h.VIEWER;
                                //tmp.EMPLOYEECNAME = "";
                                //obj = tmp;
                            }
                            extOrgObj.ObjectInstance = obj;

                            issuanceExtOrgObj.Add(extOrgObj);
                        }
                        BindData();
                    }
                }
                else
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), e.Error.Message);
            }
            catch (Exception ex)
            {
                //HtmlPage.Window.Alert(ex.ToString());
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message.ToString()));
            }
        }
Exemple #21
0
        void DocDistrbuteClient_GetDocDistrbuteInfosCompleted(object sender, GetDocDistrbuteInfosCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        List <SMT.SaaS.OA.UI.SmtOACommonOfficeService.T_OA_DISTRIBUTEUSER> distributeList = e.Result.ToList();

                        foreach (var h in distributeList)
                        {
                            object obj = new object();
                            SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj extOrgObj = new SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj();
                            if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Company).ToString())
                            {
                                SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY tmp = new SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY();
                                tmp.COMPANYID = h.VIEWER;
                                //tmp.CNAME = "";
                                tmp.CNAME = Utility.GetCompanyName(tmp.COMPANYID);
                                obj       = tmp;
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Department).ToString())
                            {
                                SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT tmp = new SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT();
                                tmp.DEPARTMENTID = h.VIEWER;
                                SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENTDICTIONARY tmpdict = new SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENTDICTIONARY();
                                //tmpdict.DEPARTMENTNAME = "";
                                tmpdict.DEPARTMENTNAME        = Utility.GetDepartmentName(h.VIEWER);
                                tmp.T_HR_DEPARTMENTDICTIONARY = tmpdict;
                                obj = tmp;
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Post).ToString())
                            {
                                SMT.Saas.Tools.OrganizationWS.T_HR_POST tmp = new SMT.Saas.Tools.OrganizationWS.T_HR_POST();
                                tmp.POSTLEVEL = System.Convert.ToDecimal(h.VIEWER);
                                SMT.Saas.Tools.OrganizationWS.T_HR_POSTDICTIONARY tmpdict = new SMT.Saas.Tools.OrganizationWS.T_HR_POSTDICTIONARY();
                                //tmpdict.POSTNAME = "";
                                tmpdict.POSTNAME        = Utility.GetPostName(h.VIEWER);
                                tmp.T_HR_POSTDICTIONARY = tmpdict;

                                obj = tmp;
                            }
                            else if (h.VIEWTYPE == ((int)SMT.SaaS.FrameworkUI.OrgTreeItemTypes.Personnel).ToString())
                            {
                                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE tmp = new SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE();
                                tmp.EMPLOYEEID    = h.VIEWER;
                                tmp.EMPLOYEECNAME = Utility.GetDistrbuteUserName(tmp.EMPLOYEEID, vemployeeObj);
                                obj = tmp;
                                //T_HR_EMPLOYEE tmp = new T_HR_EMPLOYEE();
                                //tmp.EMPLOYEEID = h.VIEWER;
                                //tmp.EMPLOYEECNAME = "";
                                //obj = tmp;
                            }
                            extOrgObj.ObjectInstance = obj;

                            issuanceExtOrgObj.Add(extOrgObj);
                        }
                        BindData();
                    }
                }
                else
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), e.Error.Message);
                }
            }
            catch (Exception ex)
            {
                //HtmlPage.Window.Alert(ex.ToString());
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message.ToString()));
            }
        }
Exemple #22
0
        void ckh_Click(object sender, RoutedEventArgs e)
        {
            CheckBox chk = sender as CheckBox;
            var      ent = dgEmployeeList.SelectedItem as PersonnelWS.V_EMPLOYEEVIEW;

            var tmps = from n in SelectedEmployees
                       where n.EMPLOYEEID == ent.EMPLOYEEID
                       select n;

            //这里判断了,但是可能会导致存入不了相同EMPLOYEEID的数据,例如一个员工有两个岗位,
            //那么后面就会只有一条数据,所以注释掉
            //bool bIsNotExists = false;
            //if (tmps != null)
            //{
            //    if (tmps.Count() > 0)
            //    {
            //        bIsNotExists = true;
            //    }
            //}

            //PersonnelWS.T_HR_EMPLOYEE temp = new PersonnelWS.T_HR_EMPLOYEE();
            //temp.EMPLOYEEID = ent.EMPLOYEEID;
            //temp.EMPLOYEECNAME = ent.EMPLOYEECNAME;
            //temp.EMPLOYEECODE = ent.EMPLOYEECODE;
            //temp.SEX = ent.SEX;
            //temp.IDNUMBER = ent.IDNUMBER;
            //temp.OWNERCOMPANYID = ent.OWNERCOMPANYID;
            //temp.OWNERDEPARTMENTID = ent.OWNERDEPARTMENTID;
            //temp.OWNERPOSTID = ent.OWNERPOSTID;


            /// <summary>
            /// Modify Desc:在信息的处理中,在初始值中不能加入列表选择信息,所以在checkbox选择中
            ///             进行数据加入和移除,然后传入到初始值中进行初始化,而且也要注意不同表单
            ///             要传入的值可能不一样,这是目前发现用到的信息,以后有需要可继续加入
            /// Modify Date:2012-8-8

            //信息存入视图
            PersonnelWS.V_EMPLOYEEVIEW temp = new PersonnelWS.V_EMPLOYEEVIEW();
            temp.EMPLOYEEID        = ent.EMPLOYEEID;
            temp.EMPLOYEECNAME     = ent.EMPLOYEECNAME;
            temp.EMPLOYEECODE      = ent.EMPLOYEECODE;
            temp.SEX               = ent.SEX;
            temp.IDNUMBER          = ent.IDNUMBER;
            temp.OWNERCOMPANYID    = ent.OWNERCOMPANYID;
            temp.OWNERDEPARTMENTID = ent.OWNERDEPARTMENTID;
            temp.OWNERPOSTID       = ent.OWNERPOSTID;
            temp.ISAGENCY          = ent.ISAGENCY;
            temp.POSTLEVEL         = ent.POSTLEVEL;
            temp.EMPLOYEEPOSTID    = ent.EMPLOYEEPOSTID;
            temp.COMPANYNAME       = ent.COMPANYNAME;
            temp.DEPARTMENTNAME    = ent.DEPARTMENTNAME;
            temp.POSTNAME          = ent.POSTNAME;
            temp.MOBILE            = ent.MOBILE;
            temp.OFFICEPHONE       = ent.OFFICEPHONE;

            //存入数据到V_EMPLOYEEVIEW视图和部门,岗位表
            PersonnelWS.V_EMPLOYEEVIEW vTemp = new PersonnelWS.V_EMPLOYEEVIEW();
            vTemp.EMPLOYEEID        = ent.EMPLOYEEID;
            vTemp.EMPLOYEECNAME     = ent.EMPLOYEECNAME;
            vTemp.EMPLOYEECODE      = ent.EMPLOYEECODE;
            vTemp.SEX               = ent.SEX;
            vTemp.IDNUMBER          = ent.IDNUMBER;
            vTemp.OWNERCOMPANYID    = ent.OWNERCOMPANYID;
            vTemp.OWNERDEPARTMENTID = ent.OWNERDEPARTMENTID;
            vTemp.OWNERPOSTID       = ent.OWNERPOSTID;
            vTemp.DEPARTMENTNAME    = ent.DEPARTMENTNAME;
            vTemp.POSTNAME          = ent.POSTNAME;
            vTemp.POSTLEVEL         = ent.POSTLEVEL;
            vTemp.ISAGENCY          = ent.ISAGENCY;
            vTemp.EMPLOYEEPOSTID    = ent.EMPLOYEEPOSTID;
            vTemp.MOBILE            = ent.MOBILE;
            vTemp.OFFICEPHONE       = ent.OFFICEPHONE;

            //信息存入PersonnelWS.T_HR_POSTDICTIONARY里
            PersonnelWS.T_HR_POSTDICTIONARY postDicTemp = new PersonnelWS.T_HR_POSTDICTIONARY();
            postDicTemp.POSTNAME  = ent.POSTNAME;
            postDicTemp.POSTLEVEL = ent.POSTLEVEL;

            //信息存入PersonnelWS.T_HR_DEPARTMENTDICTIONARY里
            PersonnelWS.T_HR_DEPARTMENTDICTIONARY departmentTemp = new PersonnelWS.T_HR_DEPARTMENTDICTIONARY();
            departmentTemp.DEPARTMENTNAME = ent.DEPARTMENTNAME;


            //把信息存入PersonnelWS.T_HR_POST,然后再把PersonnelWS.T_HR_POST数据存入PersonnelWS.T_HR_EMPLOYEEPOST
            //最后把数据存入PersonnelWS.T_HR_EMPLOYEEPOST
            //注意他们之间数据类型转换
            PersonnelWS.T_HR_POST tempPerWSPost = new PersonnelWS.T_HR_POST();
            tempPerWSPost.POSTLEVEL = ent.POSTLEVEL;
            tempPerWSPost.POSTID    = ent.OWNERPOSTID;


            PersonnelWS.T_HR_EMPLOYEE tempEmployee = new PersonnelWS.T_HR_EMPLOYEE();
            tempEmployee.EMPLOYEECNAME = ent.EMPLOYEECNAME;
            tempEmployee.EMPLOYEEID    = ent.EMPLOYEEID;
            tempEmployee.EMPLOYEEENAME = ent.EMPLOYEEENAME;
            tempEmployee.EMPLOYEECODE  = ent.EMPLOYEECODE;

            //把PersonnelWS.T_HR_EMPLOYEEPOST信息存入,有些表单可能会用到
            PersonnelWS.T_HR_EMPLOYEEPOST tempPerWSEmployeePost = new PersonnelWS.T_HR_EMPLOYEEPOST();
            tempPerWSEmployeePost.EMPLOYEEPOSTID = ent.EMPLOYEEPOSTID;
            tempPerWSEmployeePost.ISAGENCY       = ent.ISAGENCY;
            tempPerWSEmployeePost.POSTLEVEL      = ent.POSTLEVEL;
            tempPerWSEmployeePost.T_HR_POST      = tempPerWSPost;
            tempPerWSEmployeePost.T_HR_EMPLOYEE  = tempEmployee;



            try
            {
                if (chk.IsChecked.Value)
                {
                    //if (!bIsNotExists)
                    //{
                    //单多选进行判断,这段代码目前是为了解决员工考勤方案分配时,
                    //同一员工的考勤分配,一个人有两个岗位情况,那么只算一个考勤分配
                    //到底分配什么考勤方案,那就看情况,目前还不懂考勤分配
                    if (this.MultiSelected == true)
                    {
                        if (SelectedEmployees.Count() == 0)
                        {
                            SelectedDepartment.Add(departmentTemp);
                            SelectedPost.Add(postDicTemp);
                            SelectedEmployees.Add(temp);
                            SelectedPersonnelEmloyeePostNew.Add(tempPerWSEmployeePost);
                        }
                        else
                        {
                            for (int i = 0; i < SelectedEmployees.Count(); i++)
                            {
                                //岗位一样则只算一个,这个地方想了好久的逻辑
                                if (SelectedEmployees[i].EMPLOYEEID == temp.EMPLOYEEID && SelectedEmployees[i].EMPLOYEECNAME == temp.EMPLOYEECNAME)
                                {
                                    break;
                                }
                                if (i == SelectedEmployees.Count() - 1)
                                {
                                    //加入字典信息这两个没有用到,写着为了测试盒调试使用,以后可能有用
                                    SelectedDepartment.Add(departmentTemp);
                                    SelectedPost.Add(postDicTemp);
                                    SelectedEmployees.Add(temp);
                                    SelectedPersonnelEmloyeePostNew.Add(tempPerWSEmployeePost);
                                }
                            }
                        }
                    }
                    if (this.MultiSelected == false)
                    {
                        SelectedDepartment.Add(departmentTemp);
                        SelectedPost.Add(postDicTemp);
                        SelectedEmployees.Add(temp);
                        SelectedPersonnelEmloyeePostNew.Add(tempPerWSEmployeePost);
                    }
                    //}
                }
                else
                {
                    //这里显然是个悲剧,原始的移除根本不起作用,所以在这加个判断,
                    //如果信息一致就移除相应序号的信息,考虑到一个人可能有几个岗位
                    //所以这里不仅要判断员工ID还要判断部门ID和岗位ID,我就不信这人
                    //在一个部门里面还有两个岗位,如果有那他可能就是程序员兼客服兼测试……
                    //那就没办法了
                    for (int i = 0; i < SelectedEmployees.Count(); i++)
                    {
                        if ((SelectedEmployees[i].EMPLOYEEID == temp.EMPLOYEEID) && (SelectedEmployees[i].OWNERDEPARTMENTID == temp.OWNERDEPARTMENTID) && (SelectedEmployees[i].OWNERPOSTID == temp.OWNERPOSTID))
                        {
                            SelectedDepartment.Remove(departmentTemp);
                            SelectedPost.Remove(postDicTemp);
                            SelectedEmployees.RemoveAt(i);
                            SelectedPersonnelEmloyeePostNew.RemoveAt(i);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("CAUTION"), "数据存入缓存错误,可关掉重新选择");
            }
            //if (chk.IsChecked.Value)
            //{
            //    if (!bIsNotExists)
            //    {
            //        SelectedEmployees.Add(temp);
            //    }
            //}
            //else
            //{
            //    if (bIsNotExists)
            //    {
            //        SelectedEmployees.Remove(temp);
            //    }
            //}
        }
        private bool Save()
        {
            //  List<SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();
            string strMsg = "";

            RefreshUI(RefreshedTypes.ShowProgressBar);
            if (string.IsNullOrEmpty(lkEmployeeName.TxtLookUp.Text))
            {
                //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "EMPLOYEENAME"));
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("STRINGNOTNULL", "EMPLOYEENAME"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                RefreshUI(RefreshedTypes.HideProgressBar);
                return(false);
            }

            //if (validators.Count > 0)
            //{
            //    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIREDFIELDS"));
            //    RefreshUI(RefreshedTypes.HideProgressBar);
            //    return false;
            //}
            if (!SMT.SaaS.FrameworkUI.Common.Utility.CheckDataIsValid(Group1))
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                return(false);
            }
            if (cbInsuranceType.SelectedIndex < 0)
            {
                //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "INSURANCECATEGORY"));
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("STRINGNOTNULL", "INSURANCECATEGORY"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                RefreshUI(RefreshedTypes.HideProgressBar);
                return(false);
            }
            if (!string.IsNullOrEmpty(dpStartDate.Text) && !string.IsNullOrEmpty(dpLastDate.Text))
            {
                DateTime startDate = Convert.ToDateTime(dpStartDate.Text);
                DateTime lastDate  = Convert.ToDateTime(dpLastDate.Text);
                if (startDate > lastDate)
                {
                    //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("DATEERROR", "STARTDATE,LASTDATE"));
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("DATEERROR", "STARTDATE,LASTDATE"),
                                                   Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                    RefreshUI(RefreshedTypes.HideProgressBar);
                    return(false);
                }
            }
            if (lkEmployeeName.DataContext is SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE)
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE employee = lkEmployeeName.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                T_HR_EMPLOYEE temp = new T_HR_EMPLOYEE();
                temp.EMPLOYEEID        = employee.EMPLOYEEID;
                temp.EMPLOYEECNAME     = employee.EMPLOYEECNAME;
                temp.EMPLOYEECODE      = employee.EMPLOYEECODE;
                temp.EMPLOYEEENAME     = employee.EMPLOYEEENAME;
                temp.OWNERPOSTID       = employee.OWNERPOSTID;
                temp.OWNERDEPARTMENTID = employee.OWNERDEPARTMENTID;
                temp.OWNERCOMPANYID    = employee.OWNERCOMPANYID;

                EmployeeInsurance.OWNERID           = employee.EMPLOYEEID;
                EmployeeInsurance.OWNERPOSTID       = employee.OWNERPOSTID;
                EmployeeInsurance.OWNERDEPARTMENTID = employee.OWNERDEPARTMENTID;
                EmployeeInsurance.OWNERCOMPANYID    = employee.OWNERCOMPANYID;

                EmployeeInsurance.T_HR_EMPLOYEE = temp;
            }
            if (FormType == FormTypes.New)
            {
                //所属
                EmployeeInsurance.CREATECOMPANYID    = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                EmployeeInsurance.CREATEDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                EmployeeInsurance.CREATEPOSTID       = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                EmployeeInsurance.CREATEUSERID       = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                EmployeeInsurance.CREATEDATE         = DateTime.Now;


                client.EmployeeInsuranceAddAsync(EmployeeInsurance, strMsg);
            }
            else
            {
                EmployeeInsurance.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                EmployeeInsurance.UPDATEDATE   = DateTime.Now;
                client.EmployeeInsuranceUpdateAsync(EmployeeInsurance, strMsg, "Edit");
            }

            return(true);
        }
Exemple #24
0
        private bool Save()
        {
            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            RefreshUI(RefreshedTypes.ShowProgressBar);
            if (lkEmployeeName.DataContext is SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE)
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE employee = lkEmployeeName.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                T_HR_EMPLOYEE ent = new T_HR_EMPLOYEE();
                ent.EMPLOYEEID        = employee.EMPLOYEEID;
                ent.EMPLOYEECNAME     = employee.EMPLOYEECNAME;
                ent.OWNERPOSTID       = employee.OWNERPOSTID;
                ent.OWNERDEPARTMENTID = employee.OWNERDEPARTMENTID;
                ent.OWNERCOMPANYID    = employee.OWNERCOMPANYID;

                EmployeeCheck.EMPLOYEECODE      = employee.EMPLOYEECODE;
                EmployeeCheck.EMPLOYEENAME      = employee.EMPLOYEECNAME;
                EmployeeCheck.OWNERID           = employee.EMPLOYEEID;
                EmployeeCheck.OWNERPOSTID       = employee.OWNERPOSTID;
                EmployeeCheck.OWNERDEPARTMENTID = employee.OWNERDEPARTMENTID;
                EmployeeCheck.OWNERCOMPANYID    = employee.OWNERCOMPANYID;
                EmployeeCheck.T_HR_EMPLOYEE     = ent;
                //EmployeeCheck.T_HR_EMPLOYEE = employee;
            }
            else
            {
                //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "EMPLOYEENAME"));
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("STRINGNOTNULL", "EMPLOYEENAME"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                RefreshUI(RefreshedTypes.HideProgressBar);
                return(false);
            }
            if (validators.Count > 0)
            {
                //could use the content of the list to show an invalid message summary somehow
                // Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), validators.Count.ToString() + " invalid validators");
                RefreshUI(RefreshedTypes.HideProgressBar);
                return(false);
            }
            if (string.IsNullOrEmpty(dpBeregulardate.Text.Trim()))
            {
                //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "BEREGULARDATE"));
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("STRINGNOTNULL", "BEREGULARDATE"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                RefreshUI(RefreshedTypes.HideProgressBar);
                return(false);
            }
            else
            {
                //对转正日期作校验
                bool   isRightTime      = true;
                string strBeregularDate = dpBeregulardate.Text;
                string strReportDate    = txtReportDate.Text;
                string strOndutyDate    = txtOndutyDate.Text;
                //报道时间
                DateTime beregularDate = Convert.ToDateTime(strBeregularDate);
                if (!string.IsNullOrEmpty(strReportDate))
                {
                    DateTime reportDate = Convert.ToDateTime(strReportDate);
                    if (reportDate != null && reportDate > beregularDate)
                    {
                        isRightTime = false;
                    }
                }
                //到岗时间
                if (!string.IsNullOrEmpty(strOndutyDate))
                {
                    DateTime ondutyDate = Convert.ToDateTime(strOndutyDate);
                    if (ondutyDate != null && ondutyDate > beregularDate)
                    {
                        isRightTime = false;
                    }
                }
                //弹出警告窗
                if (!isRightTime)
                {
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), "抱歉,转正时间须晚于入职时间和到岗时间.",
                                                   Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                    RefreshUI(RefreshedTypes.HideProgressBar);
                    return(false);
                }
            }

            if (FormType == FormTypes.New)
            {
                EmployeeCheck.CREATECOMPANYID    = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                EmployeeCheck.CREATEDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                EmployeeCheck.CREATEPOSTID       = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                EmployeeCheck.OWNERID            = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

                string strMsg = "";
                client.EmployeeCheckAddAsync(EmployeeCheck, strMsg);
            }
            else
            {
                EmployeeCheck.UPDATEDATE   = System.DateTime.Now;
                EmployeeCheck.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;;

                client.EmployeeCheckUpdateAsync(EmployeeCheck, "Edit");
            }

            return(true);
        }
Exemple #25
0
        private void LookUp_FindClick(object sender, EventArgs e)
        {
            //Dictionary<string, string> cols = new Dictionary<string, string>();
            //cols.Add("EMPLOYEECODE", "T_HR_EMPLOYEE.EMPLOYEECODE");
            //cols.Add("EMPLOYEECNAME", "T_HR_EMPLOYEE.EMPLOYEECNAME");
            //cols.Add("EMPLOYEEENAME", "T_HR_EMPLOYEE.EMPLOYEEENAME");
            //LookupForm lookup = new LookupForm(SMT.Saas.Tools.OrganizationWS.EntityNames.Employee,
            //    typeof(SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST[]), cols);

            //lookup.SelectedClick += (o, ev) =>
            //{
            //    SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST ent = lookup.SelectedObj as SMT.Saas.Tools.OrganizationWS.V_EMPLOYEEPOST;;

            //    if (ent != null)
            //    {
            //        lkEmployeeName.DataContext = ent.T_HR_EMPLOYEE;
            //        client.GetEmployeeEntryByEmployeeIDAsync(ent.T_HR_EMPLOYEE.EMPLOYEEID);
            //    }
            //};

            //lookup.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) =>{});
            OrganizationLookup lookup = new OrganizationLookup();

            lookup.SelectedObjType = OrgTreeItemTypes.Personnel;
            lookup.SelectedClick  += (obj, ev) =>
            {
                List <SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj> ent = lookup.SelectedObj as List <SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj>;
                if (ent != null && ent.Count > 0)
                {
                    SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj userInfo = ent.FirstOrDefault();

                    SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj post = (SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj)userInfo.ParentObject;
                    string postid   = post.ObjectID;
                    string postName = post.ObjectName;//岗位

                    SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj dept = (SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj)post.ParentObject;
                    string deptid   = dept.ObjectID;
                    string deptName = dept.ObjectName;//部门


                    SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY corp = (dept.ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT).T_HR_COMPANY;
                    string corpid   = corp.COMPANYID;
                    string corpName = corp.CNAME;//公司

                    SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE emp = userInfo.ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                    T_HR_EMPLOYEEPOST empPost = emp.T_HR_EMPLOYEEPOST.Where(t => t.T_HR_POST.POSTID == postid).FirstOrDefault();
                    if (empPost == null)
                    {
                        ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), "检测员工当前岗位异常,请重试",
                                                       Utility.GetResourceStr("CONFIRM"), MessageIcon.Information);
                        return;
                    }

                    if (empPost.ISAGENCY == "1")
                    {
                        ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), "员工兼职岗位不能转正",
                                                       Utility.GetResourceStr("CONFIRM"), MessageIcon.Information);
                        return;
                    }

                    string StrEmployee = userInfo.ObjectName + "-" + post.ObjectName + "-" + dept.ObjectName + "-" + corp.CNAME;
                    lkEmployeeName.TxtLookUp.Text = StrEmployee;
                    lkEmployeeName.DataContext    = emp;
                    ToolTipService.SetToolTip(lkEmployeeName.TxtLookUp, StrEmployee);

                    if (ent != null)
                    {
                        //client.GetEmployeeEntryByEmployeeIDAsync(ent.EMPLOYEEID);
                        client.GetEmployeeEntryByEmployeeIDAndCOMPANYIDAsync(emp.EMPLOYEEID, emp.OWNERCOMPANYID);
                        client.GetEmployeePostByEmployeeIDAsync(emp.EMPLOYEEID);
                    }
                }


                //SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lookup.SelectedObj[0].ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                //if (ent != null)
                //{
                //    lkEmployeeName.DataContext = ent;
                //    //client.GetEmployeeEntryByEmployeeIDAsync(ent.EMPLOYEEID);
                //    client.GetEmployeeEntryByEmployeeIDAndCOMPANYIDAsync(ent.EMPLOYEEID, ent.OWNERCOMPANYID);
                //    client.GetEmployeePostByEmployeeIDAsync(ent.EMPLOYEEID);
                //}
            };

            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }