Exemplo n.º 1
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;
             accidentInfo = new T_OA_ACCIDENTRECORD();
             accidentInfo.OWNERCOMPANYID    = empInfo.OWNERCOMPANYID;
             accidentInfo.OWNERDEPARTMENTID = empInfo.OWNERDEPARTMENTID;
             accidentInfo.OWNERID           = empInfo.EMPLOYEEID;
             accidentInfo.OWNERNAME         = empInfo.EMPLOYEECNAME;
             if (accidentInfo.OWNERNAME == null)
             {
                 accidentInfo.OWNERNAME = companyInfo.ObjectName;
             }
             accidentInfo.OWNERPOSTID = empInfo.T_HR_EMPLOYEEPOST.FirstOrDefault().EMPLOYEEPOSTID;
             //PersonnelServiceClient psClient = new PersonnelServiceClient();
             //psClient.GetEmployeeByIDAsync(empInfo.EMPLOYEEID);
             //psClient.GetEmployeeByIDCompleted += new EventHandler<GetEmployeeByIDCompletedEventArgs>(psClient_GetEmployeeByIDCompleted);
             txtOwnerName.Text = companyInfo.ObjectName;
         }
     };
     lookup.MultiSelected = true;
     lookup.Show();
 }
Exemplo n.º 2
0
        /// <summary>
        /// 根据查询条件,调用WCF服务获取数据,以便加载数据列表
        /// </summary>
        private void BindGrid()
        {
            int    pageCount = 0;
            string filter    = "";

            System.Collections.ObjectModel.ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>();

            if (lkEmpName.DataContext != null)
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lkEmpName.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                if (!string.IsNullOrEmpty(ent.EMPLOYEEID))
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "EMPLOYEEID==@" + paras.Count().ToString();
                    paras.Add(ent.EMPLOYEEID);
                }
            }

            client.EmployeeCancelLeavePagingAsync(dataPager.PageIndex, dataPager.PageSize, "STARTDATETIME", filter, paras, pageCount, Checkstate, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
            loadbar.Start();
        }
