Example #1
0
 public SurveyAnswer_sat_1(T_SYS_DICTIONARY ansInfo, int rlt)
 {
     InitializeComponent();
     answerInfo = ansInfo;
     txbAnswerContent.Text = answerInfo.DICTIONARYNAME;
     txbResultCount.Text = "  (" + rlt.ToString() + "票)";     
 }
Example #2
0
        private bool closeFormFlag = false;//是否关闭窗体 false 表示不关闭
        public SysDictionaryForm(FormTypes type, string dictID)
        {

            InitializeComponent();
            InitParas();

            FormType = type;
            if (string.IsNullOrEmpty(dictID))
            {
                dictionary = new T_SYS_DICTIONARY();
                dictionary.DICTIONARYID = Guid.NewGuid().ToString();
                dictionary.CREATEUSER = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                dictionary.CREATEDATE = System.DateTime.Now;

                dictionary.UPDATEDATE = System.DateTime.Now;
                //dictionary.UPDATEUSER = Common.CurrentLoginUserInfo.EmployeeID;
                client.GetSysDictionaryByCategoryAsync("SYSTEMTYPE");
                this.DataContext = dictionary;
            }
            else
            {
                //根据ID获取字典
                client.GetSysDictionaryByIDAsync(dictID);
            }
            lkDictionaryType.TxtLookUp.IsEnabled = true;
            if (type == FormTypes.Browse)
            {
                UnEnableFormControl();
            }
        }
Example #3
0
 public SurveyAnswer_sat(T_SYS_DICTIONARY ansInfo, T_OA_SATISFACTIONRESULT res)
 {
     InitializeComponent();
     answerInfo = ansInfo;
     resultDetail = res;
     empSurveysManage.Result_SurveySubIDCompleted += new EventHandler<Result_SurveySubIDCompletedEventArgs>(Result_SurveySubIDCompleted);
 }
 private List<T_SYS_ENTITYMENU> SelectedMenus = new List<T_SYS_ENTITYMENU>(); //选择的菜单
 private void SearchBtn_Click(object sender, RoutedEventArgs e)
 {
     string StrType = "";
     T_SYS_DICTIONARY selectDict = new T_SYS_DICTIONARY();
     selectDict = cbxSystemType.SelectedItem as T_SYS_DICTIONARY;
     if (selectDict != null)
         StrType = selectDict.DICTIONARYVALUE.ToString();
     addFrm = new SelectMultiMenu(StrType, SelectedMenus);
     EntityBrowser browser = new EntityBrowser(addFrm);
     browser.FormType = FormTypes.Browse;
     browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
     browser.Show<string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { });
 }
Example #5
0
        public static void CbxItemBinder(ComboBox cbx, string category, string defalutValue)
        {
            List <T_SYS_DICTIONARY> dicts = Application.Current.Resources["SYS_DICTIONARY"] as List <T_SYS_DICTIONARY>;
            var ents = dicts.Where(s => s.DICTIONCATEGORY == category).OrderBy(s => s.DICTIONARYVALUE);
            List <T_SYS_DICTIONARY> tempDicts = ents.ToList();

            if (ents == null)
            {
                return;
            }

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

            T_SYS_DICTIONARY nuldict = new T_SYS_DICTIONARY();

            nuldict.DICTIONARYNAME  = Utility.GetResourceStr("ALL");
            nuldict.DICTIONARYVALUE = 5;
            tempDicts.Insert(0, nuldict);

            cbx.ItemsSource       = tempDicts;
            cbx.DisplayMemberPath = "DICTIONARYNAME";
            if (defalutValue != "")
            {
                foreach (var item in cbx.Items)
                {
                    T_SYS_DICTIONARY dict = item as T_SYS_DICTIONARY;
                    if (dict != null)
                    {
                        if (dict.DICTIONARYVALUE.ToString() == defalutValue)
                        {
                            cbx.SelectedItem = item;
                            break;
                        }
                    }
                }
            }
        }
Example #6
0
        private void LoadData()
        {
            loadbar.Start();                                                                                          //打开转动动画
            int    pageCount = 0;
            string filter    = "";                                                                                    //查询过滤条件
            ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); //参数值
            T_SYS_DICTIONARY StrContractLevel   = cbContractLevel.SelectedItem as T_SYS_DICTIONARY;                   //合同级别

            if (!string.IsNullOrEmpty(txtTemplateID.Text.Trim()))
            {
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }
                filter += "contractTemplate.CONTRACTTITLE ^@" + paras.Count().ToString();//模板标题
                paras.Add(txtTemplateID.Text.Trim());
            }
            if (!string.IsNullOrEmpty(txtTemplateName.Text.Trim()))//模板名称
            {
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }
                filter += "contractTemplate.CONTRACTTEMPLATENAME ^@" + paras.Count().ToString();
                paras.Add(txtTemplateName.Text.Trim());
            }
            if (this.cbContractLevel.SelectedIndex > 0) //级别
            {
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }
                filter += "contractTemplate.CONTRACTLEVEL ^@" + paras.Count().ToString();
                paras.Add(StrContractLevel.DICTIONARYVALUE.ToString());
            }
            SMT.SaaS.OA.UI.SmtOADocumentAdminService.LoginUserInfo loginUserInfo = new SMT.SaaS.OA.UI.SmtOADocumentAdminService.LoginUserInfo();
            loginUserInfo.companyID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            loginUserInfo.userID    = Common.CurrentLoginUserInfo.EmployeeID;
            ContractManagement.GetContractTemplateInfoAsync(dpGrid.PageIndex, dpGrid.PageSize, "contractTemplate.CREATEDATE", filter, paras, pageCount, loginUserInfo);
        }
        private void LoadData()
        {
            loadbar.Start();                                                                                          //打开转动动画
            int    pageCount = 0;
            string filter    = "";                                                                                    //查询过滤条件
            ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); //参数值
            T_SYS_DICTIONARY StrContractLevel   = cbContractLevel.SelectedItem as T_SYS_DICTIONARY;                   //合同级别

            if (!string.IsNullOrEmpty(txtSearchID.Text.Trim()))                                                       //合同编号
            {
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }
                filter += "contractApp.CONTRACTCODE ^@" + paras.Count().ToString();
                paras.Add(txtSearchID.Text.Trim());
            }
            if (!string.IsNullOrEmpty(txtSearchType.Text.Trim()))//标题
            {
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }
                filter += "contractApp.CONTRACTTITLE ^@" + paras.Count().ToString();
                paras.Add(txtSearchType.Text.Trim());
            }
            if (this.cbContractLevel.SelectedIndex > 0) //级别
            {
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }
                filter += "contractApp.CONTRACTLEVEL ^@" + paras.Count().ToString();
                paras.Add(StrContractLevel.DICTIONARYVALUE.ToString());
            }
            SMT.SaaS.OA.UI.SmtOADocumentAdminService.LoginUserInfo loginUserInfo = new SMT.SaaS.OA.UI.SmtOADocumentAdminService.LoginUserInfo();
            loginUserInfo.companyID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            loginUserInfo.userID    = Common.CurrentLoginUserInfo.EmployeeID;
            caswsc.GetApprovalListByUserIdAsync(dpGrid.PageIndex, dpGrid.PageSize, "contractApp.CHECKSTATE", filter, paras, pageCount, checkState, loginUserInfo);
        }
Example #8
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return(null);
            }

            List <T_SYS_DICTIONARY> dicts = Application.Current.Resources["SYS_DICTIONARY"] as List <T_SYS_DICTIONARY>;

            if (dicts == null)
            {
                return(value);
            }

            var objs = from a in dicts
                       where a.DICTIONARYVALUE.ToString() == value.ToString() && a.DICTIONCATEGORY == parameter.ToString()
                       select a;

            T_SYS_DICTIONARY dict = objs.Count() > 0 ? objs.FirstOrDefault() : null;

            return(dict == null ? value : dict.DICTIONARYNAME);
        }
Example #9
0
        /// <summary>
        /// 校验输入的查询条件
        /// </summary>
        /// <param name="strVacName"></param>
        /// <param name="strFineType"></param>
        private void CheckInputFilter(ref string strAttSolName, ref string strAttendanceType, ref string strCheckState)
        {
            if (!string.IsNullOrEmpty(txtAttSolName.Text.Trim()))
            {
                strAttSolName = txtAttSolName.Text.Trim();
            }

            if (cbxkAttendanceType.SelectedItem != null)
            {
                T_SYS_DICTIONARY entDic = cbxkAttendanceType.SelectedItem as T_SYS_DICTIONARY;
                if (!string.IsNullOrEmpty(entDic.DICTIONARYID) && !string.IsNullOrEmpty(entDic.DICTIONCATEGORY))
                {
                    strAttendanceType = entDic.DICTIONARYVALUE.ToString();
                }
            }

            if (toolbar1.cbxCheckState.SelectedItem != null)
            {
                T_SYS_DICTIONARY entDic = toolbar1.cbxCheckState.SelectedItem as T_SYS_DICTIONARY;
                strCheckState = entDic.DICTIONARYVALUE.ToString();
            }
        }
Example #10
0
File: Utility.cs Project: JuRogn/OA
        /// <summary>
        /// 将字典值绑定到 combox中
        /// </summary>
        /// <param name="cbx"></param>
        /// <param name="category"></param>
        /// <param name="defalutValue"></param>
        public static void CbxItemBinder(ComboBox cbx, string category, string defalutValue)
        {
            List<T_SYS_DICTIONARY> dicts = Application.Current.Resources["SYS_DICTIONARY"] as List<T_SYS_DICTIONARY>;
            var ents = dicts.Where(s => s.DICTIONCATEGORY == category).OrderBy(s => s.DICTIONARYVALUE);
            List<T_SYS_DICTIONARY> tempDicts = ents.ToList();

            if (ents == null)
            {
                return;
            }

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

            T_SYS_DICTIONARY nuldict = new T_SYS_DICTIONARY();
            nuldict.DICTIONARYNAME = Utility.GetResourceStr("ALL");
            nuldict.DICTIONARYVALUE = 5;
            tempDicts.Insert(0, nuldict);

            cbx.ItemsSource = tempDicts;
            cbx.DisplayMemberPath = "DICTIONARYNAME";
            if (defalutValue != "")
            {
                foreach (var item in cbx.Items)
                {
                    T_SYS_DICTIONARY dict = item as T_SYS_DICTIONARY;
                    if (dict != null)
                    {
                        if (dict.DICTIONARYVALUE.ToString() == defalutValue)
                        {
                            cbx.SelectedItem = item;
                            break;
                        }
                    }
                }
            }
        }
Example #11
0
        /// <summary>
        /// 可用于动态加载字典
        /// </summary>
        /// <param name="dicts"></param>
        /// <param name="category"></param>
        /// <param name="defaultValue"></param>
        public void BindComboBox(List <T_SYS_DICTIONARY> dicts, string category, string defaultValue)
        {
            var objs = from d in dicts
                       where d.DICTIONCATEGORY == category
                       orderby d.DICTIONARYVALUE
                       select d;
            List <T_SYS_DICTIONARY> tmpDicts = objs.ToList();

            if (IsShowNull)
            {
                T_SYS_DICTIONARY nuldict = new T_SYS_DICTIONARY();
                nuldict.DICTIONARYNAME  = "NULL";
                nuldict.DICTIONARYVALUE = 0;
                tmpDicts.Insert(0, nuldict);
            }

            ItemsSource       = tmpDicts;
            DisplayMemberPath = "DICTIONARYNAME";


            SetValue(SelectedValueProperty, defaultValue);
        }
Example #12
0
        private void Save()
        {
            T_SYS_DICTIONARY StrDepCity = cbDepCity.SelectedItem as T_SYS_DICTIONARY;

            _survey.ANSWERGROUPID = StrDepCity.DICTIONARYID;

            _survey.STARTDATE = DateTime.Parse(dpStartDate.Text);
            _survey.ENDDATE   = DateTime.Parse(dpEndDate.Text);
            _survey.WAY       = cmbWay.SelectedIndex.ToString();
            _survey.OPTFLAG   = (bool)ckbOptFlag.IsChecked ? "1" : "0";
            if (issuanceExtOrgObj.Count == 0)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTFIRST", "DISTRBUTEOBJECT"));
                return;
            }
            //else
            //{
            //    foreach (var h in issuanceExtOrgObj)
            //    {
            //        //是更新还是新增
            //        var entity = _osub.Where(s => s.FORMID == h.ObjectID).FirstOrDefault();
            //        if (entity != null)
            //        {
            //            entity.UPDATEDATE = DateTime.Now;
            //            entity.UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;
            //            entity.UPDATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;
            //            //entity.EntityKey = null;
            //            distributeLists.Add(entity);
            //        }
            //        else
            //        {
            //            AddDistributeObjList(h, _survey.SATISFACTIONREQUIREID);
            //        }
            //    }
            //}
            //_VM.Upd_SSurveyAppAsync(_survey, distributeLists,submitflag);
            _VM.Upd_SSurveyAppAsync(_survey);
        }
Example #13
0
        void _VM_GetApprovalTypeByCompanyandDepartmentidCompleted(object sender, GetApprovalTypeByCompanyandDepartmentidCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                lstApprovalids.Clear();
                lstApprovalids = e.Result;
                List <T_SYS_DICTIONARY> Dicts = Application.Current.Resources["SYS_DICTIONARY"] as List <T_SYS_DICTIONARY>;

                if (Dicts == null)
                {
                    return;
                }

                T_SYS_DICTIONARY DictApproval = new T_SYS_DICTIONARY();

                var ents = from p in Dicts
                           where p.DICTIONCATEGORY == "TYPEAPPROVAL" && p.T_SYS_DICTIONARY2 != null && lstApprovalids.Contains(p.DICTIONARYVALUE.ToString())
                           orderby p.ORDERNUMBER
                           select p;
                if (ents.Count() > 0)
                {
                }
                else
                {
                }
                StrApprovaltype = "";
                txtSelectPost.TxtSelectedApprovalType.Text = "";
                if (DictApproval != null)
                {
                    if (!string.IsNullOrEmpty(DictApproval.DICTIONARYID))//存在则赋值
                    {
                        txtSelectPost.TxtSelectedApprovalType.Text = DictApproval.DICTIONARYNAME;
                        StrApprovaltype = DictApproval.DICTIONARYVALUE.ToString();
                        GetFatherApprovalType(StrApprovaltype, "first");
                    }
                }
            }
        }
Example #14
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();
        }
Example #15
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return(null);
            }

            List <T_SYS_DICTIONARY> dicts = Application.Current.Resources["SYS_DICTIONARY"] as List <T_SYS_DICTIONARY>;

            if (dicts == null)
            {
                return(value);
            }

            //新加的
            if (parameter.ToString() == "FBARepayType")
            {
                string v = value.ToString();
                if (!String.IsNullOrWhiteSpace(v))
                {
                    var strArr = v.Split(',');
                    if (strArr.Length == 2)
                    {
                        value     = strArr[1];
                        parameter = strArr[0];
                    }
                }
            }

            var objs = from a in dicts
                       where a.DICTIONARYVALUE.ToString() == value.ToString() && a.DICTIONCATEGORY == parameter.ToString()
                       select a;


            T_SYS_DICTIONARY dict = objs.Count() > 0 ? objs.FirstOrDefault() : null;

            return(dict == null ? value : dict.DICTIONARYNAME);
        }
Example #16
0
        /// <summary>
        /// 控制打卡方式的显示
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cbxkAttendanceType_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Visibility       vib    = Visibility.Collapsed;
            T_SYS_DICTIONARY entDic = cbxkAttendanceType.SelectedItem as T_SYS_DICTIONARY;

            if (entDic != null)
            {
                if (entDic.DICTIONARYVALUE != null)
                {
                    if (entDic.DICTIONARYVALUE == (Convert.ToInt32(AttendanceType.NoCheck) + 1) || entDic.DICTIONARYVALUE == (Convert.ToInt32(AttendanceType.LoginCheck) + 1))
                    {
                        vib = Visibility.Collapsed;
                    }
                    else
                    {
                        vib = Visibility.Visible;
                    }
                }
            }

            tbCardTypeTitle.Visibility = vib;
            cbxkCardType.Visibility    = vib;
        }
Example #17
0
        private void cbxCheckState_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            T_SYS_DICTIONARY dict = ToolBar.cbxCheckState.SelectedItem as T_SYS_DICTIONARY;

            if (dict != null)
            {
                SMT.SaaS.FrameworkUI.Common.Utility.SetToolBarButtonByCheckState(dict.DICTIONARYVALUE.Value.ToInt32(), ToolBar, "T_OA_HOUSEINFOISSUANCE");
                checkState  = dict.DICTIONARYVALUE.ToString();
                issuanceObj = null;
                LoadData();
            }


            //if (ToolBar.cbxCheckState.SelectedItem != null)
            //{
            //    checkState = Utility.GetCbxSelectItemValue(ToolBar.cbxCheckState);
            //    issuanceObj = null;
            //    GridHelper.SetUnCheckAll(dgHouse);
            //    //SetButtonVisible();
            //    //SMT.SaaS.FrameworkUI.Common.Utility.SetToolBarButtonByCheckState(int.Parse(checkState), ToolBar, "T_OA_HOUSEINFOISSUANCE");
            //    LoadData();
            //}
        }
Example #18
0
        private void UpdateInfo(T_OA_MAINTENANCERECORD info)
        {
            T_SYS_DICTIONARY StrDepCity = cmbRepairName.SelectedItem as T_SYS_DICTIONARY;

            info.T_OA_MAINTENANCEAPP = info.T_OA_MAINTENANCEAPP;
            info.MAINTENANCETYPE     = StrDepCity.DICTIONARYNAME.ToString();
            info.TEL     = txtTel.Text;
            info.CONTENT = txtContent.Text;
            info.REMARK  = txtReMark.Text;

            info.ISCHARGE    = ckbHasFee.IsChecked == true ? "1" : "0";
            info.CHARGEMONEY = ckbHasFee.IsChecked == true?Convert.ToDecimal(txtFee.Text) : 0;

            info.REPAIRDATE    = DateTime.Parse(dateREPAIRDATE.Text);
            info.RETRIEVEDATE  = DateTime.Parse(dateRETRIEVEDATE.Text);
            info.REPAIRCOMPANY = txtREPAIRCOMPANY.Text;
            info.TEL           = txtTel.Text;

            info.UPDATEDATE   = System.DateTime.Now;
            info.UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;

            _VM.Upd_VMRecordAsync(info);
        }
        /// <summary>
        /// 校验输入的查询条件
        /// </summary>
        /// <param name="strVacName"></param>
        /// <param name="strFineType"></param>
        private void CheckInputFilter(ref string strAttendanceSolutionID, ref string strAssignedObjectType, ref string strCheckState)
        {
            if (lkAttSol.DataContext != null)
            {
                T_HR_ATTENDANCESOLUTION ent = lkAttSol.DataContext as T_HR_ATTENDANCESOLUTION;
                strAttendanceSolutionID = ent.ATTENDANCESOLUTIONID;
            }

            if (cbxkAssignedObjectType.SelectedItem != null)
            {
                T_SYS_DICTIONARY entDic = cbxkAssignedObjectType.SelectedItem as T_SYS_DICTIONARY;
                if (!string.IsNullOrEmpty(entDic.DICTIONARYID) && !string.IsNullOrEmpty(entDic.DICTIONCATEGORY))
                {
                    strAssignedObjectType = entDic.DICTIONARYVALUE.ToString();
                }
            }

            if (toolbar1.cbxCheckState.SelectedItem != null)
            {
                T_SYS_DICTIONARY entDic = toolbar1.cbxCheckState.SelectedItem as T_SYS_DICTIONARY;
                strCheckState = entDic.DICTIONARYVALUE.ToString();
            }
        }
Example #20
0
        private void UpdateInfo(T_OA_MAINTENANCEAPP info)
        {
            T_SYS_DICTIONARY StrDepCity = cmbRepairName.SelectedItem as T_SYS_DICTIONARY;

            info.MAINTENANCETYPE = StrDepCity.DICTIONARYNAME.ToString();
            info.T_OA_VEHICLE    = (T_OA_VEHICLE)cmbVehicleAssetId.SelectedItem;
            //info.MAINTENANCETYPE = ((SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY)cmbRepairName.SelectedItem).DICTIONARYNAME.ToString();
            info.TEL     = txtTel.Text;
            info.CONTENT = txtContent.Text;
            info.REMARK  = txtReMark.Text;

            info.ISCHARGE    = ckbHasFee.IsChecked == true ? "1" : "0";
            info.CHARGEMONEY = ckbHasFee.IsChecked == true?Convert.ToDecimal(txtFee.Text) : 0;

            info.REPAIRDATE    = DateTime.Parse(dateREPAIRDATE.Text);
            info.RETRIEVEDATE  = DateTime.Parse(dateRETRIEVEDATE.Text);
            info.REPAIRCOMPANY = txtREPAIRCOMPANY.Text;
            info.TEL           = txtTel.Text;

            info.UPDATEDATE   = System.DateTime.Now;
            info.UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;
            _VM.UpdateMaintenanceAppAsync(info);
            conserVation = info;
        }
Example #21
0
        /// <summary>
        /// 交通工具类型选择事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ComVechileType_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var tempDetail = DGVechileStandard.SelectedItem as T_OA_TAKETHESTANDARDTRANSPORT;

            TravelDictionaryComboBox vechiletype = sender as TravelDictionaryComboBox;

            if (vechiletype.SelectedIndex > 0)
            {
                T_SYS_DICTIONARY VechileTypeObj = vechiletype.SelectedItem as T_SYS_DICTIONARY;
                if (tempDetail != null)
                {
                    tempDetail.TYPEOFTRAVELTOOLS = VechileTypeObj.DICTIONARYVALUE.ToString();
                }

                if (DGVechileStandard.SelectedItem != null)
                {
                    if (DGVechileStandard.Columns[1].GetCellContent(DGVechileStandard.SelectedItem) != null)
                    {
                        TravelDictionaryComboBox ComLevel = DGVechileStandard.Columns[2].GetCellContent(DGVechileStandard.SelectedItem).FindName("ComVechileTypeLeve") as TravelDictionaryComboBox;

                        var ListObj = from ent in ListVechileLevel
                                      where ent.T_SYS_DICTIONARY2.DICTIONARYID == VechileTypeObj.DICTIONARYID
                                      select ent;
                        if (ListObj.Count() > 0)
                        {
                            if (ListObj != null)
                            {
                                //ListObj.ToList().Insert(0, nuldict);
                                ComLevel.ItemsSource   = ListObj.ToList();
                                ComLevel.SelectedIndex = 0;
                            }
                        }
                    }
                }
            }
        }
Example #22
0
        /// <summary>
        /// 可用于动态加载字典
        /// </summary>
        /// <param name="dicts"></param>
        /// <param name="category"></param>
        /// <param name="defaultValue"></param>
        public void BindComboBox(List <T_SYS_DICTIONARY> dicts, string category, string defaultValue)
        {
            //Deployment.Current.Dispatcher.BeginInvoke(() => this.DataContext = dicts);
            var objs = from d in dicts
                       where d.DICTIONCATEGORY == category
                       orderby d.DICTIONARYVALUE
                       select d;
            List <T_SYS_DICTIONARY> tmpDicts = objs.ToList();

            if (IsShowNull)
            {
                T_SYS_DICTIONARY nuldict  = new T_SYS_DICTIONARY();
                string           dictname = Utility.GetResourceStr("PLEASESELECTED");

                nuldict.DICTIONARYNAME  = dictname;
                nuldict.DICTIONARYVALUE = -1;
                tmpDicts.Insert(0, nuldict);
            }

            this.ItemsSource  = tmpDicts;
            DisplayMemberPath = "DICTIONARYNAME";
            SetSelectedItem(defaultValue);
            EventAttention.Set();
        }
Example #23
0
        /// <summary>
        /// 可用于动态加载字典
        /// </summary>
        /// <param name="dicts"></param>
        /// <param name="category"></param>
        /// <param name="defaultValue"></param>
        public void BindComboBox(List <T_SYS_DICTIONARY> dicts, string category, string defaultValue)
        {
            var objs = from d in dicts
                       where d.DICTIONCATEGORY == category
                       orderby d.DICTIONARYVALUE
                       select d;
            List <T_SYS_DICTIONARY> tmpDicts = objs.ToList();

            if (IsShowNull)
            {
                T_SYS_DICTIONARY nuldict  = new T_SYS_DICTIONARY();
                string           dictname = Utility.GetResourceStr("PLEASESELECTL", category.ToUpper());

                nuldict.DICTIONARYNAME  = dictname;
                nuldict.DICTIONARYVALUE = null;
                tmpDicts.Insert(0, nuldict);
            }

            ItemsSource       = tmpDicts;
            DisplayMemberPath = "DICTIONARYNAME";


            SetValue(SelectedValueProperty, defaultValue);
        }
Example #24
0
        /// <summary>
        /// 加载菜单数据
        /// </summary>
        private void LoadData()
        {
            //ServiceClient.GetSysRoleByTypeAsync(this.txtSearchSystemType.Text.Trim());
            string filter    = "";                                                                                    //查询过滤条件
            int    pageCount = 0;
            ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); //参数值
            ComboBox         cbxSystemType      = Utility.FindChildControl <ComboBox>(expander, "cbxSystemType");
            TextBox          RoleName           = Utility.FindChildControl <TextBox>(expander, "TxtRoleName");
            T_SYS_DICTIONARY dict        = cbxSystemType.SelectedItem as T_SYS_DICTIONARY;
            string           StrRoleName = "";

            StrRoleName = RoleName.Text;



            //if (!string.IsNullOrEmpty(txtEmpCode.Text.Trim()))
            //{
            //    //filter += "EMPLOYEECODE==@" + paras.Count().ToString();
            //    filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEECODE)";
            //    paras.Add(txtEmpCode.Text.Trim());
            //}


            string systype = "";

            if (dict != null)
            {
                systype = dict.DICTIONARYVALUE == null ? "" : dict.DICTIONARYVALUE.GetValueOrDefault().ToString();
            }
            if (!string.IsNullOrEmpty(systype))
            {
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }
                filter += "SYSTEMTYPE ==@" + paras.Count().ToString();//类型名称
                paras.Add(systype);
            }
            string       sValue       = "";
            TreeViewItem selectedItem = treeOrganization.SelectedItem as TreeViewItem;

            if (selectedItem != null)
            {
                string IsTag = selectedItem.Tag.ToString();
                switch (IsTag)
                {
                case "Company":
                    SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY company = selectedItem.DataContext as SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY;
                    //sType = "Company";
                    sValue = company.COMPANYID;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "OWNERCOMPANYID ==@" + paras.Count().ToString();    //类型名称
                    paras.Add(sValue);
                    break;

                case "Department":
                    SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT department = selectedItem.DataContext as SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT;
                    //sType = "Department";
                    sValue = department.DEPARTMENTID;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "OWNERDEPARTMENTID ==@" + paras.Count().ToString();    //类型名称
                    paras.Add(sValue);
                    break;
                }
            }
            if (string.IsNullOrEmpty(filter))
            {
                //默认为自己公司的角色
                filter += "OWNERCOMPANYID ==@" + paras.Count().ToString();//类型名称
                paras.Add(Common.CurrentLoginUserInfo.UserPosts[0].CompanyID);
            }

            if (!string.IsNullOrEmpty(StrRoleName))
            {
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }

                //filter += " @" + paras.Count().ToString() + ".Contains(ROLENAME)";//类型名称
                //filter += "ROLENAME  ^@" + paras.Count().ToString();//类型名称
                filter += " @" + paras.Count().ToString() + ".Contains(ROLENAME)";
                paras.Add(StrRoleName);
            }
            loadbar.Start();
            SMT.Saas.Tools.PermissionWS.LoginUserInfo loginUserInfo = new SMT.Saas.Tools.PermissionWS.LoginUserInfo();
            loginUserInfo.companyID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            loginUserInfo.userID    = Common.CurrentLoginUserInfo.EmployeeID;
            //只能查看自己所在公司的角色
            //CompanyIDList.Clear();
            //CompanyIDList.Add(Common.CurrentLoginUserInfo.UserPosts);
            //if (Common.CurrentLoginUserInfo.UserPosts.Count() > 0)
            //{
            //    foreach (var str in Common.CurrentLoginUserInfo.UserPosts)
            //    {
            //        CompanyIDList.Add(str.CompanyID);
            //    }
            //}
            ServiceClient.GetSysRoleInfosPagingByCompanyIDsAsync(dataPager.PageIndex, dataPager.PageSize, "CREATEDATE",
                                                                 filter, paras, pageCount, loginUserInfo, CompanyIDList);
        }
Example #25
0
        public void SysDictionaryUpdate(T_SYS_DICTIONARY dict, ref string strMsg)
        {
            using (SysDictionaryBLL bll = new SysDictionaryBLL())
            {

                bll.SysDictionaryUpdate(dict, ref strMsg);
            }
        }
Example #26
0
        void BindModelCode(T_SYS_DICTIONARY DICTIONARY)//绑定模块代码
        {
            cbModelCode.ItemsSource = null;
            if (AgentSetInfo != null && DICTIONARY != null && ModelDefineList != null)
            {
                List<SMT.Saas.Tools.FlowDesignerWS.FLOW_MODELDEFINE_T> tmpModelDefine = ModelDefineList.Where(c => c.SYSTEMCODE == ((T_SYS_DICTIONARY)cbSYSTEMTYPE.SelectedItem).SYSTEMCODE).ToList();
                SMT.Saas.Tools.FlowDesignerWS.FLOW_MODELDEFINE_T tmp = new SMT.Saas.Tools.FlowDesignerWS.FLOW_MODELDEFINE_T();
                tmp.DESCRIPTION = Utility.GetResourceStr("PLEASESELECTL");
                tmpModelDefine.Insert(0, tmp);

                if (tmpModelDefine.Count > 0)
                {
                    cbModelCode.ItemsSource = tmpModelDefine;
                    cbModelCode.DisplayMemberPath = "DESCRIPTION";
                    cbModelCode.SelectedIndex = 0;
                }
            }
        }
Example #27
0
        /// <summary>
        /// 可用于动态加载字典
        /// </summary>
        /// <param name="dicts"></param>
        /// <param name="category"></param>
        /// <param name="defaultValue"></param>
        public void BindComboBox(List<T_SYS_DICTIONARY> dicts, string category, string defaultValue)
        {
            //Deployment.Current.Dispatcher.BeginInvoke(() => this.DataContext = dicts);
            var objs = from d in dicts
                       where d.DICTIONCATEGORY == category
                       orderby d.DICTIONARYVALUE
                       select d;
            List<T_SYS_DICTIONARY> tmpDicts = objs.ToList();

            if (IsShowNull)
            {
                T_SYS_DICTIONARY nuldict = new T_SYS_DICTIONARY();
                string dictname = Utility.GetResourceStr("PLEASESELECTED");

                nuldict.DICTIONARYNAME = dictname;
                nuldict.DICTIONARYVALUE = -1;
                tmpDicts.Insert(0, nuldict);
            }

            this.ItemsSource = tmpDicts;
            DisplayMemberPath = "DICTIONARYNAME";
            SetSelectedItem(defaultValue);
            EventAttention.Set();
        }