Exemplo n.º 3
0
        /// <summary>
        /// 根据查询条件,调用WCF服务获取数据,以便加载数据列表
        /// </summary>
        private void BindGrid()
        {
            string filter = "";

            System.Collections.ObjectModel.ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>();

            if (lkEmpName.DataContext != null)
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lkEmpName.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                if (!string.IsNullOrEmpty(ent.EMPLOYEEID))
                {
                    paras.Add(ent.EMPLOYEECNAME);
                }
            }
            string strAttendanceSolutionID = string.Empty, strAssignedObjectType = string.Empty, strSortKey = string.Empty, strOwnerID = string.Empty, strCheckState = string.Empty;
            int    pageIndex = 0, pageSize = 0, pageCount = 0;

            strOwnerID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
            strSortKey = " NOATTENDCARDEMPLOYEESID ";
            CheckInputFilter(ref strAttendanceSolutionID, ref strAssignedObjectType, ref strCheckState);
            pageIndex = dataPager.PageIndex;
            pageSize  = dataPager.PageSize;
            if (strCheckState == Convert.ToInt32(CheckStates.All).ToString())
            {
                strCheckState = "";
            }

            //clientAtt.GetNoAttendCardEmployeesPagingAsync(strOwnerID, strCheckState, strAttendanceSolutionID, strAssignedObjectType, strSortKey, pageIndex, pageSize, pageCount);
            clientAtt.GetNoAttendCardEmployeesPagingAsync(dataPager.PageIndex, dataPager.PageSize, "STARTDATE", filter, paras, pageCount, Checkstate, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
            loadbar.Start();
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获取机构对象查询条件
        /// </summary>
        /// <param name="strfilter"></param>
        /// <param name="paras"></param>
        private void GetSearchConditionByOrgObject(ref string strfilter, ref ObservableCollection <object> paras)
        {
            switch (strOrgType.ToUpper())
            {
            case "COMPANY":
                strfilter += " OWNERCOMPANYID == @0";
                paras.Add(strOrgId);
                break;

            case "DEPARTMENT":
                strfilter += " OWNERDEPARTMENTID == @0";
                paras.Add(strOrgId);
                break;

            case "POST":
                strfilter += " OWNERPOSTID == @0";
                paras.Add(strOrgId);
                break;

            case "PERSONNAL":
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE entEmp = lkOrg.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                if (entEmp != null)
                {
                    strfilter += " OWNERID == @0";
                    paras.Add(entEmp.EMPLOYEEID);
                }
                break;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 效验输入内容
        /// </summary>
        /// <param name="strEmployeeID"></param>
        /// <param name="dtPunchDateFrom"></param>
        /// <param name="dtPunchDateTo"></param>
        private void CheckInputFilter(ref string strEmployeeID, ref decimal dBalanceYear, ref decimal dBalanceMonth, ref string strCheckState)
        {
            if (lkEmpName.DataContext != null)
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lkEmpName.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                if (!string.IsNullOrEmpty(ent.EMPLOYEEID))
                {
                    strEmployeeID = ent.EMPLOYEEID.Trim();
                }
            }

            if (!string.IsNullOrEmpty(txtBalanceYear.Text.Trim()))
            {
                decimal.TryParse(txtBalanceYear.Text, out dBalanceYear);
            }

            decimal.TryParse(nudBalanceMonth.Value.ToString(), out dBalanceMonth);

            if (toolbar1.cbxCheckState.SelectedItem != null)
            {
                T_SYS_DICTIONARY entDic = toolbar1.cbxCheckState.SelectedItem as T_SYS_DICTIONARY;
                strCheckState = entDic.DICTIONARYVALUE.ToString();
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 校验输入的查询条件
        /// </summary>
        /// <param name="strEmployeeID"></param>
        /// <param name="strOrgType"></param>
        /// <param name="strOrgValue"></param>
        /// <param name="strEfficDateFrom"></param>
        /// <param name="strEfficDateTo"></param>
        private void CheckInputFilter(ref string strEmployeeID, ref string strOrgType, ref string strOrgValue, ref string strEfficDateFrom, ref string strEfficDateTo)
        {
            if (lkEmpName.DataContext != null)
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lkEmpName.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                if (!string.IsNullOrEmpty(ent.EMPLOYEEID))
                {
                    strEmployeeID = ent.EMPLOYEEID.Trim();
                }
            }
            strOrgType  = treeOrganization.sType;
            strOrgValue = treeOrganization.sValue;
            //TreeViewItem selectedItem = treeOrganization.SelectedItem as TreeViewItem;
            //if (selectedItem != null)
            //{
            //    string IsTag = selectedItem.Tag.ToString();
            //    switch (IsTag)
            //    {
            //        case "0":
            //            T_HR_COMPANY company = selectedItem.DataContext as T_HR_COMPANY;
            //            strOrgType = "Company";
            //            strOrgValue = company.COMPANYID;
            //            break;
            //        case "1":
            //            T_HR_DEPARTMENT department = selectedItem.DataContext as T_HR_DEPARTMENT;
            //            strOrgType = "Department";
            //            strOrgValue = department.DEPARTMENTID;
            //            break;
            //        case "2":
            //            T_HR_POST post = selectedItem.DataContext as T_HR_POST;
            //            strOrgType = "Post";
            //            strOrgValue = post.POSTID;
            //            break;
            //    }
            //}

            strEfficDateFrom = Nuyear.Value.ToString() + "-" + NuStartmounth.Value.ToString() + "-1";
            if (DateTime.Parse(strEfficDateFrom) <= DateTime.Parse("1900-1-1"))
            {
                strEfficDateFrom = string.Empty;
            }

            int iMaxDay = DateTime.DaysInMonth(Nuyear.Value.ToInt32(), NuEndmounth.Value.ToInt32());

            strEfficDateTo = Nuyear.Value.ToString() + "-" + NuEndmounth.Value.ToString() + "-" + iMaxDay.ToString();
            if (DateTime.Parse(strEfficDateTo) <= DateTime.Parse("1900-1-1"))
            {
                strEfficDateTo = string.Empty;
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 查询员工
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lkEmpName_FindClick(object sender, EventArgs e)
        {
            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)
                {
                    lkEmpName.DataContext = ent;
                }
            };

            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Exemplo n.º 8
0
        /// <summary>
        /// 触发绑定DataGrid事件
        /// </summary>
        private void LoadData()
        {
            int    pageCount = 0;
            string filter    = "";

            System.Collections.ObjectModel.ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>();

            if (lkEmpName.DataContext != null)
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lkEmpName.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                if (!string.IsNullOrEmpty(ent.EMPLOYEEID))
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "EMPLOYEENAME==@" + paras.Count().ToString();
                    paras.Add(ent.EMPLOYEECNAME);
                }
            }

            if (this.dpClockInRdStartDate.Text != null && this.dpClockInRdEndDate.Text != null)
            {
                //开始时间
                DateTime startDate = DateTime.Parse(this.dpClockInRdStartDate.Text);
                //结束时间
                DateTime endDate = DateTime.Parse(this.dpClockInRdEndDate.Text);
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }
                filter += "STARTDATE >=@" + paras.Count().ToString();
                paras.Add(startDate);

                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }
                filter += "ENDDATE <=@" + paras.Count().ToString();
                paras.Add(endDate);
            }

            clientAtt.EmployeeOutApplyRecordPagingAsync(dataPager.PageIndex, dataPager.PageSize, "STARTDATE", filter, paras, pageCount, Checkstate, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
            loadbar.Start();
        }
Exemplo n.º 9
0
        /// <summary>
        /// 选择员工
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LookUp_FindClick(object sender, EventArgs e)
        {
            //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;


                    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)
                    {
                        RefreshUI(RefreshedTypes.ShowProgressBar);
                        clientAtt.GetAbnormRecordByEmployeeIDAsync(emp.EMPLOYEEID);
                    }
                }
            };

            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Exemplo n.º 10