Example #28
0
        /// <summary>
        /// 获取 选取的事项审批的类型 父级的 字典值
        /// </summary>
        /// <param name="apptype"></param>
        /// <param name="forcount"></param>
        private void GetFatherApprovalType(string apptype, string forcount)
        {
            //获取缓存--字典值
            try
            {
                List<T_SYS_DICTIONARY> Dicts = Application.Current.Resources["SYS_DICTIONARY"] as List<T_SYS_DICTIONARY>;

                if (Dicts == null)
                {
                    return;
                }
                List<T_SYS_DICTIONARY> TopApproval = new List<T_SYS_DICTIONARY>();
                //获取  事项审批类型的字典集合
                var ents = from p in Dicts
                           where p.DICTIONCATEGORY == "TYPEAPPROVAL" && p.DICTIONARYVALUE == System.Convert.ToInt16(apptype)
                           orderby p.ORDERNUMBER
                           select p;
                T_SYS_DICTIONARY dict = new T_SYS_DICTIONARY();
                if (ents.Count() > 0)
                {
                    dict = ents.FirstOrDefault();
                    //获取父值的信息
                    if (dict.T_SYS_DICTIONARY2 != null)
                    {
                        var firstents = from ent in Dicts
                                        where ent.DICTIONCATEGORY == "TYPEAPPROVAL" && (ent.DICTIONARYID == dict.T_SYS_DICTIONARY2.DICTIONARYID && dict.T_SYS_DICTIONARY2 != null)
                                        orderby ent.ORDERNUMBER
                                        select ent;
                        if (firstents.Count() > 0)
                        {
                            if (forcount == "first")
                            {
                                StrApprovalOne = firstents.FirstOrDefault().DICTIONARYVALUE.ToString();
                                GetFatherApprovalType(StrApprovalOne, "second");
                            }
                            if (forcount == "second")
                            {
                                StrApprovalTwo = firstents.FirstOrDefault().DICTIONARYVALUE.ToString();
                                GetFatherApprovalType(StrApprovalTwo, "second");
                            }
                            if (forcount == "third")
                            {
                                StrApprovalThird = firstents.FirstOrDefault().DICTIONARYVALUE.ToString();
                                GetFatherApprovalType(StrApprovalThird, "third");
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Current.Log("获取事项审批类型" + ex.Message, Category.Debug, Priority.Low);
                throw (ex);
            }
        }
Example #29
0
        private void Save()
        {
            try
            {
                string StrTitle        = ""; //标题
                string StrTmeplateName = ""; //模板名
                string StrGrade        = ""; //级别
                string Strtype         = ""; //类型
                string StrProritity    = ""; //缓急
                //string StrContent = "";//内容
                string StrError = "";        //记录错误信息


                StrTitle        = this.txtTemplateTitle.Text.Trim().ToString();
                StrTmeplateName = this.txtTemplateName.Text.Trim().ToString();
                if (this.cbxGrade.SelectedIndex == 0 || this.cbxGrade.SelectedIndex == -1)
                {
                    //Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("SENDDOCGRADENOTNULL"));
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SENDDOCGRADENOTNULL"),
                                                   Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                    return;
                }
                if (this.cbxProritity.SelectedIndex == 0 || this.cbxProritity.SelectedIndex == -1)
                {
                    //Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("REQUIRED", "PRIORITY"));
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIRED", "PRIORITY"),
                                                   Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                    return;
                }
                T_SYS_DICTIONARY GradeObj     = cbxGrade.SelectedItem as T_SYS_DICTIONARY;     //级别
                T_SYS_DICTIONARY ProritityObj = cbxProritity.SelectedItem as T_SYS_DICTIONARY; //缓急
                StrGrade     = GradeObj.DICTIONARYNAME.ToString();
                StrProritity = ProritityObj.DICTIONARYNAME.ToString();
                Strtype      = this.cbxDocType.SelectedItem.ToString();
                //StrContent = this.txtContent.Text.Trim().ToString();
                if (string.IsNullOrEmpty(StrTitle))
                {
                    //Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("REQUIRED", "SENDDOCTITLE"));
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIRED", "SENDDOCTITLE"),
                                                   Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                    return;
                }
                if (string.IsNullOrEmpty(StrTmeplateName))
                {
                    //StrError += "模板名称不能为空\n";
                    //Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("REQUIRED", "OATEMPLATENAME"));
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIRED", "OATEMPLATENAME"),
                                                   Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                    return;
                }
                //else
                //{
                //    StrContent = HttpUtility.HtmlEncode(StrContent);
                //}
                if (txtContent.Document.Count() == 0)
                {
                    //StrError += "模板内容不能为空\n";
                    //Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("REQUIRED", "CONTENT"));
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIRED", "CONTENT"),
                                                   Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                    this.txtContent.Focus();
                    return;
                }
                else
                {
                    //if (StrContent.Length < 10)
                    //{
                    //    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("CONTENTNOTLESSTHANTEN"));
                    //    this.txtContent.Focus();
                    //    return;
                    //}
                }
                //if (this.cbxGrade.SelectedIndex ==0)
                //{
                //    //Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("SENDDOCGRADENOTNULL"));
                //    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SENDDOCGRADENOTNULL"),
                //    Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                //    return;
                //}
                //if (this.cbxProritity.SelectedIndex ==0)
                //{
                //    //Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("REQUIRED", "PRIORITY"));
                //    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIRED", "PRIORITY"),
                //    Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                //    return;
                //}
                if (string.IsNullOrEmpty(Strtype))
                {
                    //Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("SENDDOCPRIORITYNOTNULL"));
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SENDDOCPRIORITYNOTNULL"),
                                                   Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                    return;
                }
                if (CheckDocTypeTemplate())
                {
                    RefreshUI(RefreshedTypes.ProgressBar);
                    if (action == Action.Add)
                    {
                        tmpDocTypeTemplateT.SENDDOCTEMPLATEID = System.Guid.NewGuid().ToString();
                        tmpDocTypeTemplateT.SENDDOCTITLE      = StrTitle;
                        tmpDocTypeTemplateT.TEMPLATENAME      = StrTmeplateName;
                        tmpDocTypeTemplateT.SENDDOCTYPE       = Strtype;
                        tmpDocTypeTemplateT.PRIORITIES        = StrProritity;
                        tmpDocTypeTemplateT.GRADED            = StrGrade;
                        tmpDocTypeTemplateT.CONTENT           = txtContent.Document;
                        tmpDocTypeTemplateT.CREATEDATE        = System.DateTime.Now;

                        tmpDocTypeTemplateT.OWNERCOMPANYID     = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                        tmpDocTypeTemplateT.OWNERDEPARTMENTID  = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                        tmpDocTypeTemplateT.OWNERID            = Common.CurrentLoginUserInfo.EmployeeID;
                        tmpDocTypeTemplateT.OWNERNAME          = Common.CurrentLoginUserInfo.EmployeeName;
                        tmpDocTypeTemplateT.OWNERPOSTID        = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                        tmpDocTypeTemplateT.CREATECOMPANYID    = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                        tmpDocTypeTemplateT.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                        tmpDocTypeTemplateT.CREATEUSERNAME     = Common.CurrentLoginUserInfo.EmployeeName;
                        tmpDocTypeTemplateT.CREATEPOSTID       = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                        tmpDocTypeTemplateT.CREATEUSERID       = Common.CurrentLoginUserInfo.EmployeeID;

                        tmpDocTypeTemplateT.UPDATEUSERNAME = "";
                        tmpDocTypeTemplateT.UPDATEDATE     = null;
                        tmpDocTypeTemplateT.UPDATEUSERID   = "";

                        DocTypeTemplateClient.DocTypeTemplateAddAsync(tmpDocTypeTemplateT);
                    }
                    else
                    {
                        if (tmpDocTypeTemplateT != null)
                        {
                            tmpDocTypeTemplateT.SENDDOCTITLE = StrTitle;
                            tmpDocTypeTemplateT.TEMPLATENAME = StrTmeplateName;
                            tmpDocTypeTemplateT.SENDDOCTYPE  = Strtype;
                            tmpDocTypeTemplateT.PRIORITIES   = StrProritity;
                            tmpDocTypeTemplateT.GRADED       = StrGrade;

                            tmpDocTypeTemplateT.CONTENT           = txtContent.Document;
                            tmpDocTypeTemplateT.OWNERCOMPANYID    = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                            tmpDocTypeTemplateT.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                            tmpDocTypeTemplateT.OWNERID           = Common.CurrentLoginUserInfo.EmployeeID;
                            tmpDocTypeTemplateT.OWNERNAME         = Common.CurrentLoginUserInfo.EmployeeName;
                            tmpDocTypeTemplateT.OWNERPOSTID       = Common.CurrentLoginUserInfo.UserPosts[0].PostID;


                            tmpDocTypeTemplateT.UPDATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;
                            tmpDocTypeTemplateT.UPDATEDATE     = System.DateTime.Now;
                            tmpDocTypeTemplateT.UPDATEUSERID   = Common.CurrentLoginUserInfo.EmployeeID;
                            tmpStrDocTypeName      = Strtype;
                            tempStrDocTemplateName = StrTmeplateName;
                            string StrReturn = "";
                            DocTypeTemplateClient.DocTypeTemplateInfoUpdateAsync(tmpDocTypeTemplateT, StrReturn);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                //Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), ex.ToString());
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
            }
        }
        /// <summary>
        /// 编辑页面绑定grid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DaGrEdit_LoadingRow(object sender, DataGridRowEventArgs e)
        {
            try
            {
                T_OA_REIMBURSEMENTDETAIL tmp = (T_OA_REIMBURSEMENTDETAIL)e.Row.DataContext;
                //出发时间
                DateTimePicker dpStartTime = DaGrEdit.Columns[0].GetCellContent(e.Row).FindName("StartTime") as DateTimePicker;
                //出发城市
                SearchCity myCityFrom = DaGrEdit.Columns[1].GetCellContent(e.Row).FindName("txtDEPARTURECITY") as SearchCity;
                //到达时间
                DateTimePicker dpEndTime = DaGrEdit.Columns[2].GetCellContent(e.Row).FindName("EndTime") as DateTimePicker;
                //到达城市
                SearchCity myCityTo = DaGrEdit.Columns[3].GetCellContent(e.Row).FindName("txtTARGETCITIES") as SearchCity;
                //交通费
                TextBox txtTranSportcosts = DaGrEdit.Columns[8].GetCellContent(e.Row).FindName("txtTRANSPORTCOSTS") as TextBox;
                //住宿费
                TextBox txtASubsidies = DaGrEdit.Columns[9].GetCellContent(e.Row).FindName("txtACCOMMODATION") as TextBox;
                //交通补贴
                TextBox txtTFSubsidies = DaGrEdit.Columns[10].GetCellContent(e.Row).FindName("txtTRANSPORTATIONSUBSIDIES") as TextBox;
                //餐费补贴
                TextBox txtMealSubsidies = DaGrEdit.Columns[11].GetCellContent(e.Row).FindName("txtMEALSUBSIDIES") as TextBox;
                TravelDictionaryComboBox ComVechile = DaGrEdit.Columns[6].GetCellContent(e.Row).FindName("ComVechileType") as TravelDictionaryComboBox;
                TravelDictionaryComboBox ComLevel = DaGrEdit.Columns[7].GetCellContent(e.Row).FindName("ComVechileTypeLeve") as TravelDictionaryComboBox;
                //其他费用
                TextBox txtOtherCosts = DaGrEdit.Columns[12].GetCellContent(e.Row).FindName("txtOtherCosts") as TextBox;
                CheckBox IsCheck = DaGrEdit.Columns[13].GetCellContent(e.Row).FindName("myChkBox") as CheckBox;
                CheckBox IsCheckMeet = DaGrEdit.Columns[14].GetCellContent(e.Row).FindName("myChkBoxMeet") as CheckBox;
                CheckBox IsCheckCar = DaGrEdit.Columns[15].GetCellContent(e.Row).FindName("myChkBoxCar") as CheckBox;
                //ImageButton MyButton_Delbaodao = DaGrEdit.Columns[16].GetCellContent(e.Row).FindName("myDelete") as ImageButton;
                //行程修改-不允许修改出差
                dpStartTime.IsEnabled = false;
                myCityFrom.IsEnabled = false;
                dpEndTime.IsEnabled = false;
                myCityTo.IsEnabled = false;
                ((DataGridCell)((StackPanel)dpStartTime.Parent).Parent).IsEnabled = false;
                ((DataGridCell)((StackPanel)myCityFrom.Parent).Parent).IsEnabled = false;
                ((DataGridCell)((StackPanel)dpEndTime.Parent).Parent).IsEnabled = false;
                ((DataGridCell)((StackPanel)myCityTo.Parent).Parent).IsEnabled = false;
                //对默认控件的颜色进行赋值                
                tempcomTypeBorderBrush = ComVechile.BorderBrush;
                tempcomTypeForeBrush = ComVechile.Foreground;
                tempcomLevelBorderBrush = ComLevel.BorderBrush;
                tempcomLevelForeBrush = ComLevel.Foreground;
                txtASubsidiesForeBrush = txtASubsidies.Foreground;
                txtASubsidiesBorderBrush = txtASubsidies.BorderBrush;
                T_OA_AREAALLOWANCE entareaallowance = new T_OA_AREAALLOWANCE();

                if (BtnNewButton == true)
                {
                    myCityTo.TxtSelectedCity.Text = string.Empty;
                }
                else
                {
                    BtnNewButton = false;
                }

                //MyButton_Delbaodao.Margin = new Thickness(0);
                //MyButton_Delbaodao.AddButtonAction("/SMT.SaaS.FrameworkUI;Component/Images/ToolBar/ico_16_delete.png", Utility.GetResourceStr("DELETE"));
                //MyButton_Delbaodao.Tag = tmp;
                myCityFrom.Tag = tmp;
                myCityTo.Tag = tmp;

                //查询出发城市&目标城市&&将ID转换为Name
                if (DaGrEdit.ItemsSource != null)
                {
                    ObservableCollection<T_OA_REIMBURSEMENTDETAIL> objs = DaGrEdit.ItemsSource as ObservableCollection<T_OA_REIMBURSEMENTDETAIL>;
                    int i = 0;
                    foreach (var obje in objs)
                    {

                        if (obje.REIMBURSEMENTDETAILID == tmp.REIMBURSEMENTDETAILID)//判断记录的ID是否相同
                        {
                            string dictid = "";
                            ComVechile.SelectedIndex = 0;
                            ComLevel.SelectedIndex = 0;
                            DaGrEdit.SelectedItem = e.Row;
                            T_SYS_DICTIONARY type = new T_SYS_DICTIONARY();
                            T_SYS_DICTIONARY level = new T_SYS_DICTIONARY();

                            entareaallowance = StandardsMethod(i);

                            if (formType != FormTypes.New)
                            {
                                if (myCityFrom != null)//出发城市
                                {
                                    if (obje.DEPCITY != null)
                                    {
                                        //注释原因:obje.depcity仍然是中文而不是数字
                                        myCityFrom.TxtSelectedCity.Text = GetCityName(tmp.DEPCITY);
                                        if (TravelDetailList_Golbal.Count() > 1)
                                        {
                                            if (i > 1)
                                            {
                                                myCityFrom.IsEnabled = false;
                                                ((DataGridCell)((StackPanel)myCityFrom.Parent).Parent).IsEnabled = false;
                                            }
                                        }
                                    }
                                }
                                if (myCityTo != null)//目标城市
                                {
                                    if (obje.DESTCITY != null)
                                    {
                                        myCityTo.TxtSelectedCity.Text = GetCityName(obje.DESTCITY);
                                    }
                                }
                                if (obje.PRIVATEAFFAIR == "1")//私事
                                {
                                    IsCheck.IsChecked = true;
                                }
                                if (obje.GOOUTTOMEET == "1")//外出开会
                                {
                                    IsCheckMeet.IsChecked = true;
                                }
                                if (obje.COMPANYCAR == "1")//公司派车
                                {
                                    IsCheckCar.IsChecked = true;
                                }
                                //交通费
                                if (txtTranSportcosts != null)
                                {
                                    txtTranSportcosts.Text = obje.TRANSPORTCOSTS.ToString();
                                }

                                if (txtASubsidies != null)//住宿费
                                {
                                    txtASubsidies.Text = obje.ACCOMMODATION.ToString();
                                    if (i>0 && i == objs.Count - 1)
                                    {
                                        txtASubsidies.IsReadOnly = true;
                                    }
                                }
                                //其他费用
                                if (txtOtherCosts != null)
                                {
                                    txtOtherCosts.Text = obje.OTHERCOSTS.ToString();
                                }
                                if (txtTFSubsidies != null)//交通补贴
                                {
                                    txtTFSubsidies.Text = obje.TRANSPORTATIONSUBSIDIES.ToString();
                                    ((DataGridCell)((StackPanel)txtTFSubsidies.Parent).Parent).IsEnabled = false;
                                    if (EmployeePostLevel.ToInt32() > travelsolutions.NOALLOWANCEPOSTLEVEL.ToInt32())//当前用户的岗位级别小于副部长I级以上级别的补贴标准
                                    {
                                        //在正常状态下如果没有获取到补贴(没有对应的城市补贴或其他导致的问题)提示用户是否继续操作
                                        if (string.IsNullOrWhiteSpace(txtTFSubsidies.Text))
                                        {
                                            ComfirmWindow com = new ComfirmWindow();
                                            com.OnSelectionBoxClosed += (obj, result) =>
                                            {
                                                //txtTranSportcosts.IsReadOnly = true;//交通费
                                                //txtASubsidies.IsReadOnly = true;//住宿标准
                                                //txtOtherCosts.IsReadOnly = true;//其他费用
                                            };
                                            if (formType == FormTypes.Audit || formType == FormTypes.Browse
                                                  || obje.GOOUTTOMEET == "1" || obje.COMPANYCAR == "1") return;
                                            if (obje.REIMBURSEMENTDETAILID == objs.LastOrDefault().REIMBURSEMENTDETAILID)
                                            {
                                                return;//最后一条无补贴
                                            }
                                            if (obje.TRANSPORTATIONSUBSIDIES == null || obje.TRANSPORTATIONSUBSIDIES == 0)
                                            {
                                                com.SelectionBox("操作确认", "当前单据没有获取到交通补贴,是否继续操作?", ComfirmWindow.titlename, "");
                                            }
                                        }
                                    }
                                }
                                if (txtMealSubsidies != null)//餐费补贴
                                {
                                    txtMealSubsidies.Text = obje.MEALSUBSIDIES.ToString();
                                    ((DataGridCell)((StackPanel)txtMealSubsidies.Parent).Parent).IsEnabled = false;
                                    if (EmployeePostLevel.ToInt32() > travelsolutions.NOALLOWANCEPOSTLEVEL.ToInt32())//当前用户的岗位级别小于副部长及以上级别的补贴标准
                                    {
                                        //在正常状态下如果没有获取到补贴(没有对应的城市补贴或其他导致的问题)提示用户是否继续操作
                                        if (string.IsNullOrWhiteSpace(txtMealSubsidies.Text))
                                        {
                                            ComfirmWindow com = new ComfirmWindow();
                                            com.OnSelectionBoxClosed += (obj, result) =>
                                            {
                                                //txtTranSportcosts.IsReadOnly = true;//交通费
                                                //txtASubsidies.IsReadOnly = true;//住宿标准
                                                //txtOtherCosts.IsReadOnly = true;//其他费用
                                            };
                                            if (formType == FormTypes.Audit || formType == FormTypes.Browse
                                              || obje.GOOUTTOMEET == "1") return;
                                            if (obje.REIMBURSEMENTDETAILID == objs.LastOrDefault().REIMBURSEMENTDETAILID)
                                            {
                                                return;//最后一条无补贴
                                            }
                                            if (obje.MEALSUBSIDIES == null
                                                || obje.MEALSUBSIDIES == 0)
                                            {
                                                com.SelectionBox("操作确认", "当前单据没有获取到餐费补贴,是否继续操作?", ComfirmWindow.titlename, "");
                                            }
                                        }
                                    }
                                }

                                #region 查看和审核时隐藏DataGrid模板中的控件
                                if (formType == FormTypes.Browse || formType == FormTypes.Audit)
                                {
                                    txtASubsidies.IsReadOnly = true;
                                    txtTFSubsidies.IsReadOnly = true;
                                    txtMealSubsidies.IsReadOnly = true;
                                    txtOtherCosts.IsReadOnly = true;
                                    txtTranSportcosts.IsReadOnly = true;
                                    ComVechile.IsEnabled = false;
                                    ComLevel.IsEnabled = false;
                                }
                                if (formType != FormTypes.New || formType != FormTypes.Edit)
                                {
                                    if (TravelReimbursement_Golbal.CHECKSTATE != ((int)CheckStates.UnSubmit).ToString())
                                    {
                                        txtASubsidies.IsReadOnly = true;
                                        txtTFSubsidies.IsReadOnly = true;
                                        txtMealSubsidies.IsReadOnly = true;
                                        txtOtherCosts.IsReadOnly = true;
                                        txtTranSportcosts.IsReadOnly = true;
                                        ComVechile.IsEnabled = false;
                                        ComLevel.IsEnabled = false;
                                    }
                                }
                                if (entareaallowance != null)
                                {
                                    decimal days = System.Convert.ToDecimal(obje.THENUMBEROFNIGHTS);
                                    if (days.ToDouble() == 0.5)
                                    {
                                        days = 1;
                                    }
                                    else
                                    {
                                        days = decimal.Truncate(days);
                                    }
                                    if (txtASubsidies.Text.ToDouble() > entareaallowance.ACCOMMODATION.ToDouble() * days.ToDouble())//判断住宿费超标
                                    {
                                        txtASubsidies.BorderBrush = new SolidColorBrush(Colors.Red);
                                        txtASubsidies.Foreground = new SolidColorBrush(Colors.Red);
                                        txtAccommodation.Visibility = Visibility.Visible;
                                        this.txtAccommodation.Text = "住宿费超标";
                                    }
                                    if (txtASubsidies.Text.ToDouble() <= entareaallowance.ACCOMMODATION.ToDouble() * days.ToDouble())
                                    {
                                        if (txtASubsidiesForeBrush != null)
                                        {
                                            txtASubsidies.Foreground = txtASubsidiesForeBrush;
                                        }
                                        if (txtASubsidiesBorderBrush != null)
                                        {
                                            txtASubsidies.BorderBrush = txtASubsidiesBorderBrush;
                                        }
                                    }
                                }
                                #endregion

                                #region 获取交通工具类型和级别
                                if (ComVechile != null)//交通工具类型
                                {
                                    type = ComVechile.SelectedItem as T_SYS_DICTIONARY;
                                    level = ComLevel.SelectedItem as T_SYS_DICTIONARY;
                                    var thd = takethestandardtransport.FirstOrDefault();
                                    thd = this.GetVehicleTypeValue("");

                                    foreach (T_SYS_DICTIONARY Region in ComVechile.Items)
                                    {
                                        if (thd != null)
                                        {
                                            dictid = Region.DICTIONARYID;
                                            if (Region.DICTIONARYVALUE.ToString() == tmp.TYPEOFTRAVELTOOLS)
                                            {
                                                if (takethestandardtransport.Count() > 0)
                                                {
                                                    ComVechile.SelectedItem = Region;
                                                    if (thd.TYPEOFTRAVELTOOLS.ToInt32() > Region.DICTIONARYVALUE)
                                                    {
                                                        ComVechile.BorderBrush = new SolidColorBrush(Colors.Red);
                                                        ComVechile.Foreground = new SolidColorBrush(Colors.Red);
                                                        ComLevel.BorderBrush = new SolidColorBrush(Colors.Red);
                                                        ComLevel.Foreground = new SolidColorBrush(Colors.Red);
                                                        this.txtTips.Visibility = Visibility.Visible;
                                                        this.txtTips.Text = "交通工具超标";
                                                    }
                                                    if (thd.TYPEOFTRAVELTOOLS.ToInt32() <= Region.DICTIONARYVALUE)
                                                    {
                                                        if (tempcomTypeBorderBrush != null)
                                                        {
                                                            ComVechile.BorderBrush = tempcomTypeBorderBrush;
                                                        }
                                                        if (tempcomTypeForeBrush != null)
                                                        {
                                                            ComVechile.Foreground = tempcomTypeForeBrush;
                                                        }
                                                    }
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                }
                                if (ComLevel != null)//交通工具级别
                                {
                                    var ents = from ent in ListVechileLevel
                                               where ent.T_SYS_DICTIONARY2.DICTIONARYID == dictid
                                               select ent;
                                    ComLevel.ItemsSource = ents.ToList();
                                    if (ents.Count() > 0)
                                    {
                                        type = ComVechile.SelectedItem as T_SYS_DICTIONARY;
                                        level = ComLevel.SelectedItem as T_SYS_DICTIONARY;

                                        var thd = takethestandardtransport.FirstOrDefault();
                                        if (type != null)
                                        {
                                            thd = this.GetVehicleTypeValue(type.DICTIONARYVALUE.ToString());
                                        }
                                        if (thd != null)
                                        {
                                            foreach (T_SYS_DICTIONARY RegionLevel in ComLevel.Items)
                                            {
                                                if (RegionLevel.DICTIONARYVALUE.ToString() == tmp.TAKETHETOOLLEVEL)
                                                {
                                                    ComLevel.SelectedItem = RegionLevel;
                                                    if (thd.TAKETHETOOLLEVEL.ToInt32() <= RegionLevel.DICTIONARYVALUE)
                                                    {
                                                        if (tempcomLevelForeBrush != null)
                                                        {
                                                            ComLevel.Foreground = tempcomLevelForeBrush;
                                                        }
                                                        if (tempcomLevelBorderBrush != null)
                                                        {
                                                            ComLevel.BorderBrush = tempcomLevelBorderBrush;
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (thd.TAKETHETOOLLEVEL.ToInt32() > RegionLevel.DICTIONARYVALUE)
                                                        {
                                                            ComLevel.BorderBrush = new SolidColorBrush(Colors.Red);
                                                            ComLevel.Foreground = new SolidColorBrush(Colors.Red);
                                                            this.txtTips.Visibility = Visibility.Visible;
                                                            this.txtTips.Text = "交通工具超标";
                                                            return;
                                                        }
                                                        else
                                                        {
                                                            if (tempcomLevelForeBrush != null)
                                                            {
                                                                ComLevel.Foreground = tempcomLevelForeBrush;
                                                            }
                                                            if (tempcomLevelBorderBrush != null)
                                                            {
                                                                ComLevel.BorderBrush = tempcomLevelBorderBrush;
                                                            }
                                                        }
                                                    }
                                                    break;
                                                }
                                            }
                                        }
                                    }// ComLevel != null
                                }
                                #endregion
                            }
                            else
                            {
                                continue;
                            }
                        }
                        i++;
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Current.Log(ex.Message, Category.Debug, Priority.Low);
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            }
        }
Example #31
0
        private void btnBalanceCalculate_Click(object sender, RoutedEventArgs e)
        {
            RefreshUI(RefreshedTypes.ShowProgressBar);
            if (cbxkAssignedObjectType.SelectedItem == null)
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                return;
            }

            if (lkAssignObject.DataContext == null)
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                return;
            }

            bool flag  = false;
            int  iYear = 0;

            flag = int.TryParse(txtBalanceYear.Text, out iYear);
            if (iYear <= 0)
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                return;
            }

            int iYearCheck = DateTime.Now.Year;

            if (iYear >= iYearCheck)
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("OUTYEARLYBALANCE"));
                return;
            }

            T_SYS_DICTIONARY entDic = cbxkAssignedObjectType.SelectedItem as T_SYS_DICTIONARY;

            if (string.IsNullOrEmpty(entDic.DICTIONARYID) || string.IsNullOrEmpty(entDic.DICTIONCATEGORY) || string.IsNullOrEmpty(entDic.DICTIONARYVALUE.ToString()))
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                return;
            }

            if (entDic.DICTIONARYVALUE.ToString() == (Convert.ToInt32(AssignedObjectType.Company) + 1).ToString())
            {
                T_HR_COMPANY entCompany   = lkAssignObject.DataContext as T_HR_COMPANY;
                string       strCompanyID = entCompany.COMPANYID;

                clientAtt.CalculateEmployeeAttendanceYearlyByCompanyIDAsync(iYear.ToString(), strCompanyID);
            }
            else if (entDic.DICTIONARYVALUE.ToString() == (Convert.ToInt32(AssignedObjectType.Department) + 1).ToString())
            {
                T_HR_DEPARTMENT entDepartment   = lkAssignObject.DataContext as T_HR_DEPARTMENT;
                string          strDepartmentID = entDepartment.DEPARTMENTID;

                clientAtt.CalculateEmployeeAttendanceYearlyByDepartmentIDAsync(iYear.ToString(), strDepartmentID);
            }
            else if (entDic.DICTIONARYVALUE.ToString() == (Convert.ToInt32(AssignedObjectType.Post) + 1).ToString())
            {
                T_HR_POST entPost   = lkAssignObject.DataContext as T_HR_POST;
                string    strPostID = entPost.POSTID;

                clientAtt.CalculateEmployeeAttendanceYearlyByPostIDAsync(iYear.ToString(), strPostID);
            }
        }
Example #32
0
        /// <summary>
        /// 组织查询条件,查询数据
        /// </summary>
        private void QueryData()
        {
            DateTime dtStart   = new DateTime();
            DateTime dtEnd     = new DateTime();
            int      pageCount = 0;
            string   filter    = "";                                                   //查询过滤条件

            ObservableCollection <object> paras = new ObservableCollection <object>(); //参数值

            // 开始时间
            if (!string.IsNullOrEmpty(this.dpStart.Text.Trim()))
            {
                dtStart = Convert.ToDateTime(this.dpStart.Text);
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }
                filter += "T_OA_REQUIRE.STARTDATE >= @" + paras.Count();
                paras.Add(dtStart);
            }
            // 结束时间
            if (!string.IsNullOrEmpty(this.dpEnd.Text.Trim()))
            {
                dtEnd = Convert.ToDateTime(this.dpEnd.Text);
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }
                filter += "T_OA_REQUIRE.ENDDATE <= @" + paras.Count();
                paras.Add(dtEnd);
            }

            if (!string.IsNullOrEmpty(this.dpStart.Text.Trim()) && !string.IsNullOrEmpty(this.dpEnd.Text.Trim()))
            {
                if (dtStart > dtEnd)
                {
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("FAILED"), "警告", "开始时间不能大于结束时间", MessageIcon.None);
                    return;
                }
            }
            if (!string.IsNullOrEmpty(this.txtSurveysTITLE.Text.Trim()))
            {
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }
                filter += " @" + paras.Count() + ".Contains(DISTRIBUTETITLE)";
                paras.Add(this.txtSurveysTITLE.Text.Trim());
            }

            // 审核状态
            T_SYS_DICTIONARY audit      = this.ToolBar.cbxCheckState.SelectedItem as T_SYS_DICTIONARY;
            string           checkState = "5";

            if (audit != null)
            {
                checkState = audit.DICTIONARYVALUE.ToString();
            }

            loadbar.Start();
            client.GetRequireDistributeAsync(dataPager.PageIndex, dataPager.PageSize, "T_OA_REQUIRE.STARTDATE", filter, paras, pageCount, Common.CurrentLoginUserInfo.EmployeeID, checkState);
        }
        /// <summary>
        /// 查看、审核时用(将DataGr模版中的控件全部替换为TextBlock,以便在新平台中节约空间)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DaGrReadOnly_LoadingRow(object sender, DataGridRowEventArgs e)
        {
            try
            {
                #region 设置值
                T_OA_REIMBURSEMENTDETAIL obje = (T_OA_REIMBURSEMENTDETAIL)e.Row.DataContext;

                TextBlock StartDate = DaGrReadOnly.Columns[0].GetCellContent(e.Row).FindName("tbStartTime") as TextBlock;
                TextBlock EndDate = DaGrReadOnly.Columns[2].GetCellContent(e.Row).FindName("tbEndTime") as TextBlock;
                //出发城市
                TextBlock myCity = DaGrReadOnly.Columns[1].GetCellContent(e.Row).FindName("tbDEPARTURECITY") as TextBlock;
                //到达城市
                TextBlock myCitys = DaGrReadOnly.Columns[3].GetCellContent(e.Row).FindName("tbTARGETCITIES") as TextBlock;
                //交通费
                TextBox txtToolubsidies = DaGrReadOnly.Columns[8].GetCellContent(e.Row).FindName("tbtxtTRANSPORTCOSTS") as TextBox;
                //住宿费
                TextBox txtASubsidies = DaGrReadOnly.Columns[9].GetCellContent(e.Row).FindName("tbtxtACCOMMODATION") as TextBox;
                //交通补贴
                TextBox txtTFSubsidies = DaGrReadOnly.Columns[10].GetCellContent(e.Row).FindName("tbtxtTRANSPORTATIONSUBSIDIES") as TextBox;
                TextBox txtMealSubsidies = DaGrReadOnly.Columns[11].GetCellContent(e.Row).FindName("tbtxtMEALSUBSIDIES") as TextBox;//餐费补贴
                TextBlock ToolType = DaGrReadOnly.Columns[6].GetCellContent(e.Row).FindName("tbComVechileType") as TextBlock;
                TextBlock ToolLevel = DaGrReadOnly.Columns[7].GetCellContent(e.Row).FindName("tbComVechileTypeLeve") as TextBlock;
                //其他费用
                TextBox txtOthercosts = DaGrReadOnly.Columns[12].GetCellContent(e.Row).FindName("tbtxtOtherCosts") as TextBox;
                CheckBox IsCheck = DaGrReadOnly.Columns[13].GetCellContent(e.Row).FindName("tbmyChkBox") as CheckBox;
                CheckBox IsCheckMeet = DaGrReadOnly.Columns[14].GetCellContent(e.Row).FindName("tbmyChkBoxMeet") as CheckBox;
                CheckBox IsCheckCar = DaGrReadOnly.Columns[15].GetCellContent(e.Row).FindName("tbmyChkBoxCar") as CheckBox;
                //住宿费
                //TextBox txtASubsidies = DaGrEdit.Columns[9].GetCellContent(e.Row).FindName("txtACCOMMODATION") as TextBox;
                
                ////出发时间
                //TextBlock StartDate = ((TextBlock)((StackPanel)DaGrReadOnly.Columns[0].GetCellContent(obje)).Children.FirstOrDefault()) as TextBlock;
                ////到达时间
                //TextBlock EndDate = ((TextBlock)((StackPanel)DaGrReadOnly.Columns[2].GetCellContent(obje)).Children.FirstOrDefault()) as TextBlock;
                //出差天数
                //TextBox datys = ((TextBox)((StackPanel)DaGrReadOnly.Columns[4].GetCellContent(obje)).Children.FirstOrDefault()) as TextBox;
                //住宿天数(隐藏了)
                //TextBox Newdatys = ((TextBox)((StackPanel)DaGrReadOnly.Columns[5].GetCellContent(obje)).Children.FirstOrDefault()) as TextBox;
                //交通工具类型
                //TextBlock ToolType = ((TextBlock)((StackPanel)DaGrReadOnly.Columns[6].GetCellContent(obje)).Children.FirstOrDefault()) as TextBlock;
                ////交通工具级别
                //TextBlock ToolLevel = ((TextBlock)((StackPanel)DaGrReadOnly.Columns[7].GetCellContent(obje)).Children.FirstOrDefault()) as TextBlock;
                ////交通费第8列
                //TextBox txtToolubsidies = ((TextBox)((StackPanel)DaGrReadOnly.Columns[8].GetCellContent(obje)).Children.FirstOrDefault()) as TextBox;
                ////住宿费第9列
                //TextBox txtASubsidies = ((TextBox)((StackPanel)DaGrReadOnly.Columns[9].GetCellContent(obje)).Children.FirstOrDefault()) as TextBox;
                ////交通补贴第10列
                //TextBox txtTFSubsidies = ((TextBox)((StackPanel)DaGrReadOnly.Columns[10].GetCellContent(obje)).Children.FirstOrDefault()) as TextBox;
                ////餐费补贴第11列
                //TextBox txtMealSubsidies = ((TextBox)((StackPanel)DaGrReadOnly.Columns[11].GetCellContent(obje)).Children.FirstOrDefault()) as TextBox;
                ////其他费用第12列
                //TextBox txtOthercosts = ((TextBox)((StackPanel)DaGrReadOnly.Columns[12].GetCellContent(obje)).Children.FirstOrDefault()) as TextBox;
                ////是否私事
                //CheckBox IsCheck = ((CheckBox)((StackPanel)DaGrReadOnly.Columns[13].GetCellContent(obje)).Children.FirstOrDefault()) as CheckBox;
                ////是否会议
                //CheckBox IsCheckMeet = ((CheckBox)((StackPanel)DaGrReadOnly.Columns[14].GetCellContent(obje)).Children.FirstOrDefault()) as CheckBox;
                ////是否公司派车
                //CheckBox IsCheckCar = ((CheckBox)((StackPanel)DaGrReadOnly.Columns[15].GetCellContent(obje)).Children.FirstOrDefault()) as CheckBox;


                //对默认控件的颜色进行赋值
                tempcomTypeForeBrush = ToolType.Foreground;
                tempcomLevelForeBrush = ToolLevel.Foreground;
                txtASubsidiesForeBrush = txtASubsidies.Foreground;
                txtASubsidiesBorderBrush = txtASubsidies.BorderBrush;
                //DaGrReadOnly.Columns[5].Visibility = Visibility.Collapsed;

                if (BtnNewButton == true)
                {
                    myCitys.Text = string.Empty;
                    //citysStartList_Golbal.Add(tmp.DEPCITY);
                }
                else
                {
                    BtnNewButton = false;
                }

                //查询出发城市&目标城市&&将ID转换为Name
                if (DaGrReadOnly.ItemsSource != null)
                {
                    ObservableCollection<T_OA_REIMBURSEMENTDETAIL> objs = DaGrReadOnly.ItemsSource as ObservableCollection<T_OA_REIMBURSEMENTDETAIL>;
                    int i = 0;
                    foreach (var obj in objs)
                    {

                        if (obje.REIMBURSEMENTDETAILID == obj.REIMBURSEMENTDETAILID)//判断记录的ID是否相同
                        {
                            DaGrReadOnly.SelectedItem = e.Row;
                            T_SYS_DICTIONARY type = new T_SYS_DICTIONARY();
                            T_SYS_DICTIONARY level = new T_SYS_DICTIONARY();

                            T_OA_AREAALLOWANCE entareaallowance = StandardsMethod(i);

                            #region 修改、查看、审核

                            if (formType != FormTypes.New)
                            {
                                #region 获取目标城市、各项补贴数据
                                if (myCity != null)//出发城市
                                {
                                    if (obj.DEPCITY != null)
                                    {
                                        myCity.Text = SMT.SaaS.FrameworkUI.Common.Utility.GetCityName(obj.DEPCITY);
                                    }
                                }
                                if (myCitys != null)//目标城市
                                {
                                    if (obj.DESTCITY != null)
                                    {
                                        myCitys.Text = SMT.SaaS.FrameworkUI.Common.Utility.GetCityName(obj.DESTCITY);
                                    }
                                }
                                if (obj.TYPEOFTRAVELTOOLS != null)//交通工具类型
                                {
                                    ToolType.Text = GetTypeName(obj.TYPEOFTRAVELTOOLS);
                                }
                                if (obj.TAKETHETOOLLEVEL != null)//交通工具级别
                                {
                                    ToolLevel.Text = GetLevelName(obj.TAKETHETOOLLEVEL, GetTypeId(obj.TYPEOFTRAVELTOOLS));
                                }
                                if (obj.PRIVATEAFFAIR == "1")//私事
                                {
                                    IsCheck.IsChecked = true;
                                }
                                if (obj.GOOUTTOMEET == "1")//外出开会
                                {
                                    IsCheckMeet.IsChecked = true;
                                }
                                if (obj.COMPANYCAR == "1")//公司派车
                                {
                                    IsCheckCar.IsChecked = true;
                                }
                                //交通费
                                if (txtToolubsidies != null)
                                {
                                    txtToolubsidies.Text = obje.TRANSPORTCOSTS.ToString();
                                }

                                if (txtASubsidies != null)//住宿费
                                {
                                    txtASubsidies.Text = obje.ACCOMMODATION.ToString();
                                }
                                //其他费用
                                if (txtOthercosts != null)
                                {
                                    txtOthercosts.Text = obje.OTHERCOSTS.ToString();
                                }
                                if (txtTFSubsidies != null)//交通补贴
                                {
                                    txtTFSubsidies.Text = obj.TRANSPORTATIONSUBSIDIES.ToString();
                                    //if (EmployeePostLevel.ToInt32() > travelsolutions.NOALLOWANCEPOSTLEVEL.ToInt32())//当前用户的岗位级别小于副部长及以上级别的补贴标准
                                    //{
                                    //    //在正常状态下如果没有获取到补贴(没有对应的城市补贴或其他导致的问题)提示用户是否继续操作
                                    //    if (string.IsNullOrWhiteSpace(txtTFSubsidies.Text))
                                    //    {
                                    //        ComfirmWindow com = new ComfirmWindow();
                                    //        com.OnSelectionBoxClosed += (comobj, result) =>
                                    //        {
                                    //            txtToolubsidies.IsReadOnly = true;//交通费
                                    //            txtASubsidies.IsReadOnly = true;//住宿标准
                                    //            txtOthercosts.IsReadOnly = true;//其他费用
                                    //        };
                                    //        if (formType == FormTypes.Audit || formType == FormTypes.Browse
                                    //             || obj.GOOUTTOMEET == "1" || obj.COMPANYCAR == "1") return;
                                    //        if (obj.REIMBURSEMENTDETAILID == objs.LastOrDefault().REIMBURSEMENTDETAILID)
                                    //        {
                                    //            return;//最后一条无补贴
                                    //        }
                                    //        if (obj.TRANSPORTATIONSUBSIDIES == null || obj.TRANSPORTATIONSUBSIDIES==0)
                                    //        {
                                    //            if (formType == FormTypes.Audit) return;
                                    //            com.SelectionBox("操作确认", "当前单据没有获取到餐费补贴,是否继续操作?", ComfirmWindow.titlename, "");
                                    //        }
                                    //    }
                                    //}
                                }
                                if (txtMealSubsidies != null)//餐费补贴
                                {
                                    txtMealSubsidies.Text = obj.MEALSUBSIDIES.ToString();
                                    //if (EmployeePostLevel.ToInt32() > travelsolutions.NOALLOWANCEPOSTLEVEL.ToInt32())//当前用户的岗位级别小于副部长及以上级别的补贴标准
                                    //{
                                    //    //在正常状态下如果没有获取到补贴(没有对应的城市补贴或其他导致的问题)提示用户是否继续操作
                                    //    if (string.IsNullOrWhiteSpace(txtMealSubsidies.Text))
                                    //    {
                                    //        ComfirmWindow com = new ComfirmWindow();
                                    //        com.OnSelectionBoxClosed += (comobj, result) =>
                                    //        {
                                    //            txtToolubsidies.IsReadOnly = true;//交通费
                                    //            txtASubsidies.IsReadOnly = true;//住宿标准
                                    //            txtOthercosts.IsReadOnly = true;//其他费用
                                    //        };
                                    //        if (formType == FormTypes.Audit || formType == FormTypes.Browse
                                    //           || obj.GOOUTTOMEET == "1") return;
                                    //        if (obj.REIMBURSEMENTDETAILID == objs.LastOrDefault().REIMBURSEMENTDETAILID)
                                    //        {
                                    //            return;//最后一条无补贴
                                    //        }
                                    //        if (obj.MEALSUBSIDIES == null
                                    //            || obj.MEALSUBSIDIES == 0)
                                    //        {
                                    //            if (formType == FormTypes.Audit) return;
                                    //            com.SelectionBox("操作确认", "当前单据没有获取到餐费补贴,是否继续操作?", ComfirmWindow.titlename, "");
                                    //        }
                                    //    }
                                    //}
                                }
                                #endregion

                                #region 查看和审核时隐藏DataGrid模板中的控件
                                if (formType == FormTypes.Browse || formType == FormTypes.Audit)
                                {
                                    txtASubsidies.IsReadOnly = true;
                                    txtTFSubsidies.IsReadOnly = true;
                                    txtMealSubsidies.IsReadOnly = true;
                                    txtOthercosts.IsReadOnly = true;
                                    txtToolubsidies.IsReadOnly = true;
                                }
                                if (formType != FormTypes.New || formType != FormTypes.Edit)
                                {
                                    if (TravelReimbursement_Golbal.CHECKSTATE != ((int)CheckStates.UnSubmit).ToString())
                                    {
                                        txtASubsidies.IsReadOnly = true;
                                        txtTFSubsidies.IsReadOnly = true;
                                        txtMealSubsidies.IsReadOnly = true;
                                        txtOthercosts.IsReadOnly = true;
                                        txtToolubsidies.IsReadOnly = true;
                                    }
                                }
                                if (entareaallowance != null)
                                {
                                    decimal days = System.Convert.ToDecimal(obje.THENUMBEROFNIGHTS);
                                    if (days.ToDouble() == 0.5)
                                    {
                                        days = 1;
                                    }
                                    else
                                    {
                                        days = decimal.Truncate(days);
                                    }
                                    if (txtASubsidies.Text.ToDouble() > entareaallowance.ACCOMMODATION.ToDouble() * days.ToDouble())//判断住宿费超标
                                    {
                                        txtASubsidies.BorderBrush = new SolidColorBrush(Colors.Red);
                                        txtASubsidies.Foreground = new SolidColorBrush(Colors.Red);
                                        txtAccommodation.Visibility = Visibility.Visible;
                                        this.txtAccommodation.Text = "住宿费超标";
                                    }
                                    if (txtASubsidies.Text.ToDouble() <= entareaallowance.ACCOMMODATION.ToDouble() * days.ToDouble())
                                    {
                                        if (txtASubsidiesForeBrush != null && txtASubsidies.Foreground == null)
                                        {
                                            txtASubsidies.Foreground = txtASubsidiesForeBrush;
                                        }
                                        if (txtASubsidiesBorderBrush != null && txtASubsidies.BorderBrush == null)
                                        {
                                            txtASubsidies.BorderBrush = txtASubsidiesBorderBrush;
                                        }
                                    }
                                }
                                #endregion

                                #region 获取交通工具类型、级别
                                if (ToolType != null)
                                {
                                    var thd = takethestandardtransport.FirstOrDefault();
                                    thd = this.GetVehicleTypeValue("");

                                    if (thd != null)
                                    {
                                        if (takethestandardtransport.Count() > 0)
                                        {
                                            if (thd.TYPEOFTRAVELTOOLS.ToInt32() > obj.TYPEOFTRAVELTOOLS.ToInt32())
                                            {
                                                ToolType.Foreground = new SolidColorBrush(Colors.Red);
                                                ToolLevel.Foreground = new SolidColorBrush(Colors.Red);
                                                this.txtTips.Visibility = Visibility.Visible;
                                                this.txtTips.Text = "交通工具超标";
                                            }
                                            if (thd.TYPEOFTRAVELTOOLS.ToInt32() <= obj.TYPEOFTRAVELTOOLS.ToInt32())
                                            {
                                                if (tempcomTypeForeBrush != null)
                                                {
                                                    ToolType.Foreground = tempcomTypeForeBrush;
                                                }
                                            }
                                        }
                                    }
                                }
                                if (ToolLevel != null)//交通工具级别
                                {
                                    //获取交通工具类型
                                    int ii = CheckTraveToolStand(obj.TYPEOFTRAVELTOOLS.ToString(), obj.TAKETHETOOLLEVEL.ToString(), EmployeePostLevel);
                                    switch (ii)
                                    {
                                        case 0://类型超标
                                            ToolType.Foreground = new SolidColorBrush(Colors.Red);
                                            ToolLevel.Foreground = new SolidColorBrush(Colors.Red);
                                            this.txtTips.Visibility = Visibility.Visible;
                                            this.txtTips.Text = "交通工具超标";
                                            break;
                                        case 1://级别超标
                                            ToolLevel.Foreground = new SolidColorBrush(Colors.Red);
                                            this.txtTips.Visibility = Visibility.Visible;
                                            this.txtTips.Text = "交通工具超标";
                                            break;
                                        case 2://没超标,则隐藏
                                            this.txtTips.Visibility = Visibility.Collapsed;
                                            this.txtTips.Text = "";
                                            break;
                                    }
                                }
                                #endregion
                            }
                            #endregion
                        }
                        i++;
                    }

                #endregion
                }
            }
            catch (Exception ex)
            {
                Logger.Current.Log(ex.Message, Category.Debug, Priority.Low);
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            }
        }
Example #34
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            //lsSet = new ObservableCollection<T_OA_APPROVALTYPESET>();
            SaveBtn.IsEnabled = true;
            string sType="",sValue="";
            TreeViewItem selectedItem = treeOrganization.SelectedItem as TreeViewItem;
            if (selectedItem != null)
            {
                string IsTag = selectedItem.Tag.ToString();
                switch (IsTag)
                {
                    case "Company":
                        SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY company = selectedItem.DataContext as SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY;
                        sType = "Company";
                        sValue = company.COMPANYID;
                        
                        break;
                    case "Department":
                        SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT department = selectedItem.DataContext as SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT;
                        sType = "Department";
                        sValue = department.DEPARTMENTID;
                        
                        break;

                }
                string StrType = "";
                StrType = sType == "Company" ? "0" : "1";
                if (treeApproval.SelectedItem != null)
                {
                    T_SYS_DICTIONARY selectdic = new T_SYS_DICTIONARY();
                    TreeViewItem selectedItemapp = treeApproval.SelectedItem as TreeViewItem;
                    selectdic = selectedItemapp.Tag as T_SYS_DICTIONARY;
                    if(selectdic == null)
                        ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), "该字典信息为空",
                        Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                    if (SelectedList.Items.Count() > 0)
                    {
                        if (!(SelectedList.Items.Contains(selectdic)))
                        {
                            SelectedList.Items.Add(selectdic);
                            var ents = from ent in lsSet
                                       where ent.ORGANIZATIONID == sValue && ent.ORGANIZATIONTYPE == StrType && ent.TYPEAPPROVAL == selectdic.DICTIONARYVALUE.ToString()
                                       select ent;
                            if (ents.Count() == 0)
                            {
                                T_OA_APPROVALTYPESET set = new T_OA_APPROVALTYPESET();
                                set.TYPESETID = System.Guid.NewGuid().ToString();
                                set.TYPEAPPROVAL = selectdic.DICTIONARYVALUE.ToString();
                                set.ORGANIZATIONID = sValue;
                                set.ORGANIZATIONTYPE = StrType;
                                set.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                                set.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                                set.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;

                                set.CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;
                                set.CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;
                                set.CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                                set.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                                set.CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                                set.CREATEDATE = System.DateTime.Now;
                                lsSet.Add(set);
                            }
                            
                        }
                    }
                    else
                    {
                        SelectedList.Items.Add(selectdic);
                        var ents2= from ent in lsSet
                                   where ent.ORGANIZATIONID == sValue && ent.ORGANIZATIONTYPE == StrType && ent.TYPEAPPROVAL == selectdic.DICTIONARYVALUE.ToString()
                                   select ent;
                        if (ents2.Count() == 0)
                        {
                            T_OA_APPROVALTYPESET set = new T_OA_APPROVALTYPESET();
                            set.TYPESETID = System.Guid.NewGuid().ToString();
                            set.TYPEAPPROVAL = selectdic.DICTIONARYVALUE.ToString();
                            set.ORGANIZATIONID = sValue;
                            set.ORGANIZATIONTYPE = StrType;
                            set.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                            set.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                            set.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;

                            set.CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;
                            set.CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;
                            set.CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                            set.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                            set.CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                            set.CREATEDATE = System.DateTime.Now;
                            lsSet.Add(set);
                        }
                    }

                    if (StrType == "0")
                    {
                        if (lsCompanys.Count() > 0)
                        {
                            if (lsCompanys.IndexOf(sValue) > 0)
                            {
                                lsCompanys.Add(sValue);
                            }
                        }
                        else
                        {
                            lsCompanys.Add(sValue);
                        }
                    }
                    else
                    {
                        if (lsDepartment.Count() > 0)
                        {
                            if (lsDepartment.IndexOf(sValue) > 0)
                            {
                                lsDepartment.Add(sValue);
                            }
                        }
                        else
                        {
                            lsDepartment.Add(sValue);
                        }
                    }

                    //树形事项则去掉该数据
                }
                else
                {
                    //ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), "请选择小的事项审批信息",
                    //    Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                    Utility.ShowCustomMessage(MessageTypes.Message, "警告", "请选择小的事项审批信息");
                }
                
                
            }
            else
            {
                //ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), "请选择组织架构",
                //        Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                Utility.ShowCustomMessage(MessageTypes.Message, "警告", "请选择组织架构");
            }
            
            
            
            SelectedList.DisplayMemberPath = "DICTIONARYNAME";

        }
Example #35
0
        void client_GetSysDictionaryCategoryCompleted(object sender, GetSysDictionaryCategoryCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                SysDictionaryCategoryList = e.Result.ToList();
                T_SYS_DICTIONARY temp = new T_SYS_DICTIONARY();
                temp.DICTIONCATEGORY = "ALL";
                temp.DICTIONCATEGORYNAME = Utility.GetResourceStr("ALL");
                SysDictionaryCategoryList.Insert(0, temp);

                ComboBox cbDictionay = Utility.FindChildControl<ComboBox>(expander, "cbDictionay");
                cbDictionay.ItemsSource = SysDictionaryCategoryList;
                cbDictionay.SelectedIndex = 0;
            }
        }
Example #36
0
        //答案组
        private void cbDepCity_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            T_SYS_DICTIONARY sys = ((ComboBox)sender).SelectedItem as T_SYS_DICTIONARY;

            permissionClient.GetSysDictionaryByFatherIDAsync(sys.DICTIONARYID);
        }
Example #37
0
 public void AddToT_SYS_DICTIONARY(T_SYS_DICTIONARY t_SYS_DICTIONARY)
 {
     base.AddObject("T_SYS_DICTIONARY", t_SYS_DICTIONARY);
 }
        private void ComVechileTypeLeve_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                TravelDictionaryComboBox vechiletype = sender as TravelDictionaryComboBox;
                if (vechiletype.SelectedIndex >= 0)
                {
                    if (employeepost != null)
                    {
                        var thd = takethestandardtransport.FirstOrDefault();

                        T_SYS_DICTIONARY VechileTypeObj = vechiletype.SelectedItem as T_SYS_DICTIONARY;
                        if (DaGrEdit.SelectedItem != null)
                        {
                            if (DaGrEdit.Columns[7].GetCellContent(DaGrEdit.SelectedItem) != null)
                            {
                                TravelDictionaryComboBox ComLevel = DaGrEdit.Columns[7].GetCellContent(DaGrEdit.SelectedItem).FindName("ComVechileTypeLeve") as TravelDictionaryComboBox;
                                TravelDictionaryComboBox ComType  = DaGrEdit.Columns[6].GetCellContent(DaGrEdit.SelectedItem).FindName("ComVechileType") as TravelDictionaryComboBox;
                                T_SYS_DICTIONARY         type     = new T_SYS_DICTIONARY();
                                T_SYS_DICTIONARY         level    = new T_SYS_DICTIONARY();
                                level = ComLevel.SelectedItem as T_SYS_DICTIONARY;
                                type  = ComType.SelectedItem as T_SYS_DICTIONARY;
                                if (type != null)
                                {
                                    thd = this.GetVehicleTypeValue(type.DICTIONARYVALUE.ToString());
                                    if (thd == null)
                                    {
                                        ComType.BorderBrush = new SolidColorBrush(Colors.Red);
                                        ComType.Foreground  = new SolidColorBrush(Colors.Red);
                                        return;
                                    }
                                    if (level != null)
                                    {
                                        if (thd.TAKETHETOOLLEVEL.ToInt32() < level.DICTIONARYVALUE)
                                        {
                                            if (tempcomLevelForeBrush != null)
                                            {
                                                ComLevel.Foreground = tempcomLevelForeBrush;
                                            }
                                            if (tempcomLevelBorderBrush != null)
                                            {
                                                ComLevel.BorderBrush = tempcomLevelBorderBrush;
                                            }
                                            if (tempcomTypeBorderBrush != null)
                                            {
                                                ComType.BorderBrush = tempcomTypeBorderBrush;
                                            }
                                            if (tempcomTypeForeBrush != null)
                                            {
                                                ComType.Foreground = tempcomTypeForeBrush;
                                            }
                                        }
                                        else
                                        {
                                            if (thd.TYPEOFTRAVELTOOLS.ToInt32() > type.DICTIONARYVALUE)
                                            {
                                                ComType.BorderBrush     = new SolidColorBrush(Colors.Red);
                                                ComType.Foreground      = new SolidColorBrush(Colors.Red);
                                                this.txtTips.Visibility = Visibility.Visible;
                                                this.txtTips.Text       = "交通工具超标";
                                                return;
                                            }
                                            else if (thd.TAKETHETOOLLEVEL.ToInt32() > level.DICTIONARYVALUE)
                                            {
                                                ComLevel.BorderBrush    = new SolidColorBrush(Colors.Red);
                                                ComLevel.Foreground     = new SolidColorBrush(Colors.Red);
                                                this.txtTips.Visibility = Visibility.Visible;
                                                this.txtTips.Text       = "交通工具超标";
                                                return;
                                            }
                                            else
                                            {
                                                if (tempcomLevelForeBrush != null)
                                                {
                                                    ComLevel.Foreground = tempcomLevelForeBrush;
                                                }
                                                if (tempcomLevelBorderBrush != null)
                                                {
                                                    ComLevel.BorderBrush = tempcomLevelBorderBrush;
                                                }
                                                this.txtTips.Visibility = Visibility.Collapsed;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Current.Log(ex.Message, Category.Debug, Priority.Low);
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            }
        }
Example #39
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();
        }
Example #40
0
        private void DelBtn_Click(object sender, RoutedEventArgs e)
        {

            //if (SelectedList.SelectedItems.Count > 0)
            //{
            SaveBtn.IsEnabled = true;
            T_SYS_DICTIONARY selectdict = new T_SYS_DICTIONARY();
            selectdict = SelectedList.SelectedItem as T_SYS_DICTIONARY;
            if (selectdict == null)
            {
                Utility.ShowCustomMessage(MessageTypes.Message, "警告", "请选择要移除的事项");
                return;
            }

            SelectedList.Items.Remove(selectdict);
            //当所有的记录被清空时  所选组织架构也清掉
            //if (SelectedList.Items.Count > 0)
            //{
            string sType = "", sValue = "";
            TreeViewItem selectedItem = treeOrganization.SelectedItem as TreeViewItem;
            if (selectedItem != null)
            {
                string IsTag = selectedItem.Tag.ToString();
                switch (IsTag)
                {
                    case "Company":
                        SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY company =
                            selectedItem.DataContext as SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY;
                        sType = "Company";
                        sValue = company.COMPANYID;

                        break;
                    case "Department":
                        SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT department =
                            selectedItem.DataContext as SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT;
                        sType = "Department";
                        sValue = department.DEPARTMENTID;

                        break;

                }
                string StrType = "";
                StrType = sType == "Company" ? "0" : "1";

                var allents = from ent in lsSet
                              where
                                  ent.ORGANIZATIONID == sValue && ent.ORGANIZATIONTYPE == StrType &&
                                  ent.TYPEAPPROVAL == selectdict.DICTIONARYVALUE.ToString()
                              select ent;
                //删除已经存在的记录
                if (allents.Count() > 0)
                {
                    allents.ToList().ForEach(
                        item =>
                            {
                                lsSet.Remove(item);
                            });
                }

                if (StrType == "0")
                {
                    if (lsCompanys.Count() > 0)
                    {
                        if (lsCompanys.IndexOf(sValue) > 0)
                        {
                            lsCompanys.Add(sValue);
                        }
                    }
                    else
                    {
                        lsCompanys.Add(sValue);
                    }
                }
                else
                {
                    if (lsDepartment.Count() > 0)
                    {
                        if (lsDepartment.IndexOf(sValue) > 0)
                        {
                            lsDepartment.Add(sValue);
                        }
                    }
                    else
                    {
                        lsDepartment.Add(sValue);
                    }
                }
            }
            //}

            //}
            //else
            //{
            //Utility.ShowCustomMessage(MessageTypes.Caution, "CAUTION", "请选择公司");
            //ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), "请选择类型",
            //    Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);

            //if (StrType == "0")
            //{
            //    if (lsCompanys.Count() > 0)
            //    {
            //        if (lsCompanys.IndexOf(sValue) > 0)
            //        {
            //            lsCompanys.Add(sValue);
            //        }
            //    }
            //    else
            //    {
            //        lsCompanys.Add(sValue);
            //    }
            //}
            //else
            //{
            //    if (lsDepartment.Count() > 0)
            //    {
            //        if (lsDepartment.IndexOf(sValue) > 0)
            //        {
            //            lsDepartment.Add(sValue);
            //        }
            //    }
            //    else
            //    {
            //        lsDepartment.Add(sValue);
            //    }
            //}
            //}

            SelectedList.DisplayMemberPath = "DICTIONARYNAME";
        }
Example #41
0
        void _VM_GetApprovalTypeByCompanyandDepartmentidCompleted(object sender, GetApprovalTypeByCompanyandDepartmentidCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                lstApprovalids.Clear();
                lstApprovalids = e.Result;
                //lstApprovalids = e.Result;
                if (operationType == FormTypes.New)
                {
                    List<T_SYS_DICTIONARY> Dicts = Application.Current.Resources["SYS_DICTIONARY"] as List<T_SYS_DICTIONARY>;

                    if (Dicts == null)
                        return;

                    T_SYS_DICTIONARY DictApproval = new T_SYS_DICTIONARY();

                    var ents = from p in Dicts
                               where p.DICTIONCATEGORY == "TYPEAPPROVAL" && p.T_SYS_DICTIONARY2 != null && lstApprovalids.Contains(p.DICTIONARYVALUE.ToString())
                               orderby p.ORDERNUMBER
                               select p;
                    //txtSelectPost
                    if (ents.Count() > 0)
                    {
                        //DictApproval = ents.ToList().FirstOrDefault();
                        //StrApprovalTypeName = DictApproval.DICTIONARYNAME;
                    }
                    else
                    {
                        //var entsfather = from p in Dicts
                        //           where p.DICTIONCATEGORY == "TYPEAPPROVAL" &&  lstApprovalids.Contains(p.DICTIONARYVALUE.ToString())
                        //           orderby p.ORDERNUMBER
                        //           select p;
                        //if (entsfather.Count() > 0)
                        //{
                        //    DictApproval = entsfather.ToList().FirstOrDefault();
                        //    if (DictApproval != null)
                        //    {
                        //        StrApprovalTypeName = DictApproval.DICTIONARYNAME;
                        //    }
                        //}
                    }
                    StrApprovaltype = "";
                    txtSelectPost.TxtSelectedApprovalType.Text = "";
                    if (DictApproval != null)
                    {
                        if (!string.IsNullOrEmpty(DictApproval.DICTIONARYID))//存在则赋值
                        {
                            txtSelectPost.TxtSelectedApprovalType.Text = DictApproval.DICTIONARYNAME;
                            StrApprovaltype = DictApproval.DICTIONARYVALUE.ToString();
                            GetFatherApprovalType(StrApprovaltype, "first");
                        }
                    }
                }
            }
        }
Example #42
0
        private void ComVechileTypeLeve_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            TravelDictionaryComboBox vechiletype = sender as TravelDictionaryComboBox;
            if (vechiletype.SelectedIndex >= 0)
            {
                //if (employeepost != null)
                //{
                if (!string.IsNullOrEmpty(Master_Golbal.POSTLEVEL))
                {
                    if (DaGrs.SelectedItem != null)
                    {
                        var thd = transportToolStand.FirstOrDefault();

                        T_SYS_DICTIONARY VechileTypeObj = vechiletype.SelectedItem as T_SYS_DICTIONARY;

                        if (DaGrs.Columns[4].GetCellContent(DaGrs.SelectedItem) != null)
                        {
                            TravelDictionaryComboBox ComLevel = DaGrs.Columns[5].GetCellContent(DaGrs.SelectedItem).FindName("ComVechileTypeLeve") as TravelDictionaryComboBox;
                            TravelDictionaryComboBox ComType = DaGrs.Columns[4].GetCellContent(DaGrs.SelectedItem).FindName("ComVechileType") as TravelDictionaryComboBox;

                            T_SYS_DICTIONARY type = new T_SYS_DICTIONARY();
                            T_SYS_DICTIONARY level = new T_SYS_DICTIONARY();
                            level = ComLevel.SelectedItem as T_SYS_DICTIONARY;
                            type = ComType.SelectedItem as T_SYS_DICTIONARY;
                            if (type != null)
                            {
                                thd = this.GetVehicleTypeValue(type.DICTIONARYVALUE.ToString());
                                if (transportToolStand.Count() > 0)
                                {
                                    if (thd == null)
                                    {
                                        ComType.BorderBrush = new SolidColorBrush(Colors.Red);
                                        ComType.Foreground = new SolidColorBrush(Colors.Red);
                                        return;
                                    }
                                    if (level != null)
                                    {
                                        if (thd.TAKETHETOOLLEVEL.ToInt32() < level.DICTIONARYVALUE)
                                        {
                                            if (tempcomLevelForeBrush != null)
                                            {
                                                ComLevel.Foreground = tempcomLevelForeBrush;
                                            }
                                            if (tempcomLevelBorderBrush != null)
                                            {
                                                ComLevel.BorderBrush = tempcomLevelBorderBrush;
                                            }
                                            if (tempcomTypeBorderBrush != null)
                                            {
                                                ComType.BorderBrush = tempcomTypeBorderBrush;
                                            }
                                            if (tempcomTypeForeBrush != null)
                                            {
                                                ComType.Foreground = tempcomTypeForeBrush;
                                            }
                                        }
                                        else
                                        {
                                            if (type != null)
                                            {
                                                if (thd.TYPEOFTRAVELTOOLS.ToInt32() > type.DICTIONARYVALUE)
                                                {
                                                    ComType.BorderBrush = new SolidColorBrush(Colors.Red);
                                                    ComType.Foreground = new SolidColorBrush(Colors.Red);
                                                    return;
                                                }
                                                if (thd.TAKETHETOOLLEVEL.ToInt32() > level.DICTIONARYVALUE)
                                                {
                                                    ComLevel.BorderBrush = new SolidColorBrush(Colors.Red);
                                                    ComLevel.Foreground = new SolidColorBrush(Colors.Red);
                                                    return;
                                                }
                                                else
                                                {
                                                    if (tempcomLevelForeBrush != null)
                                                    {
                                                        ComLevel.Foreground = tempcomLevelForeBrush;
                                                    }
                                                    if (tempcomLevelBorderBrush != null)
                                                    {
                                                        ComLevel.BorderBrush = tempcomLevelBorderBrush;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Example #43
0
 private void ServiceClient_GetSysDictionaryByCategoryCompleted(object sender, GetSysDictionaryByCategoryCompletedEventArgs e)
 {
     //绑定系统类型
     if (e.Result != null)
     {
         List<T_SYS_DICTIONARY> dicts = e.Result.ToList();
         ComboBox cbxSystemType = Utility.FindChildControl<ComboBox>(expander, "cbxSystemType");
         T_SYS_DICTIONARY NewDict = new T_SYS_DICTIONARY();
         NewDict.DICTIONARYNAME = "--请选择--";
         NewDict.DICTIONARYVALUE = null;
         dicts.Insert(0,NewDict);
         if (cbxSystemType != null)
         {
             cbxSystemType.ItemsSource = dicts;
             cbxSystemType.DisplayMemberPath = "DICTIONARYNAME";
             cbxSystemType.SelectedIndex = 0;
         }
     }
 }
Example #44
0
        /// <summary>
        /// 效验提交的内容
        /// </summary>
        /// <param name="flag"></param>
        private void CheckBasicForm(out bool flag)
        {
            flag = false;

            if (string.IsNullOrEmpty(lkBalancePost.TxtLookUp.Text))
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ATTENDANCESOLUTIONNAME"), "自动离职接收岗位不能为空");
                flag = false;
                return;
            }
            else
            {
                flag = true;
            }

            if (string.IsNullOrEmpty(txtAttSolName.Text))
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ATTENDANCESOLUTIONNAME"), string.Format(Utility.GetResourceStr("REQUIRED"), Utility.GetResourceStr("ATTENDANCESOLUTIONNAME")));
                flag = false;
                return;
            }
            else
            {
                flag = true;
            }

            if (cbxkAttendanceType.SelectedItem == null)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ATTENDANCETYPE"), string.Format(Utility.GetResourceStr("REQUIRED"), Utility.GetResourceStr("ATTENDANCETYPE")));
                flag = false;
                return;
            }
            else
            {
                T_SYS_DICTIONARY entDic = cbxkAttendanceType.SelectedItem as T_SYS_DICTIONARY;
                if (!string.IsNullOrEmpty(entDic.DICTIONARYID) && !string.IsNullOrEmpty(entDic.DICTIONCATEGORY))
                {
                    flag = true;
                    entAttendanceSolution.ATTENDANCETYPE = entDic.DICTIONARYVALUE.ToString();
                }
            }

            if (cbxkCardType.Visibility == System.Windows.Visibility.Visible)
            {
                if (cbxkCardType.SelectedItem == null)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("CARDTYPE"), Utility.GetResourceStr("REQUIRED", "CARDTYPE"));
                    flag = false;
                    return;
                }
                else
                {
                    T_SYS_DICTIONARY entDic = cbxkCardType.SelectedItem as T_SYS_DICTIONARY;
                    if (!string.IsNullOrEmpty(entDic.DICTIONARYID) && !string.IsNullOrEmpty(entDic.DICTIONCATEGORY))
                    {
                        flag = true;
                        entAttendanceSolution.CARDTYPE = entDic.DICTIONARYVALUE.ToString();
                    }
                }
            }

            if (cbxkWorkDayType.SelectedItem == null)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("WORKDAYTYPE"), string.Format(Utility.GetResourceStr("REQUIRED"), Utility.GetResourceStr("WORKDAYTYPE")));
                flag = false;
                return;
            }
            else
            {
                T_SYS_DICTIONARY entDic = cbxkWorkDayType.SelectedItem as T_SYS_DICTIONARY;
                if (!string.IsNullOrEmpty(entDic.DICTIONARYID) && !string.IsNullOrEmpty(entDic.DICTIONCATEGORY))
                {
                    flag = true;
                    entAttendanceSolution.WORKDAYTYPE = entDic.DICTIONARYVALUE.ToString();
                }
            }

            entAttendanceSolution.ISCURRENTMONTH = (Convert.ToInt32(IsChecked.No) + 1).ToString();
            if (cbIsCurrentMonth.IsChecked.Value == true)
            {
                entAttendanceSolution.ISCURRENTMONTH = (Convert.ToInt32(IsChecked.Yes) + 1).ToString();
            }

            //是否自动导入打卡记录
            if (RadY.IsChecked == true)
            {
                entAttendanceSolution.ISAUTOIMPORTPUNCH = "1";
            }
            else
            {
                entAttendanceSolution.ISAUTOIMPORTPUNCH = "0";
            }

            entAttendanceSolution.REMARK = txtAttSolRemark.Text;
            if (string.IsNullOrWhiteSpace(entAttendanceSolution.REMARK))
            {
                entAttendanceSolution.REMARK = string.Empty;
            }

            if (string.IsNullOrWhiteSpace(entAttendanceSolution.YEARLYBALANCEDATE))
            {
                entAttendanceSolution.YEARLYBALANCEDATE = "1";
            }

            if (string.IsNullOrWhiteSpace(entAttendanceSolution.REMARK))
            {
                entAttendanceSolution.YEARLYBALANCETYPE = "0";
            }
        }
Example #45
0
        /// <summary>
        ///  读取打卡的Excel文件,并导入数据库,返回导入后的结果
        /// </summary>
        private void ImportClockInRd()
        {
            string strMsg = string.Empty;

            try
            {
                string   strUnitType = string.Empty, strUnitObjectId = string.Empty;
                DateTime dtStart = new DateTime();
                DateTime dtEnd   = new DateTime();
                bool     flag    = false;

                flag = DateTime.TryParse(dpStartDate.Text, out dtStart);
                if (!flag)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("IMPORTCLOCKINRDSTARTDATE"), Utility.GetResourceStr("REQUIRED", "IMPORTCLOCKINRDSTARTDATE"));
                    return;
                }

                flag = DateTime.TryParse(dpEndDate.Text, out dtEnd);
                if (!flag)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("IMPORTCLOCKINRDENDDATE"), Utility.GetResourceStr("REQUIRED", "IMPORTCLOCKINRDENDDATE"));
                    return;
                }

                if (dtStart > dtEnd)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("IMPORTCLOCKINRDENDDATE"), Utility.GetResourceStr("DATECOMPARE", "IMPORTCLOCKINRDENDDATE,IMPORTCLOCKINRDSTARTDATE"));
                    return;
                }

                if (cbxkClockInRdUnitType.SelectedItem == null)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("CLOCKINRDUNITTYPE"), Utility.GetResourceStr("REQUIRED", "CLOCKINRDUNITTYPE"));
                    return;
                }

                if (lkClockInRdUnit.DataContext == null)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("CLOCKINRDUNIT"), Utility.GetResourceStr("REQUIRED", "CLOCKINRDUNIT"));
                    return;
                }

                if (cbxkUploadFileType.SelectedItem == null)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("CLOCKINRDUPLOADTYPE"), Utility.GetResourceStr("REQUIRED", "CLOCKINRDUPLOADTYPE"));
                    return;
                }

                T_SYS_DICTIONARY entUnitType = cbxkClockInRdUnitType.SelectedItem as T_SYS_DICTIONARY;
                if (string.IsNullOrEmpty(entUnitType.DICTIONARYID) || string.IsNullOrEmpty(entUnitType.DICTIONCATEGORY) || string.IsNullOrEmpty(entUnitType.DICTIONARYVALUE.ToString()))
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("CLOCKINRDUNITTYPE"), Utility.GetResourceStr("REQUIRED", "CLOCKINRDUNITTYPE"));
                    return;
                }

                T_SYS_DICTIONARY entUploadType = cbxkUploadFileType.SelectedItem as T_SYS_DICTIONARY;
                if (string.IsNullOrEmpty(entUploadType.DICTIONARYID) || string.IsNullOrEmpty(entUploadType.DICTIONCATEGORY) || string.IsNullOrEmpty(entUploadType.DICTIONARYVALUE.ToString()))
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("CLOCKINRDUPLOADTYPE"), Utility.GetResourceStr("REQUIRED", "CLOCKINRDUPLOADTYPE"));
                    return;
                }

                strUnitType = entUnitType.DICTIONARYVALUE.ToString();
                if (strUnitType == (Convert.ToInt32(AssignedObjectType.Company) + 1).ToString())
                {
                    T_HR_COMPANY entCompany = lkClockInRdUnit.DataContext as T_HR_COMPANY;
                    strUnitObjectId = entCompany.COMPANYID;
                }
                else if (strUnitType == (Convert.ToInt32(AssignedObjectType.Department) + 1).ToString())
                {
                    T_HR_DEPARTMENT entDepartment = lkClockInRdUnit.DataContext as T_HR_DEPARTMENT;
                    strUnitObjectId = entDepartment.DEPARTMENTID;
                }
                else if (strUnitType == (Convert.ToInt32(AssignedObjectType.Post) + 1).ToString())
                {
                    T_HR_POST entPost = lkClockInRdUnit.DataContext as T_HR_POST;
                    strUnitObjectId = entPost.POSTID;
                }

                if (entUploadType.DICTIONARYVALUE.ToString() == (Convert.ToInt32(ClockInRdUploadFileType.File) + 1).ToString())
                {
                    if (OpenFileDialog == null)
                    {
                        Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIREDIMPORTFILE"));
                        return;
                    }

                    if (OpenFileDialog.File == null)
                    {
                        Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIREDIMPORTFILE"));
                        return;
                    }

                    RefreshUI(RefreshedTypes.ShowProgressBar);

                    Stream Stream = (System.IO.Stream)OpenFileDialog.File.OpenRead();

                    byte[] Buffer = new byte[Stream.Length];
                    Stream.Read(Buffer, 0, (int)Stream.Length);

                    Stream.Dispose();
                    Stream.Close();

                    SMT.Saas.Tools.AttendanceWS.UploadFileModel UploadFile = new SMT.Saas.Tools.AttendanceWS.UploadFileModel();
                    UploadFile.FileName = OpenFileDialog.File.Name;
                    UploadFile.File     = Buffer;

                    string strFileType = "csv";
                    clientAtt.ImportClockInRdListFromFileAsync(UploadFile, strFileType, strUnitType, strUnitObjectId, dtStart, dtEnd, strMsg);
                }
                else if (entUploadType.DICTIONARYVALUE.ToString() == (Convert.ToInt32(ClockInRdUploadFileType.Login) + 1).ToString())
                {
                    RefreshUI(RefreshedTypes.ShowProgressBar);
                    clientAtt.ImportClockInRdListFromLoginDataAsync(strUnitType, strUnitObjectId, dtStart, dtEnd, strMsg);
                }
                else if (entUploadType.DICTIONARYVALUE.ToString() == (Convert.ToInt32(ClockInRdUploadFileType.FileAndLogin) + 1).ToString())
                {
                    if (OpenFileDialog == null)
                    {
                        Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIREDIMPORTFILE"));
                        return;
                    }

                    if (OpenFileDialog.File == null)
                    {
                        Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIREDIMPORTFILE"));
                        return;
                    }

                    RefreshUI(RefreshedTypes.ShowProgressBar);

                    Stream Stream = (System.IO.Stream)OpenFileDialog.File.OpenRead();

                    byte[] Buffer = new byte[Stream.Length];
                    Stream.Read(Buffer, 0, (int)Stream.Length);

                    Stream.Dispose();
                    Stream.Close();

                    SMT.Saas.Tools.AttendanceWS.UploadFileModel UploadFile = new SMT.Saas.Tools.AttendanceWS.UploadFileModel();
                    UploadFile.FileName = OpenFileDialog.File.Name;
                    UploadFile.File     = Buffer;

                    string strFileType = "csv";
                    clientAtt.ImportClockInRdListFromFileAndLoginDataAsync(UploadFile, strFileType, strUnitType, strUnitObjectId, dtStart, dtEnd, strMsg);
                }

                strMsg = string.Empty;
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message.ToString()));
            }
        }