0
        /// <summary>
        /// 效验查询输入的查询参数
        /// </summary>
        /// <param name="strEmployeeID">员工序号(唯一,GUID)</param>
        /// <param name="strDateFrom">打卡日期起始时间</param>
        /// <param name="strDateTo">打卡日期截止时间</param>
        private void CheckInputFilter(ref string strEmployeeID, ref string strDateFrom, ref string strDateTo)
        {
            DateTime dtDateFrom = new DateTime();
            DateTime dtDateTo   = new DateTime();

            if (lkEmpName.DataContext != null)
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lkEmpName.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                if (!string.IsNullOrEmpty(ent.EMPLOYEEID))
                {
                    strEmployeeID = ent.EMPLOYEEID.Trim();
                }
            }

            if (!string.IsNullOrEmpty(dpEvectionStartDate.Text.Trim()))
            {
                bool flag = false;
                flag = DateTime.TryParse(dpEvectionStartDate.Text, out dtDateFrom);
                if (flag)
                {
                    strDateFrom = dpEvectionStartDate.Text;
                }
            }

            if (!string.IsNullOrEmpty(dpEvectionEndDate.Text.Trim()))
            {
                bool flag = false;
                flag = DateTime.TryParse(dpEvectionEndDate.Text, out dtDateTo);
                if (flag)
                {
                    strDateTo = dpEvectionEndDate.Text;
                }
            }

            if (dtDateFrom.CompareTo(dtDateTo) > 0)
            {
                dtDateFrom = new DateTime();
                dtDateTo   = new DateTime();
                dpEvectionStartDate.Text = string.Empty;
                dpEvectionEndDate.Text   = string.Empty;
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// 选择考勤方案应用对象
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lkAssignObject_FindClick(object sender, EventArgs e)
        {
            OrganizationLookup lookup = new OrganizationLookup();

            lookup.SelectedObjType = OrgTreeItemTypes.Personnel;
            lookup.MultiSelected   = true;
            lookup.SelectedClick  += (obj, ev) =>
            {
                List <ExtOrgObj> ents = lookup.SelectedObj as List <ExtOrgObj>;
                if (ents == null)
                {
                    return;
                }

                if (ents.Count() == 0)
                {
                    return;
                }

                txtErrorMsg.Text = string.Empty;
                string strCheckCompanyId = string.Empty;


                if (lookup.SelectedObjType == OrgTreeItemTypes.Personnel)
                {
                    SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lookup.SelectedObj[0].ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                    if (ent == null)
                    {
                        return;
                    }
                    CheckSelectedObj(ents);
                }
                else
                {
                    MessageBox.Show("只能选择员工!");
                }
            };

            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Exemplo n.º 12
0
        private void CheckInputFilter(ref string strEmployeeID, ref string strCurStartDate, ref string strCurEndDate)
        {
            if (lkEmpName.DataContext != null)
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lkEmpName.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                if (!string.IsNullOrEmpty(ent.EMPLOYEEID))
                {
                    strEmployeeID = ent.EMPLOYEEID.Trim();
                }
            }

            if (!string.IsNullOrEmpty(dpClockInRdStartDate.Text))
            {
                strCurStartDate = dpClockInRdStartDate.Text;
            }

            if (!string.IsNullOrEmpty(dpClockInRdEndDate.Text))
            {
                strCurEndDate = dpClockInRdEndDate.Text;
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// 根据查询条件,调用WCF服务获取数据,以便加载数据列表
        /// </summary>
        private void BindGrid()
        {
            int    pageCount = 0;
            string filter    = "";

            System.Collections.ObjectModel.ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>();
            string recorderDate = string.Empty;

            if (lkEmpName.DataContext != null)
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lkEmpName.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                if (!string.IsNullOrEmpty(ent.EMPLOYEEID))
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "EMPLOYEEID==@" + paras.Count().ToString();
                    paras.Add(ent.EMPLOYEEID);
                }
            }

            recorderDate = nuYear.Value.ToString() + "-" + nuMonth.Value.ToString() + "-1";
            if (DateTime.Parse(recorderDate) <= DateTime.Parse("1900-1-1"))
            {
                recorderDate = string.Empty;
            }

            if (toolbar1.cbxCheckState.SelectedItem != null)
            {
                T_SYS_DICTIONARY entDic = toolbar1.cbxCheckState.SelectedItem as T_SYS_DICTIONARY;
                Checkstate = entDic.DICTIONARYVALUE.ToString();
            }

            clientAtt.EmployeeSignInRecordPagingAsync(dataPager.PageIndex, dataPager.PageSize, "SIGNINTIME", filter, paras, pageCount, Checkstate, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, recorderDate);
            loadbar.Start();
        }
Exemplo n.º 14
0
        private void lkSubject_FindClick(object sender, EventArgs e)
        {
            if (lkOrg.DataContext == null)
            {
                return;
            }

            Dictionary <string, string> cols = new Dictionary <string, string>();

            cols.Add("SUBJECTCODE", "SUBJECTCODE");
            cols.Add("SUBJECTNAME", "SUBJECTNAME");

            StringBuilder strfilter = new StringBuilder();
            ObservableCollection <object> objArgs = new ObservableCollection <object>();

            switch (strOrgType.ToUpper())
            {
            case "COMPANY":
                strfilter.Append(" OWNERCOMPANYID == @0");
                break;

            case "DEPARTMENT":
                strfilter.Append(" OWNERDEPARTMENTID == @0");
                break;

            case "POST":
                strfilter.Append(" OWNERPOSTID == @0");
                break;

            case "PERSONNAL":
                strfilter.Append(" OWNERPOSTID == @0");
                break;
            }

            if (strOrgType.ToUpper() == "PERSONNAL" && lkOrg.DataContext != null)
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE entEmp = lkOrg.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                if (entEmp != null)
                {
                    strOrgId = entEmp.OWNERPOSTID;
                }
            }

            objArgs.Add(strOrgId);

            LookupForm lookup = new LookupForm(FBAEnumsBLLPrefixNames.Execution,
                                               typeof(T_FB_SUBJECT[]), cols, "MonthlyBudgetAnalysis", strfilter.ToString(), objArgs);

            lookup.SelectedClick += (o, ev) =>
            {
                ObservableCollection <object> entList = lookup.SelectedObj as ObservableCollection <object>;

                StringBuilder strIDlist   = new StringBuilder();
                StringBuilder strNamelist = new StringBuilder();

                foreach (var obj in entList)
                {
                    T_FB_SUBJECT ent = obj as T_FB_SUBJECT;
                    strIDlist.Append(ent.SUBJECTID + ";");
                    strNamelist.Append(ent.SUBJECTNAME + ";");
                }

                strSearchSubjects        = strIDlist.ToString();
                lkSubject.TxtLookUp.Text = strNamelist.ToString();
            };

            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Exemplo n.º 15
0
        /// <summary>
        /// 根据查询条件,调用WCF服务获取数据,以便加载数据列表
        /// </summary>
        private void BindGrid()
        {
            int    pageCount = 0;
            string filter    = "";

            //string filter2 = "";
            System.Collections.ObjectModel.ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>();
            string startDate = string.Empty, recorderDate = string.Empty, employeeID = string.Empty, leaveTypeSetID = string.Empty;//起始时间和结束时间

            if (lkEmpName.DataContext != null)
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lkEmpName.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                if (!string.IsNullOrEmpty(ent.EMPLOYEEID))
                {
                    employeeID = ent.EMPLOYEEID;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "EMPLOYEEID==@" + paras.Count().ToString();
                    paras.Add(ent.EMPLOYEEID);
                }
            }

            if (this.lkLeaveTypeName.DataContext != null)
            {
                T_HR_LEAVETYPESET entLeaveType = this.lkLeaveTypeName.DataContext as T_HR_LEAVETYPESET;

                leaveTypeSetID = entLeaveType.LEAVETYPESETID;
                if (!string.IsNullOrEmpty(entLeaveType.LEAVETYPESETID))
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "T_HR_LEAVETYPESET.LEAVETYPESETID==@" + paras.Count().ToString();
                    paras.Add(entLeaveType.LEAVETYPESETID);
                }
            }

            startDate    = nuYear.Value.ToString() + "-" + startMonth.Value.ToString() + "-1";
            recorderDate = endYear.Value.ToString() + "-" + (nuMonth.Value + 1).ToString() + "-1";
            if (nuMonth.Value == 12)
            {
                recorderDate = (endYear.Value + 1).ToString() + "-1-1";
            }
            if (DateTime.Parse(startDate) <= DateTime.Parse("1900-1-1"))
            {
                startDate = string.Empty;
            }
            if (DateTime.Parse(recorderDate) <= DateTime.Parse("1900-1-1"))
            {
                recorderDate = string.Empty;
            }
            //起始时间
            //if (!string.IsNullOrEmpty(startDate))
            //{
            //    if (!string.IsNullOrEmpty(filter))
            //    {
            //        filter += " and ";
            //    }
            //    filter += "STARTDATETIME>=@" + paras.Count().ToString();
            //    paras.Add(Convert.ToDateTime(startDate));
            //}
            ////结束时间
            //if (!string.IsNullOrEmpty(recorderDate))
            //{
            //    if (!string.IsNullOrEmpty(filter))
            //    {
            //        filter += " and ";
            //    }
            //    filter += "ENDDATETIME<@" + paras.Count().ToString();
            //    paras.Add(Convert.ToDateTime(recorderDate));
            //}

            if (toolbar1.cbxCheckState.SelectedItem != null)
            {
                T_SYS_DICTIONARY entDic = toolbar1.cbxCheckState.SelectedItem as T_SYS_DICTIONARY;
                Checkstate = entDic.DICTIONARYVALUE.ToString();
            }

            client.EmployeeLeaveRecordPagedAsync(dataPager.PageIndex, dataPager.PageSize, "STARTDATETIME", filter, paras, pageCount, Checkstate, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, startDate, recorderDate, employeeID, leaveTypeSetID);
            loadbar.Start();
        }