Example #46
0
        /// <summary>
        /// 获取选取的字典信息
        /// </summary>
        /// <param name="DictionaryValue"></param>
        /// <returns></returns>
        private T_SYS_DICTIONARY GetDictionaryInfo(string DictionaryValue)
        {
            string StrReturn = "";
            T_SYS_DICTIONARY tmpDict = new T_SYS_DICTIONARY();

            foreach (T_SYS_DICTIONARY dictT in tmpDicts)
            {
                //if(aa.(cbxSystemType.Items))
                if (dictT.DICTIONARYVALUE.ToString() == DictionaryValue)
                {
                    StrReturn = dictT.DICTIONARYNAME;
                    //DictionaryValue.IndexOf(tmpDicts);
                    tmpDict = dictT;
                    break;
                }
            }
            return tmpDict;
        }
Example #47
0
        private void cbxDepType_Loaded(object sender, RoutedEventArgs e)
        {
            ComboBox cbxDepartmentType = sender as ComboBox;
            List<SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY> dicts = Application.Current.Resources["SYS_DICTIONARY"] as List<SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY>;
            dicts = dicts.Where(s => s.DICTIONCATEGORY == "COMPANYTYPE").OrderBy(s => s.DICTIONARYVALUE).ToList();

            T_SYS_DICTIONARY nuldict = new T_SYS_DICTIONARY();
            string dictname = Utility.GetResourceStr("PLEASESELECT", "DEPARTMENTTYPE");
            nuldict.DICTIONARYNAME = dictname;
            nuldict.DICTIONARYVALUE = -3;
            dicts.Insert(0, nuldict);

            cbxDepartmentType.ItemsSource = dicts.ToList();
            cbxDepartmentType.DisplayMemberPath = "DICTIONARYNAME";
        }