Exemplo n.º 16
0
        /// <summary>
        /// 导出
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btnOutExcel_Click(object sender, RoutedEventArgs e)
        {
            //ExportToCSV.ExportDataGridSaveAs(dgEmpLeaveRdList);
            dialog.DefaultExt  = ".xls";
            dialog.Filter      = "MS Excel Files|*.xls";
            dialog.FilterIndex = 1;

            result = dialog.ShowDialog();
            if (result.Value == true)
            {
                int    pageCount = 0;
                string filter    = "";

                //string filter2 = "";
                System.Collections.ObjectModel.ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>();
                string startDate = string.Empty, recorderDate = string.Empty, employeeID = string.Empty, leaveTypeSetID = string.Empty;//起始时间和结束时间
                if (lkEmpName.DataContext != null)
                {
                    SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lkEmpName.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                    if (!string.IsNullOrEmpty(ent.EMPLOYEEID))
                    {
                        employeeID = ent.EMPLOYEEID;
                        if (!string.IsNullOrEmpty(filter))
                        {
                            filter += " and ";
                        }
                        filter += "EMPLOYEEID==@" + paras.Count().ToString();
                        paras.Add(ent.EMPLOYEEID);
                    }
                }

                if (this.lkLeaveTypeName.DataContext != null)
                {
                    T_HR_LEAVETYPESET entLeaveType = this.lkLeaveTypeName.DataContext as T_HR_LEAVETYPESET;

                    leaveTypeSetID = entLeaveType.LEAVETYPESETID;
                    if (!string.IsNullOrEmpty(entLeaveType.LEAVETYPESETID))
                    {
                        if (!string.IsNullOrEmpty(filter))
                        {
                            filter += " and ";
                        }
                        filter += "T_HR_LEAVETYPESET.LEAVETYPESETID==@" + paras.Count().ToString();
                        paras.Add(entLeaveType.LEAVETYPESETID);
                    }
                }

                startDate    = nuYear.Value.ToString() + "-" + startMonth.Value.ToString() + "-1";
                recorderDate = endYear.Value.ToString() + "-" + (nuMonth.Value + 1).ToString() + "-1";
                if (nuMonth.Value == 12)
                {
                    recorderDate = (endYear.Value + 1).ToString() + "-1-1";
                }
                if (DateTime.Parse(startDate) <= DateTime.Parse("1900-1-1"))
                {
                    startDate = string.Empty;
                }
                if (DateTime.Parse(recorderDate) <= DateTime.Parse("1900-1-1"))
                {
                    recorderDate = string.Empty;
                }
                //起始时间
                if (!string.IsNullOrEmpty(startDate))
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "STARTDATETIME>=@" + paras.Count().ToString();
                    paras.Add(Convert.ToDateTime(startDate));
                }
                //结束时间
                if (!string.IsNullOrEmpty(recorderDate))
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "ENDDATETIME<@" + paras.Count().ToString();
                    paras.Add(Convert.ToDateTime(recorderDate));
                }

                if (toolbar1.cbxCheckState.SelectedItem != null)
                {
                    T_SYS_DICTIONARY entDic = toolbar1.cbxCheckState.SelectedItem as T_SYS_DICTIONARY;
                    Checkstate = entDic.DICTIONARYVALUE.ToString();
                }
                client.ExportEmployeeLeaveRecordReportsAsync(1, int.MaxValue, "STARTDATETIME", filter, paras, pageCount, Checkstate, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, startDate, recorderDate, employeeID, leaveTypeSetID);

                loadbar.Start();
            }
        }
Exemplo n.º 17
0
        /// <summary>
        /// 效验查询输入的查询参数
        /// </summary>
        /// <param name="strEmployeeID">员工序号(唯一,GUID)</param>
        /// <param name="strPunchDateFrom">打卡日期起始时间</param>
        /// <param name="strPunchDateTo">打卡日期截止时间</param>
        /// <param name="strTimeFrom">打卡时段起始时间</param>
        /// <param name="strTimeTo">打卡时段截止时间</param>
        private void CheckInputFilter(ref string strEmployeeID, ref string strPunchDateFrom, ref string strPunchDateTo, ref string strTimeFrom, ref string strTimeTo)
        {
            DateTime dtPunchDateFrom = new DateTime();
            DateTime dtPunchDateTo   = new DateTime();

            DateTime dtTimeFrom = new DateTime();
            DateTime dtTimeTo   = new DateTime();

            if (lkEmpName.DataContext != null)
            {
                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lkEmpName.DataContext as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;

                if (!string.IsNullOrEmpty(ent.EMPLOYEEID))
                {
                    strEmployeeID = ent.EMPLOYEEID.Trim();
                }
            }

            if (!string.IsNullOrWhiteSpace(dpClockInRdStartDate.Text))
            {
                bool flag = false;
                flag = DateTime.TryParse(dpClockInRdStartDate.Text, out dtPunchDateFrom);
                if (flag)
                {
                    strPunchDateFrom = dpClockInRdStartDate.Text;
                }
            }

            if (!string.IsNullOrEmpty(dpClockInRdEndDate.Text))
            {
                bool flag = false;
                flag = DateTime.TryParse(dpClockInRdEndDate.Text, out dtPunchDateTo);
                if (flag)
                {
                    strPunchDateTo = dpClockInRdEndDate.Text;
                }
            }

            if (dpClockInRdStartTime.Value != null)
            {
                dtTimeFrom = dpClockInRdStartTime.Value.Value;
            }

            if (dpClockInRdEndTime.Value != null)
            {
                dtTimeTo = dpClockInRdEndTime.Value.Value;
            }

            if (dtTimeTo >= dtTimeFrom)
            {
                strTimeFrom = dtTimeFrom.ToString("HH:mm");
                strTimeTo   = dtTimeTo.ToString("HH:mm");
            }

            if (dtPunchDateFrom.CompareTo(dtPunchDateTo) > 0)
            {
                dtPunchDateFrom           = new DateTime();
                dtPunchDateTo             = new DateTime();
                dpClockInRdStartDate.Text = string.Empty;
                dpClockInRdEndDate.Text   = string.Empty;
            }
        }