Example #48
0
        void LoadSendDocInfos()
        {
            int    pageCount = 0;
            string filter    = "";                                                                                    //查询过滤条件
            string StrTitle  = "";                                                                                    //标题

            string StrStart     = "";                                                                                 //添加文档的起始时间
            string StrEnd       = "";                                                                                 //添加文档的结束时间
            string StrIsSave    = "";                                                                                 //是否归档
            string StrDistrbute = "";                                                                                 //是否发布
            string StrGrade     = "";                                                                                 //级别
            string StrProritity = "";                                                                                 //缓急
            string StrDocType   = "";                                                                                 //文档类型
            bool   IsNull       = false;                                                                              //用来控制是否有查询条件

            ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); //参数值

            //if (checkState != ((int)CheckStates.Approving).ToString())
            //{
            //    if (!string.IsNullOrEmpty(filter))
            //    {
            //        filter += " and ";
            //    }
            //    filter += "OACompanySendDoc.OWNERID==@" + paras.Count().ToString();
            //    paras.Add(Common.CurrentLoginUserInfo.EmployeeID);
            //}
            if (IsQueryBtn)
            {
                StrTitle = this.txtSendDocTitle.Text.Trim().ToString();
                T_SYS_DICTIONARY GradeObj     = cbxGrade.SelectedItem as T_SYS_DICTIONARY;     //级别
                T_SYS_DICTIONARY ProritityObj = cbxProritity.SelectedItem as T_SYS_DICTIONARY; //缓急
                T_OA_SENDDOCTYPE DocType      = new T_OA_SENDDOCTYPE();
                StrStart = this.dpStart.Text.Trim().ToString();
                StrEnd   = this.dpEnd.Text.Trim().ToString();

                if (this.cbxdoctype.SelectedIndex > 0)
                {
                    StrDocType = this.cbxdoctype.SelectedItem.ToString();
                    DocType    = this.cbxdoctype.SelectedItem as T_OA_SENDDOCTYPE;
                }

                if (this.cbxGrade.SelectedIndex > 0)
                {
                    StrGrade = GradeObj.DICTIONARYNAME.ToString();
                }
                if (this.cbxProritity.SelectedIndex > 0)
                {
                    StrProritity = ProritityObj.DICTIONARYNAME.ToString();
                }
                if (!string.IsNullOrEmpty(StrTitle))
                {
                    IsNull = true;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "OACompanySendDoc.SENDDOCTITLE ^@" + paras.Count().ToString();//标题名称
                    paras.Add(StrTitle);
                }

                if (!string.IsNullOrEmpty(StrProritity))
                {
                    IsNull = true;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "OACompanySendDoc.PRIORITIES ==@" + paras.Count().ToString();//缓急名称
                    paras.Add(StrProritity);
                }
                if (!string.IsNullOrEmpty(StrDocType))
                {
                    IsNull = true;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "doctype.SENDDOCTYPEID ==@" + paras.Count().ToString();//类型名称
                    paras.Add(DocType.SENDDOCTYPEID);
                }

                if (!string.IsNullOrEmpty(StrGrade))
                {
                    IsNull = true;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "OACompanySendDoc.GRADED ==@" + paras.Count().ToString();//级别名称
                    paras.Add(StrGrade);
                }
                DateTime DtStart = new DateTime();
                DateTime DtEnd   = new DateTime();
                if (!string.IsNullOrEmpty(StrStart) && string.IsNullOrEmpty(StrEnd))
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("dtSearch"), Utility.GetResourceStr("ENDTIMENOTNULL"));
                    return;
                }
                if (string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd))
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("dtSearch"), Utility.GetResourceStr("STARTTIMENOTNULL"));
                    return;
                }
                if (!string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd))
                {
                    DtStart = System.Convert.ToDateTime(StrStart);
                    DtEnd   = System.Convert.ToDateTime(StrEnd + " 23:59:59");
                    if (DtStart > DtEnd)
                    {
                        Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("dtSearch"), Utility.GetResourceStr("STARTTIMENOTGREATENDTIME"));
                        return;
                    }
                    else
                    {
                        IsNull = true;
                    }
                }
            }

            SMT.SaaS.OA.UI.SmtOACommonOfficeService.LoginUserInfo loginUserInfo = new SMT.SaaS.OA.UI.SmtOACommonOfficeService.LoginUserInfo();
            loginUserInfo.companyID    = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            loginUserInfo.userID       = Common.CurrentLoginUserInfo.EmployeeID;
            loginUserInfo.postID       = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
            loginUserInfo.departmentID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
            loadbar.Start();
            //SendDocClient.GetSendDocInfosListByWorkFlowAsync(dataPager.PageIndex, dataPager.PageSize, "OACompanySendDoc.CREATEDATE", filter, paras, pageCount, checkState, loginUserInfo);
            SendDocClient.GetMYSendDocInfosListAsync(dataPager.PageIndex, dataPager.PageSize, "OACompanySendDoc.CREATEDATE", filter, paras, pageCount, "2", loginUserInfo);
        }