Exemplo n.º 18
0
        /// <summary>
        /// 分配对象为员工时,检查选择的多个员工是否为同一公司
        /// </summary>
        /// <param name="ents"></param>
        private void CheckSelectedObj(List <ExtOrgObj> ents)
        {
            string strIds = string.Empty, strSelEmpNames = string.Empty, strMsg = string.Empty;

            List <string> entCompanyIds    = new List <string>();
            List <string> entPostIds       = new List <string>();
            List <string> entDepartmentIds = new List <string>();

            foreach (ExtOrgObj item in ents)
            {
                ExtOrgObj objPost = (ExtOrgObj)item.ParentObject;
                if (objPost == null)
                {
                    continue;
                }

                SMT.Saas.Tools.OrganizationWS.T_HR_POST entPost = objPost.ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_POST;
                if (entPost == null)
                {
                    continue;
                }

                //这句阻断,不知道为什么
                //if (entPost.T_HR_DEPARTMENT == null)
                //{
                //    continue;
                //}

                ExtOrgObj objDepartment = (ExtOrgObj)objPost.ParentObject;
                if (objDepartment == null)
                {
                    continue;
                }

                SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT entDepartment = objDepartment.ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT;
                if (entDepartment.T_HR_COMPANY == null)
                {
                    continue;
                }

                if (entPostIds.Contains(entPost.POSTID) == false)
                {
                    entPostIds.Add(entPost.POSTID);
                }

                if (entDepartmentIds.Contains(entDepartment.DEPARTMENTID) == false)
                {
                    entDepartmentIds.Add(entDepartment.DEPARTMENTID);
                }

                if (entCompanyIds.Contains(entDepartment.T_HR_COMPANY.COMPANYID) == false)
                {
                    entCompanyIds.Add(entDepartment.T_HR_COMPANY.COMPANYID);
                }

                SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE entEmp = item.ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                strIds         += entEmp.EMPLOYEEID + ",";
                strSelEmpNames += entDepartment.T_HR_COMPANY.CNAME + "-"
                                  + entDepartment.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME + "-"
                                  + entPost.T_HR_POSTDICTIONARY.POSTNAME + "-" + entEmp.EMPLOYEECNAME + ";";
            }

            lkAssignObject.TxtLookUp.Text = strSelEmpNames;

            //entity.ASSIGNEDOBJECTTYPE = (Convert.ToInt32(AssignedObjectType.Personnel) + 1).ToString();
            entity.EMPLOYEEID   = strIds;
            entity.EMPLOYEENAME = strSelEmpNames;



            SetRecordOwner(entCompanyIds[0]);
        }