Example #49
0
        /// <summary>
        /// 可用于动态加载字典
        /// </summary>
        /// <param name="dicts"></param>
        /// <param name="category"></param>
        /// <param name="defaultValue"></param>
        public void BindComboBox(List<T_SYS_DICTIONARY> dicts, string category, string defaultValue)
        {
            var objs = from d in dicts
                       where d.DICTIONCATEGORY == category
                       orderby d.DICTIONARYVALUE
                       select d;
            List<T_SYS_DICTIONARY> tmpDicts = objs.ToList();

            if (IsShowNull)
            {
                T_SYS_DICTIONARY nuldict = new T_SYS_DICTIONARY();
                string dictname = Utility.GetResourceStr("PLEASESELECTED");

                nuldict.DICTIONARYNAME = dictname;
                nuldict.DICTIONARYVALUE = null;
                tmpDicts.Insert(0, nuldict);
            }

            ItemsSource = tmpDicts;
            DisplayMemberPath = "DICTIONARYNAME";


            SetValue(SelectedValueProperty, defaultValue);

        }
Example #50
0
        /// <summary>
        /// 重新提交
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btnReSubmit_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                string sType = string.Empty, sValue = string.Empty;

                string IsTag = treeOrganization.sType;
                switch (IsTag)
                {
                case "Company":
                    sType  = (Convert.ToInt32(AssignedObjectType.Company) + 1).ToString();
                    sValue = treeOrganization.sValue;
                    break;

                case "Department":
                    sType  = (Convert.ToInt32(AssignedObjectType.Department) + 1).ToString();
                    sValue = treeOrganization.sValue;
                    break;

                case "Post":
                    sType  = (Convert.ToInt32(AssignedObjectType.Post) + 1).ToString();
                    sValue = treeOrganization.sValue;
                    break;
                }

                if (string.IsNullOrEmpty(sValue))
                {
                    ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "APPOVALBUTTON"), Utility.GetResourceStr("CONFIRMBUTTON"));
                    return;
                }

                if (dgAMBList.ItemsSource == null)
                {
                    ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), "请选择有效的数据进行审核", Utility.GetResourceStr("CONFIRMBUTTON"));
                    return;
                }

                IEnumerable <T_HR_ATTENDMONTHLYBALANCE> entAMBList = dgAMBList.ItemsSource as IEnumerable <T_HR_ATTENDMONTHLYBALANCE>;
                if (entAMBList.Count() == 0)
                {
                    ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), "请选择有效的数据进行审核", Utility.GetResourceStr("CONFIRMBUTTON"));
                    return;
                }

                if (string.IsNullOrEmpty(sType) || string.IsNullOrEmpty(sValue))
                {
                    ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), "请选择有效的数据进行审核", Utility.GetResourceStr("CONFIRMBUTTON"));
                    return;
                }

                decimal dBalanceYear = 0, dBalanceMonth = 0;
                string  strCheckState = string.Empty;

                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;
                    if (entDic.DICTIONARYVALUE != null)
                    {
                        strCheckState = entDic.DICTIONARYVALUE.Value.ToString();
                    }
                }

                AttendMonthlyBalanceAudit formAttBalance = new AttendMonthlyBalanceAudit(FormTypes.Resubmit, sType, sValue, dBalanceYear, dBalanceMonth, strCheckState);
                EntityBrowser             entBrowser     = new EntityBrowser(formAttBalance);

                entBrowser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
                entBrowser.FormType         = FormTypes.Resubmit;
                entBrowser.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #51
0
        private bool IsLevelAdded(T_SYS_DICTIONARY dict)
        {
            bool rslt = false;

            var ents = from p in postLevels
                       where p.POSTLEVEL == Convert.ToDecimal(dict.DICTIONARYVALUE)
                       select p;
            rslt = ents.Count() > 0;
            return rslt;
        }
Example #52
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();
            }
        }
        private void ComVechileTypeLeve_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                TravelDictionaryComboBox vechiletype = sender as TravelDictionaryComboBox;
                if (vechiletype.SelectedIndex >= 0)
                {
                    if (employeepost != null)
                    {

                        var thd = takethestandardtransport.FirstOrDefault();

                        T_SYS_DICTIONARY VechileTypeObj = vechiletype.SelectedItem as T_SYS_DICTIONARY;
                        if (DaGrEdit.SelectedItem != null)
                        {
                            if (DaGrEdit.Columns[7].GetCellContent(DaGrEdit.SelectedItem) != null)
                            {
                                TravelDictionaryComboBox ComLevel = DaGrEdit.Columns[7].GetCellContent(DaGrEdit.SelectedItem).FindName("ComVechileTypeLeve") as TravelDictionaryComboBox;
                                TravelDictionaryComboBox ComType = DaGrEdit.Columns[6].GetCellContent(DaGrEdit.SelectedItem).FindName("ComVechileType") as TravelDictionaryComboBox;
                                T_SYS_DICTIONARY type = new T_SYS_DICTIONARY();
                                T_SYS_DICTIONARY level = new T_SYS_DICTIONARY();
                                level = ComLevel.SelectedItem as T_SYS_DICTIONARY;
                                type = ComType.SelectedItem as T_SYS_DICTIONARY;
                                if (type != null)
                                {
                                    thd = this.GetVehicleTypeValue(type.DICTIONARYVALUE.ToString());
                                    if (thd == null)
                                    {
                                        ComType.BorderBrush = new SolidColorBrush(Colors.Red);
                                        ComType.Foreground = new SolidColorBrush(Colors.Red);
                                        return;
                                    }
                                    if (level != null)
                                    {
                                        if (thd.TAKETHETOOLLEVEL.ToInt32() < level.DICTIONARYVALUE)
                                        {
                                            if (tempcomLevelForeBrush != null)
                                            {
                                                ComLevel.Foreground = tempcomLevelForeBrush;
                                            }
                                            if (tempcomLevelBorderBrush != null)
                                            {
                                                ComLevel.BorderBrush = tempcomLevelBorderBrush;
                                            }
                                            if (tempcomTypeBorderBrush != null)
                                            {
                                                ComType.BorderBrush = tempcomTypeBorderBrush;
                                            }
                                            if (tempcomTypeForeBrush != null)
                                            {
                                                ComType.Foreground = tempcomTypeForeBrush;
                                            }
                                        }
                                        else
                                        {
                                            if (thd.TYPEOFTRAVELTOOLS.ToInt32() > type.DICTIONARYVALUE)
                                            {
                                                ComType.BorderBrush = new SolidColorBrush(Colors.Red);
                                                ComType.Foreground = new SolidColorBrush(Colors.Red);
                                                this.txtTips.Visibility = Visibility.Visible;
                                                this.txtTips.Text = "交通工具超标";
                                                return;
                                            }
                                            else if (thd.TAKETHETOOLLEVEL.ToInt32() > level.DICTIONARYVALUE)
                                            {
                                                ComLevel.BorderBrush = new SolidColorBrush(Colors.Red);
                                                ComLevel.Foreground = new SolidColorBrush(Colors.Red);
                                                this.txtTips.Visibility = Visibility.Visible;
                                                this.txtTips.Text = "交通工具超标";
                                                return;
                                            }
                                            else
                                            {
                                                if (tempcomLevelForeBrush != null)
                                                {
                                                    ComLevel.Foreground = tempcomLevelForeBrush;
                                                }
                                                if (tempcomLevelBorderBrush != null)
                                                {
                                                    ComLevel.BorderBrush = tempcomLevelBorderBrush;
                                                }
                                                this.txtTips.Visibility = Visibility.Collapsed;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Current.Log(ex.Message, Category.Debug, Priority.Low);
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            }
        }
Example #54
0
 public static T_SYS_DICTIONARY CreateT_SYS_DICTIONARY(string dICTIONARYID)
 {
     T_SYS_DICTIONARY t_SYS_DICTIONARY = new T_SYS_DICTIONARY();
     t_SYS_DICTIONARY.DICTIONARYID = dICTIONARYID;
     return t_SYS_DICTIONARY;
 }
Example #55
0
 private void treeApproval_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
 {
     CheckedApproval.Text = "";
     strCode = "";
     if (treeApproval.SelectedItem != null)
     {
         T_SYS_DICTIONARY selectdic = new T_SYS_DICTIONARY();
         TreeViewItem selectedItemapp = treeApproval.SelectedItem as TreeViewItem;
         selectdic = selectedItemapp.Tag as T_SYS_DICTIONARY;
         if (selectdic != null)
         {
             
             CheckedApproval.Text = selectdic.DICTIONARYNAME;
             strCode = selectdic.DICTIONARYVALUE.ToString();
             SelectDictid = selectdic.DICTIONARYID;
             ShowApprovalTypeFlow(selectdic.DICTIONARYVALUE.ToString());
         }
     }
 }
Example #56
0
        private void ComVechileType_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                TravelDictionaryComboBox vechiletype = sender as TravelDictionaryComboBox;
                if (vechiletype.SelectedIndex >= 0)
                {
                    var thd = transportToolStand.FirstOrDefault();
                    thd = this.GetVehicleTypeValue("");
                    if (thd == null) return;
                    T_SYS_DICTIONARY VechileTypeObj = vechiletype.SelectedItem as T_SYS_DICTIONARY;
                    if (DaGrs.SelectedItem != null)
                    {
                        if (DaGrs.Columns[4].GetCellContent(DaGrs.SelectedItem) != null)
                        {
                            TravelDictionaryComboBox ComLevel = DaGrs.Columns[5].GetCellContent(DaGrs.SelectedItem).FindName("ComVechileTypeLeve") as TravelDictionaryComboBox;

                            var ListObj = from ent in ListVechileLevel
                                          where ent.T_SYS_DICTIONARY2.DICTIONARYID == VechileTypeObj.DICTIONARYID
                                          orderby ent.DICTIONARYVALUE descending
                                          select ent;
                            if (ListObj.Count() > 0)
                            {
                                ComLevel.ItemsSource = ListObj;
                                ComLevel.SelectedIndex = 0;
                            }
                        }
                    }
                    //if (employeepost != null)
                    //{
                    if (!string.IsNullOrEmpty(Master_Golbal.POSTLEVEL))
                    {
                        if (DaGrs.SelectedItem != null)
                        {
                            if (DaGrs.Columns[4].GetCellContent(DaGrs.SelectedItem) != null)
                            {
                                TravelDictionaryComboBox ComLevel = DaGrs.Columns[5].GetCellContent(DaGrs.SelectedItem).FindName("ComVechileTypeLeve") as TravelDictionaryComboBox;
                                TravelDictionaryComboBox ComType = DaGrs.Columns[4].GetCellContent(DaGrs.SelectedItem).FindName("ComVechileType") as TravelDictionaryComboBox;
                                T_SYS_DICTIONARY type = new T_SYS_DICTIONARY();
                                T_SYS_DICTIONARY level = new T_SYS_DICTIONARY();
                                level = ComLevel.SelectedItem as T_SYS_DICTIONARY;
                                type = ComType.SelectedItem as T_SYS_DICTIONARY;

                                if (transportToolStand.Count() > 0)
                                {
                                    if (thd != null)
                                    {
                                        if (type != null)
                                        {
                                            if (thd.TYPEOFTRAVELTOOLS.ToInt32() <= type.DICTIONARYVALUE)
                                            {
                                                if (tempcomTypeBorderBrush != null)
                                                {
                                                    ComType.BorderBrush = tempcomTypeBorderBrush;
                                                }
                                                if (tempcomTypeForeBrush != null)
                                                {
                                                    ComType.Foreground = tempcomTypeForeBrush;
                                                }
                                                if (tempcomLevelForeBrush != null)
                                                {
                                                    ComLevel.Foreground = tempcomLevelForeBrush;
                                                }
                                                if (tempcomLevelBorderBrush != null)
                                                {
                                                    ComLevel.BorderBrush = tempcomLevelBorderBrush;
                                                }
                                            }
                                            else
                                            {
                                                if (thd.TYPEOFTRAVELTOOLS.ToInt32() > type.DICTIONARYVALUE && thd.TAKETHETOOLLEVEL.ToInt32() > level.DICTIONARYVALUE)
                                                {
                                                    ComType.BorderBrush = new SolidColorBrush(Colors.Red);
                                                    ComType.Foreground = new SolidColorBrush(Colors.Red);
                                                    ComLevel.BorderBrush = new SolidColorBrush(Colors.Red);
                                                    ComLevel.Foreground = new SolidColorBrush(Colors.Red);
                                                    return;
                                                }
                                                if (thd.TYPEOFTRAVELTOOLS.ToInt32() > type.DICTIONARYVALUE)
                                                {
                                                    ComType.BorderBrush = new SolidColorBrush(Colors.Red);
                                                    ComType.Foreground = new SolidColorBrush(Colors.Red);
                                                    ComLevel.BorderBrush = new SolidColorBrush(Colors.Red);
                                                    ComLevel.Foreground = new SolidColorBrush(Colors.Red);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    //}
                }
            }
            catch (Exception ex)
            {
                Utility.SetLogAndShowLog(ex.ToString());
            }
        }