public LibraryWindowViewModel() { view = CollectionViewSource.GetDefaultView(LibraryItems); LibraryItems = new System.Collections.ObjectModel.ObservableCollection<string>(iservice.Files); iservice.Start(); iservice.FilesUpdated += new EventHandler<EventArgs<IList<string>>>(iservice_FilesUpdated); this.PropertyChanged += (s, ea) => System.Diagnostics.Debug.WriteLine(ea.PropertyName + " changed to " + this.GetType().GetProperty(ea.PropertyName).GetValue(this,null)); Observable.FromEventPattern<System.ComponentModel.PropertyChangedEventArgs>(this, "PropertyChanged") .Where(et => et.EventArgs.PropertyName == "SearchString") .Throttle(TimeSpan.FromMilliseconds(250)) .Subscribe(_ => { System.Diagnostics.Debug.WriteLine("search string changed"); if (SearchString.Trim() == string.Empty) view.Filter = null; else view.Filter = o => Regex.IsMatch(o as string, SearchString, RegexOptions.IgnoreCase); view.Refresh(); FilteredLibraryItemsCount = LibraryItems.Where(o => Regex.IsMatch(o as string, SearchString, RegexOptions.IgnoreCase)).Count(); }); //Observable.FromEventPattern<System.ComponentModel.PropertyChangedEventArgs>(this, "PropertyChanged") // .Where(et => et.EventArgs.PropertyName == "LibraryItems") // .Do(et => view = CollectionViewSource.GetDefaultView(LibraryItems)); }
void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e) { if (FixedDownloadPathHistory == null) { FixedDownloadPathHistory = new System.Collections.ObjectModel.ObservableCollection<string>(); } }
public void LinePatternViewer() { LPMainWindow main_win = null; try { Document theDoc = this.ActiveUIDocument.Document; System.Collections.ObjectModel.ObservableCollection<LinePattern> data = new System.Collections.ObjectModel.ObservableCollection<LinePattern>(); //Collect all line pattern elements FilteredElementCollector collector = new FilteredElementCollector(theDoc); IList<Element> linepatternelements = collector.WherePasses(new ElementClassFilter(typeof(LinePatternElement))).ToElements(); foreach (LinePatternElement lpe in linepatternelements) { data.Add(lpe.GetLinePattern()); } //start main window main_win = new LinePatternMacro.LPMainWindow(data); System.Windows.Interop.WindowInteropHelper x = new System.Windows.Interop.WindowInteropHelper(main_win); x.Owner = Process.GetCurrentProcess().MainWindowHandle; main_win.ShowDialog(); } catch (Exception err) { Debug.WriteLine(new string('*', 100)); Debug.WriteLine(err.ToString()); Debug.WriteLine(new string('*', 100)); if (main_win != null && main_win.IsActive) main_win.Close(); } }
private void LoadData() { loadbar.Start(); int pageCount = 0; string filter = ""; System.Collections.ObjectModel.ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>(); TextBox txtEmpName = Utility.FindChildControl<TextBox>(expander, "txtEmpName"); if (txtEmpName != null) { if (!string.IsNullOrEmpty(txtEmpName.Text)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } // filter += "EMPLOYEENAME==@" + paras.Count().ToString(); filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEENAME)"; paras.Add(txtEmpName.Text.Trim()); } } client.EmployeeCheckPagingAsync(dataPager.PageIndex, dataPager.PageSize, "BEREGULARDATE", filter, paras, pageCount, Checkstate, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID); }
public static System.Collections.ObjectModel.ObservableCollection<Recipe> getRecipes(string path) { System.Collections.ObjectModel.ObservableCollection<Recipe> allRecipes = new System.Collections.ObjectModel.ObservableCollection<Recipe>(); System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.Load(path); System.Xml.XmlNode RecipeList = doc.SelectSingleNode("RecipeBook"); System.Xml.XmlNodeList allRecipiesXML = RecipeList.SelectNodes("Recipe"); foreach (System.Xml.XmlNode nowRecipe in allRecipiesXML) { //string category_name = Convert.ToString(rec.Attributes.GetNamedItem("name").Value); //System.Xml.XmlNodeList currentRecipes = category.SelectNodes("Recipe"); //allRecipes.Add(new Tuple<string, List<Recipe>>(category_name, new List<Recipe>())); //foreach(System.Xml.XmlNode nowRecipe in currentRecipes) //{ Recipe recipe = new Recipe(); recipe.Category = nowRecipe.SelectSingleNode("Category").InnerText; recipe.Title = nowRecipe.SelectSingleNode("Title").InnerText; recipe.Ingredients = nowRecipe.SelectSingleNode("Ingredients").InnerText; recipe.WayToCook = nowRecipe.SelectSingleNode("WayToCook").InnerText; System.Xml.XmlNode ttc = nowRecipe.SelectSingleNode("TimeToCook"); if (ttc != null) recipe.TimeToCook = ttc.InnerText; System.Xml.XmlNode aut = nowRecipe.SelectSingleNode("Author"); if (aut != null) recipe.Author = aut.InnerText; allRecipes.Add(recipe); //} } return allRecipes; }
private void LoadData() { loadbar.Start(); int pageCount = 0; string filter = ""; System.Collections.ObjectModel.ObservableCollection<string> paras = new System.Collections.ObjectModel.ObservableCollection<string>(); if (!string.IsNullOrEmpty(txtEmpName.Text)) { // filter += "T_HR_EMPLOYEE.EMPLOYEECNAME==@" + paras.Count().ToString(); filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEECNAME)"; paras.Add(txtEmpName.Text.Trim()); } if (!string.IsNullOrEmpty(txtEmpCode.Text)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEECODE)"; paras.Add(txtEmpCode.Text.Trim()); } string sType = treeOrganization.sType, sValue = treeOrganization.sValue; client.GetEmployeeViewsPagingAsync(dataPager.PageIndex, dataPager.PageSize, "EMPLOYEECNAME", filter, paras, pageCount, sType, sValue, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID); }
//加载数据 private void GetData(int pageIndex, string checkState) { int pageCount = 0; ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>(); //查询过滤条件 paras.Add(dtiStartDate.DateTimeValue); paras.Add(dtiEndDate.DateTimeValue); vehicleManager.GetCanUseVehicleUseAppInfoListAsync(pageIndex, dataPager.PageSize, "UPDATEDATE", "", paras, pageCount, Common.CurrentLoginUserInfo.UserPosts[0].CompanyID, Common.CurrentLoginUserInfo.EmployeeID); }
public StringContainsFunction() { Name = FunctionName; SelectedParameter = FunctionParameters.CellName; Parameters = new System.Collections.ObjectModel.ObservableCollection<Parameter> { new Parameter{Name="Текст", ExpectedValueType = typeof(string)} }; }
public GetRightCharFunction() { Name = "Строка справа"; SelectedParameter = FunctionParameters.CellName; Parameters = new System.Collections.ObjectModel.ObservableCollection<Parameter> { new Parameter{Name="Длинна", Value=0, ExpectedValueType = typeof(int)} }; }
public StringPositionFunction() { Name = "Подстрока"; SelectedParameter = FunctionParameters.CellName; Parameters = new System.Collections.ObjectModel.ObservableCollection<Parameter> { new Parameter{Name="Начало", ExpectedValueType = typeof(int)}, new Parameter{Name="Длинна", ExpectedValueType = typeof(int)} }; }
private void LoadData() { loadbar.Start(); int pageCount = 0; string filter = ""; System.Collections.ObjectModel.ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>(); client.ImportSetMasterPagingAsync(pageMaster.PageIndex, pageMaster.PageSize, "ENTITYNAME", filter, paras, pageCount, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID); }
//加载数据 private void GetData(int pageIndex, string checkState) { int pageCount = 0; ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>(); //查询过滤条件 paras.Add(DateTime.Parse(DateStart.Text)); paras.Add(DateTime.Parse(DateEnd.Text)); paras.Add((cmbVehicleInfo.SelectedItem as T_OA_VEHICLE).ASSETID); _VM.Get_VMAppCheckedAsync(pageIndex, dataPager.PageSize, "UPDATEDATE", "", paras, pageCount, Common.CurrentLoginUserInfo.UserPosts[0].CompanyID, Common.CurrentLoginUserInfo.EmployeeID, "2"); }
private void LoadData() { loadbar.Start(); int pageCount = 0; string filter = ""; System.Collections.ObjectModel.ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>(); TextBox txtDepID = Utility.FindChildControl<TextBox>(expander, "txtDepCode"); if (txtDepID != null) { if (!string.IsNullOrEmpty(txtDepID.Text)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } //filter += "DEPARTMENTCODE==@" + paras.Count().ToString(); filter += " @" + paras.Count().ToString() + ".Contains(DEPARTMENTCODE)"; paras.Add(txtDepID.Text.Trim()); } } TextBox txtDepName = Utility.FindChildControl<TextBox>(expander, "txtDepName"); if (txtDepName != null) { if (!string.IsNullOrEmpty(txtDepName.Text)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } // filter += "DEPARTMENTNAME==@" + paras.Count().ToString(); filter += " @" + paras.Count().ToString() + ".Contains(DEPARTMENTNAME)"; paras.Add(txtDepName.Text.Trim()); } } ComboBox txtDepType = Utility.FindChildControl<ComboBox>(expander, "cbxDepType"); if (txtDepType != null) { if (txtDepType.SelectedIndex > 0) { if (!string.IsNullOrEmpty((txtDepType.SelectedItem as T_SYS_DICTIONARY).DICTIONARYID)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "DEPARTMENTTYPE==@" + paras.Count().ToString(); // paras.Add(txtDepType.SelectedValue.Trim()); paras.Add((txtDepType.SelectedItem as T_SYS_DICTIONARY).DICTIONARYVALUE.ToString()); } } } svc.DepartmentDictionaryPagingAsync(dataPager.PageIndex, dataPager.PageSize, "DEPARTMENTCODE", filter, paras, pageCount, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, Checkstate); }
public StringLengthFunction() { Name = FunctionName; SelectedParameter = FunctionParameters.CellName; Parameters = new System.Collections.ObjectModel.ObservableCollection<Parameter> { new Parameter{Name="Больше", ExpectedValueType = typeof(int)}, new Parameter{Name="Меньше", ExpectedValueType = typeof(int)}, new Parameter{Name="Равно", ExpectedValueType = typeof(int)}, }; }
//加载数据 private void GetData(int pageIndex, string checkState) { int pageCount = 0; ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>(); //参数值 paras.Add(DateStart.Text); paras.Add(DateEnd.Text); SMT.SaaS.OA.UI.SmtOACommonAdminService.LoginUserInfo loginInfo = new SMT.SaaS.OA.UI.SmtOACommonAdminService.LoginUserInfo(); loginInfo.companyID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; loginInfo.userID = Common.CurrentLoginUserInfo.EmployeeID; _VM.Get_SSurveyCheckedAsync(pageIndex, dataPager.PageSize, "RequireMaster.CREATEDATE", "", paras, pageCount, Common.CurrentLoginUserInfo.UserPosts[0].CompanyID, Common.CurrentLoginUserInfo.EmployeeID, "2"); }
//加载数据 private void GetData(int pageIndex, string checkState) { if (cmbVehicleInfo != null && cmbVehicleInfo.Items.Count > 0) { int pageCount = 0; ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>(); //参数值 paras.Add((cmbVehicleInfo.SelectionBoxItem as T_OA_VEHICLE).ASSETID); paras.Add(dtiStartDate.DateTimeValue); SMT.SaaS.OA.UI.SmtOACommonAdminService.LoginUserInfo loginInfo = new SMT.SaaS.OA.UI.SmtOACommonAdminService.LoginUserInfo(); vehicleManager.Gets_VDCheckedAsync(pageIndex, dataPager.PageSize, "CREATEDATE", "", paras, pageCount, loginInfo); } }
//委托的声明 //public delegate void Debug_Event_Handler(object sender, String msg); //public event Debug_Event_Handler Debug_Event; public MainWindow() { System.Windows.Media.RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly; InitializeComponent(); distime = new disTime(this, this.RemoveAllMediaTextBlock); initWL(); personalInfoList = new System.Collections.ObjectModel.ObservableCollection<slaveList>(); this.iplistView.ItemsSource = personalInfoList; }
public void LoadData() { RefreshUI(RefreshedTypes.ShowProgressBar); int pageCount = 0; string filter = ""; int sType = 0; string sValue = ""; DateTime? starttimes; DateTime? endtimes = DateTime.Now.Date; starttimes = new DateTime(DateTime.Now.Year - 2, 1, 1); endtimes = new DateTime(DateTime.Now.Year, 12, 1); System.Collections.ObjectModel.ObservableCollection<string> paras = new System.Collections.ObjectModel.ObservableCollection<string>(); TextBox txtEmpName = Utility.FindChildControl<TextBox>(expander, "txtEmpName"); if (!string.IsNullOrEmpty(treeOrganization.sType)) { string IsTag = treeOrganization.sType; sValue = treeOrganization.sValue; switch (IsTag) { case "0": sType = 0; break; case "1": sType = 1; break; case "2": sType = 2; break; } } else { RefreshUI(RefreshedTypes.HideProgressBar); return; } if (!string.IsNullOrEmpty(txtEmpName.Text.Trim())) { // filter += "EMPLOYEENAME==@" + paras.Count().ToString(); //filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEENAME)"; filter += " EMPLOYEENAME.Contains(@" + paras.Count().ToString() + ")"; paras.Add(txtEmpName.Text.Trim()); } client.GetResignAsync(dataPager.PageIndex, dataPager.PageSize, "EMPLOYEEID", filter, paras, pageCount, Convert.ToDateTime(starttimes), Convert.ToDateTime(endtimes), userID, sType, sValue); }
private void LoadData() { loadbar.Start(); int pageCount = 0; string filter = ""; System.Collections.ObjectModel.ObservableCollection<string> paras = new System.Collections.ObjectModel.ObservableCollection<string>(); //TextBox txtName = Utility.FindChildControl<TextBox Style="{StaticResource TextBoxStyle}">(expander, "txtName"); //if (txtName != null && !string.IsNullOrEmpty(txtName.Text.Trim())) //{ // filter += "T_HR_SALARYSTANDARD.SALARYSTANDARDNAME==@" + paras.Count().ToString(); // paras.Add(txtName.Text.Trim()); //} client.GetSalaryLevelPagingAsync(dataPager.PageIndex, dataPager.PageSize, "SALARYLEVELID", filter, paras, pageCount,SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID); }
//加载数据 private void GetData(string checkState) { string filter = ""; //查询过滤条件 ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>(); //查询过滤条件 RefreshUI(RefreshedTypes.ShowProgressBar); if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "OWNERID == @" + paras.Count().ToString(); paras.Add(strOwnerID); decimal dCheckStates = 0, dIsRepaied = 1; decimal.TryParse(checkState, out dCheckStates); client.GetBorrowApplyMasterListForRepayAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, dIsRepaied, dCheckStates, filter, paras); }
//加载数据 private void GetData() { int pageCount = 0; string filter = ""; //查询过滤条件 string StrStart = ""; string StrEnd = ""; StrStart = DateStart.Text.ToString(); StrEnd = DateEnd.Text.ToString(); DateTime DtStart = new DateTime(); DateTime DtEnd = new DateTime(); ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>(); //参数值 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("WARING"), Utility.GetResourceStr("ERRORSTARTDATEGTENDDATE")); return; } else { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "RequireMaster.CREATEDATE >=@" + paras.Count().ToString();//开始时间 paras.Add(DtStart); filter += " and "; filter += "RequireMaster.CREATEDATE <=@" + paras.Count().ToString();//结束时间 paras.Add(DtEnd); } } paras.Add(DateStart.Text); paras.Add(DateEnd.Text); SMT.SaaS.OA.UI.SmtOACommonAdminService.LoginUserInfo loginInfo = new SMT.SaaS.OA.UI.SmtOACommonAdminService.LoginUserInfo(); loginInfo.companyID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; loginInfo.userID = Common.CurrentLoginUserInfo.EmployeeID; RefreshUI(RefreshedTypes.ShowProgressBar); _VM.Get_ESurveyCheckedAsync(dataPager.PageIndex, dataPager.PageSize, "RequireMaster.CREATEDATE", "", paras, pageCount, Common.CurrentLoginUserInfo.UserPosts[0].CompanyID, Common.CurrentLoginUserInfo.EmployeeID, checkState); }
public void EditData() { int pageCount = 0; string filter = ""; System.Collections.ObjectModel.ObservableCollection<string> paras = new System.Collections.ObjectModel.ObservableCollection<string>(); filter += "MODELTYPE==@" + paras.Count().ToString(); paras.Add("4"); filter += " and PARAMETERVALUE==@" + paras.Count().ToString(); paras.Add(SMT.SaaS.FrameworkUI.Common.Utility.Encrypt(oldpwd.Password)); filter += " and OWNERID==@" + paras.Count().ToString(); paras.Add(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID); loadbar.Start(); client.GetSystemParamSetPagingAsync(1, 20, "PARAMETERNAME", filter, paras, pageCount, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID); }
private static System.Collections.ObjectModel.ObservableCollection<object> Get_combo_Items() { System.Collections.ObjectModel.ObservableCollection<object> items = new System.Collections.ObjectModel.ObservableCollection<object>(); // item1 element ComboBoxItem item1 = new ComboBoxItem(); item1.Name = "item1"; item1.Content = "Item 1"; items.Add(item1); // item2 element ComboBoxItem item2 = new ComboBoxItem(); item2.Name = "item2"; item2.Content = "Item 2"; items.Add(item2); // item3 element ComboBoxItem item3 = new ComboBoxItem(); item3.Name = "item3"; item3.Content = "Item 3"; item3.IsSelected = true; items.Add(item3); return items; }
public void DateGrid() { ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>();//参数值 int pageCount = 0; string filter = ""; //查询过滤条件 if (cobSYSTEMCODE.SelectedItem as AppSystem != null && (cobSYSTEMCODE.SelectedItem as AppSystem).Name != "0") { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "SYSTEMCODE = '" + (cobSYSTEMCODE.SelectedItem as AppSystem).Name + "'"; } if (cobModule.SelectedItem as AppModel != null) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "MODELCODE = '" + (cobModule.SelectedItem as AppModel).Name + "'"; } //==added by jason, 02/22/2012 string strAllOwnerCompanyId = Utility.GetAllOwnerCompanyId(); if (strAllOwnerCompanyId != "") { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += " CompanyId in (" + strAllOwnerCompanyId + ") "; } //默认消息查询 client.GetListFlowTriggerDefineAsync(filter, dataPager1.PageIndex, dataPager1.PageSize, pageCount); }
private void LoadData() { int pageCount = 0; string filter = ""; System.Collections.ObjectModel.ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>(); filter += "CHECKSTATE==@" + paras.Count().ToString(); // paras.Add(Checkstate); paras.Add(Convert.ToInt32(CheckStates.Approved).ToString()); TextBox txtEmpName = Utility.FindChildControl<TextBox>(expander, "txtEmpName"); if (!string.IsNullOrEmpty(txtEmpName.Text)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "EMPLOYEENAME==@" + paras.Count().ToString(); paras.Add(txtEmpName.Text.Trim()); } client.EmployeeEvectionReportPagingAsync(dataPager.PageIndex, dataPager.PageSize, "EMPLOYEECODE", filter, paras, pageCount); loadbar.Start(); }
private void LoadData() { int pageCount = 0; string filter = ""; System.Collections.ObjectModel.ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>(); filter += "T_HR_POST.POSTID==@" + paras.Count().ToString(); paras.Add(PostID); //TextBox txtEmpName = Utility.FindChildControl<TextBox Style="{StaticResource TextBoxStyle}">(expander, "txtEmpName"); //if (!string.IsNullOrEmpty(txtEmpName.Text)) //{ // if (!string.IsNullOrEmpty(filter)) // { // filter += " and "; // } // filter += "CNAME==@" + paras.Count().ToString(); // paras.Add(txtEmpName.Text.Trim()); //} client.RelationPostPagingAsync(dataPager.PageIndex, dataPager.PageSize, "T_HR_POST.POSTID", filter, paras, pageCount); loadbar.Stop(); }
/// <summary> /// 获取数据 1 /// </summary> /// <param name="pageIndex"></param> /// <param name="checkState"></param> private void GetData(int pageIndex, string checkState) { int pageCount = 0; string filter = ""; //查询过滤条件 ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); //参数值 if (IsQuery) { string StrTitle = ""; string StrContent = ""; string StrStart = ""; string StrEnd = ""; StrStart = dpStart.Text.ToString(); StrEnd = dpEnd.Text.ToString(); DateTime DtStart = new DateTime(); DateTime DtEnd = new DateTime(); StrTitle = this.txtSurveysTITLE.Text.ToString().Trim(); StrContent = this.txtSurveysContent.Text.ToString().Trim(); if (!string.IsNullOrEmpty(StrStart) && string.IsNullOrEmpty(StrEnd)) { Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARING"), Utility.GetResourceStr("ENDTIMENOTNULL")); //MessageBox.Show("结束时间不能为空"); return; } if (string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd)) { Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARING"), Utility.GetResourceStr("MEETINGSTARTTIMENOTNULL")); //MessageBox.Show("开始时间不能为空"); 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("WARING"), Utility.GetResourceStr("ERRORSTARTDATEGTENDDATE")); return; } else { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "OARequire.STARTDATE >=@" + paras.Count().ToString();//开始时间 paras.Add(DtStart); filter += " and "; filter += "OARequire.STARTDATE <=@" + paras.Count().ToString();//结束时间 paras.Add(DtEnd); } } if (!string.IsNullOrEmpty(StrTitle)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "OARequire.SATISFACTIONTITLE ^@" + paras.Count().ToString();//类型名称 paras.Add(StrTitle); } if (!string.IsNullOrEmpty(StrContent)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "OARequire.CONTENT ^@" + paras.Count().ToString();//类型名称 paras.Add(StrContent); } //if (!string.IsNullOrEmpty(filter)) //{ // filter += " and "; //} //filter += "OARequire.STARTDATE <=@" + paras.Count().ToString();//类型名称 //paras.Add(System.DateTime.Now); } loadbar.Start(); client.Get_StaticfactionSurveyAppCheckedAsync(dataPager.PageIndex, dataPager.PageSize, "OARequire.UPDATEDATE descending", filter, paras, pageCount, Common.CurrentLoginUserInfo.UserPosts[0].CompanyID, Common.CurrentLoginUserInfo.EmployeeID, checkState, Common.CurrentLoginUserInfo.UserPosts[0].PostID, Common.CurrentLoginUserInfo.UserPosts[0].CompanyID, Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID); }
private void LoadSalaryRecordData() { try { loadbar.Start(); int pageCount = 0; itemsAll.Clear(); string filter = ""; int sType = 0; string sValue = ""; list = null; TextBox txtName = Utility.FindChildControl <TextBox>(expander, "txtName"); DateTime?starttimes; DateTime?endtimes = DateTime.Now.Date; if (DateTime.Now.Month <= 2) { starttimes = new DateTime(DateTime.Now.Year - 1, 1, 1); } else { starttimes = new DateTime(DateTime.Now.Year, DateTime.Now.Month - 2, 1); } System.Collections.ObjectModel.ObservableCollection <string> paras = new System.Collections.ObjectModel.ObservableCollection <string>(); string selectedType = treeOrganization.sType; if (!string.IsNullOrEmpty(selectedType)) { switch (selectedType) { case "Company": sType = 0; break; case "Department": sType = 1; break; case "Post": sType = 2; break; } sValue = treeOrganization.sValue; } else { sType = 0; sValue = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; //loadbar.Stop(); //return; } string strState = Convert.ToInt32(CheckStates.Approved).ToString(); //DatePicker dpstarttimes = Utility.FindChildControl<DatePicker>(expander, "dpstarttime"); //DatePicker dpendtimes = Utility.FindChildControl<DatePicker>(expander, "dpendtime"); //NumericUpDown nuYear = Utility.FindChildControl<NumericUpDown>(expander, "Nuyear"); //NumericUpDown nuEndYear = Utility.FindChildControl<NumericUpDown>(expander, "NuEndyear"); //NumericUpDown nuStartmounth = Utility.FindChildControl<NumericUpDown>(expander, "NuStartmounth"); //NumericUpDown nuEndmounth = Utility.FindChildControl<NumericUpDown>(expander, "NuEndmounth"); ////if (nuYear != null && nuStartmounth != null) ////{ //starttimes = new DateTime(nuYear.Value.ToInt32(), nuStartmounth.Value.ToInt32(), 1); //endtimes = new DateTime(nuYear.Value.ToInt32(), nuStartmounth.Value.ToInt32(), DateTime.DaysInMonth(nuYear.Value.ToInt32(), nuStartmounth.Value.ToInt32())); starttimes = new DateTime(0001, 1, 1); endtimes = DateTime.Now; //} //else //{ // int year, month; // year = DateTime.Now.Year; // month = DateTime.Now.Month - 1; // if (DateTime.Now.Month <= 1) // { // year = DateTime.Now.Year - 1; // month = 12; // } // starttimes = new DateTime(year, month, 1); // endtimes = new DateTime(year, month, DateTime.DaysInMonth(year, month)); //} //if (txtName != null && !string.IsNullOrEmpty(txtName.Text.Trim())) //{ // filter += " EMPLOYEENAME.Contains(@" + paras.Count().ToString() + ")"; // paras.Add(txtName.Text.Trim()); //} //else //{ // filter += " EMPLOYEENAME.Contains(@" + paras.Count().ToString() + ")"; // paras.Add(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName); //} if (!string.IsNullOrEmpty(userID)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } //filter += "EMPLOYEEID==@" + paras.Count().ToString(); //paras.Add(userID); //filter += " OR EMPLOYEEID==@" + paras.Count().ToString(); //paras.Add(userID); //filter += " AND PAYCONFIRM==@" + paras.Count().ToString(); filter += " OWNERID==@" + paras.Count().ToString(); paras.Add(userID); } if (!string.IsNullOrEmpty(userID)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } //filter += "EMPLOYEEID==@" + paras.Count().ToString(); //paras.Add(userID); //filter += " OR EMPLOYEEID==@" + paras.Count().ToString(); //paras.Add(userID); //filter += " AND PAYCONFIRM==@" + paras.Count().ToString(); filter += " PAYCONFIRM==@" + paras.Count().ToString(); paras.Add("2"); } else { loadbar.Stop(); return; } #region 薪资标准过滤 if (!string.IsNullOrEmpty(salaryStandardid)) //过滤测试时候注释 { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "SALARYSTANDARDID==@" + paras.Count().ToString(); paras.Add(salaryStandardid); } //else //{ // loadbar.Stop(); // return; //} #endregion client.GetMenuSignAutoEmployeeSalaryRecordPagingsAsync(dataPager.PageIndex, dataPager.PageSize, "", filter, paras, pageCount, Convert.ToDateTime(starttimes), Convert.ToDateTime(endtimes), sType, sValue, strState, userID, "PAYSALARYHISTORY"); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
/// <summary> /// Default constructor. Protected due to required properties, but present because EF needs it. /// </summary> protected BParentOptional() { BChildCollection = new System.Collections.ObjectModel.ObservableCollection <BChild>(); Init(); }
void LoadOrderMealInfos(string StrUserID, string StrState) { //OrderMealClient.GetOrderMealInfosCompleted +=new EventHandler<GetOrderMealInfosCompletedEventArgs>(OrderMealClient_GetOrderMealInfosCompleted); //OrderMealClient.GetOrderMealInfosAsync(tmpStrUserID,StrState); string StrTitle = ""; int pageCount = 0; string filter = ""; //查询过滤条件 string StrContent = ""; string StrStart = ""; string StrEnd = ""; StrTitle = txtOrderMealTitle.Text.Trim().ToString(); StrContent = txtContent.Text.Trim().ToString(); StrStart = dpStart.Text.ToString(); StrEnd = dpEnd.Text.ToString(); DateTime DtStart = new DateTime(); DateTime DtEnd = new DateTime(); ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); //参数值 if (!string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd)) { DtStart = System.Convert.ToDateTime(StrStart); DtEnd = System.Convert.ToDateTime(StrEnd + " 23:59:59"); if (DtStart > DtEnd) { //MessageBox.Show("开始时间不能大于结束时间"); Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("SEARCH"), Utility.GetResourceStr("STARTTIMENOTGREATENDTIME")); return; } } if (!string.IsNullOrEmpty(StrState)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "ORDERMEALFLAG ^@" + paras.Count().ToString();//类型名称 paras.Add(StrState); } if (!string.IsNullOrEmpty(StrTitle)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "ORDERMEALTITLE ^@" + paras.Count().ToString();//类型名称 paras.Add(StrTitle); } if (!string.IsNullOrEmpty(StrContent)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "CONTENT ^@" + paras.Count().ToString();//类型名称 paras.Add(StrContent); } SMT.SaaS.OA.UI.SmtOAPersonOfficeService.LoginUserInfo loginUserInfo = new SMT.SaaS.OA.UI.SmtOAPersonOfficeService.LoginUserInfo(); loginUserInfo.companyID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; loginUserInfo.userID = Common.CurrentLoginUserInfo.EmployeeID; OrderMealClient.GetOrderMealInfosListByTitleTimeSearchAsync(dataPager.PageIndex, dataPager.PageSize, "CREATEDATE", filter, paras, pageCount, loginUserInfo); }
public MainWindowViewModel() { IsChecked1 = new Boolean[4]; IsChecked2 = new Boolean[4]; IsChecked3 = new Boolean[4]; IsChecked4 = new Boolean[4]; IsChecked5 = new Boolean[4]; IsChecked6 = new Boolean[4]; xCoordinates = new List <float>(); yCoordinates = new List <float>(); _isInTurns = new List <int>(); _trackSections = new List <int>(); CollectionLaps = new System.Collections.ObjectModel.ObservableCollection <string>(); CollectionSections = new ObservableCollection <string>(); SelectedLap = "All Laps"; SelectedSection = "All Sections"; string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\AssettoCorsaTelemetry\\"; string fileName = DateTime.Now.ToString("MM-dd-yyyy_HH-mm") + ".csv"; _filepath = System.IO.Path.Combine(path, fileName); Type t = typeof(Physics); _physicsMembers = t.GetFields(BindingFlags.Public | BindingFlags.Instance); Type type = typeof(Graphics); _graphicsMembers = type.GetFields(BindingFlags.Public | BindingFlags.Instance); bool isExists = System.IO.Directory.Exists(path); if (!isExists) { System.IO.Directory.CreateDirectory(path); } using (StreamWriter f = File.AppendText(_filepath)) { foreach (var physMember in _physicsMembers) { if (physMember.Name != "PacketId") { f.Write(physMember.Name + ","); } } foreach (var graphMember in _graphicsMembers) { if (graphMember.Name != "PacketId") { f.Write(graphMember.Name + ","); } } f.Write("UNIXTimeStamp_Seconds"); f.Write("\r\n"); } var sdk = new AcSdk.AcSdk(); sdk.UpdateFrequency = 5; sdk.StaticInfoUpdated += StaticInfoUpdated; sdk.Updated += Updated; sdk.Start(); }
/// <summary> /// Default constructor. Protected due to required properties, but present because EF needs it. /// </summary> protected Child() { Children = new System.Collections.ObjectModel.ObservableCollection <Child>(); Init(); }
private void gantt_Loaded(object sender, RoutedEventArgs e) { ObservableCollection <IGanttNode> nodes = new System.Collections.ObjectModel.ObservableCollection <IGanttNode> { new ExampleGanttNode { TaskName = "Test MyTask", StartDate = DateTime.Now, EndDate = DateTime.Now.AddDays(5), Resources = "dave", PercentComplete = 25d }, new ExampleGanttNode { TaskName = "Another Test MyTask", StartDate = DateTime.Now.AddDays(5), EndDate = DateTime.Now.AddDays(6), Resources = "parker", PercentComplete = 50d }, new ExampleGanttNode { TaskName = "Yet Test MyTask", StartDate = DateTime.Now.AddDays(6), EndDate = DateTime.Now.AddDays(10), Resources = "dylan", PercentComplete = 75d }, new ExampleGanttNode { TaskName = "Yo Momma's MyTask", StartDate = DateTime.Now.AddDays(10), EndDate = DateTime.Now.AddDays(20), Resources = "missy", PercentComplete = 2d }, new ExampleGanttNode { TaskName = "Yo Daddy's MyTask", StartDate = DateTime.Now.AddDays(20), EndDate = DateTime.Now.AddDays(30), Resources = "missy", PercentComplete = 10d }, new ExampleGanttNode { TaskName = "My MyTask's MyTask", StartDate = DateTime.Now.AddDays(30), EndDate = DateTime.Now.AddDays(40), Resources = "missy", PercentComplete = 40d }, new ExampleGanttNode { TaskName = "Your Next MyTask", StartDate = DateTime.Now.AddDays(40), EndDate = DateTime.Now.AddDays(50), Resources = "missy", PercentComplete = 50d }, new ExampleGanttNode { TaskName = "The Big MyTask", StartDate = DateTime.Now.AddDays(50), EndDate = DateTime.Now.AddDays(60), Resources = "missy", PercentComplete = 60d }, new ExampleGanttNode { TaskName = "The Small MyTask", StartDate = DateTime.Now.AddDays(60), EndDate = DateTime.Now.AddDays(70), Resources = "missy", PercentComplete = 70d }, new ExampleGanttNode { TaskName = "Nothing Special", StartDate = DateTime.Now.AddDays(70), EndDate = DateTime.Now.AddDays(80), Resources = "missy", PercentComplete = 80d }, new ExampleGanttNode { TaskName = "Something To Write Home About", StartDate = DateTime.Now.AddDays(80), EndDate = DateTime.Now.AddDays(90), Resources = "missy", PercentComplete = 90d } }; nodes[0].ChildNodes = new System.Collections.ObjectModel.ObservableCollection <IGanttNode> { new ExampleGanttNode { TaskName = "Sub MyTask 1", StartDate = nodes[0].StartDate, EndDate = nodes[0].StartDate.AddDays(2), Resources = "dave", PercentComplete = 25d }, new ExampleGanttNode { TaskName = "Sub MyTask 2", StartDate = nodes[0].StartDate.AddDays(2), EndDate = nodes[0].StartDate.AddDays(3), Resources = "parker", PercentComplete = 50d }, new ExampleGanttNode { TaskName = "Sub MyTask 3", StartDate = nodes[0].StartDate.AddDays(3), EndDate = nodes[0].StartDate.AddDays(5), Resources = "dylan", PercentComplete = 75d }, new ExampleGanttNode { TaskName = "Sub MyTask 4", StartDate = nodes[0].StartDate.AddDays(5), EndDate = nodes[0].StartDate.AddDays(1), Resources = "missy", PercentComplete = 100d } }; nodes[1].ChildNodes = new System.Collections.ObjectModel.ObservableCollection <IGanttNode> { new ExampleGanttNode { TaskName = "Sub MyTask 1", StartDate = nodes[1].StartDate, EndDate = nodes[1].StartDate.AddDays(2), Resources = "dave", PercentComplete = 25d }, new ExampleGanttNode { TaskName = "Sub MyTask 2", StartDate = nodes[1].StartDate.AddDays(2), EndDate = nodes[1].StartDate.AddDays(3), Resources = "parker", PercentComplete = 50d }, new ExampleGanttNode { TaskName = "Sub MyTask 3", StartDate = nodes[1].StartDate.AddDays(3), EndDate = nodes[1].StartDate.AddDays(5), Resources = "dylan", PercentComplete = 75d }, new ExampleGanttNode { TaskName = "Sub MyTask 4", StartDate = nodes[1].StartDate.AddDays(5), EndDate = nodes[1].StartDate.AddDays(1), Resources = "missy", PercentComplete = 100d } }; nodes[2].ChildNodes = new System.Collections.ObjectModel.ObservableCollection <IGanttNode> { new ExampleGanttNode { TaskName = "Sub MyTask 1", StartDate = nodes[2].StartDate, EndDate = nodes[2].StartDate.AddDays(2), Resources = "dave", PercentComplete = 25d }, new ExampleGanttNode { TaskName = "Sub MyTask 2", StartDate = nodes[2].StartDate.AddDays(2), EndDate = nodes[2].StartDate.AddDays(3), Resources = "parker", PercentComplete = 50d }, new ExampleGanttNode { TaskName = "Sub MyTask 3", StartDate = nodes[2].StartDate.AddDays(3), EndDate = nodes[2].StartDate.AddDays(5), Resources = "dylan", PercentComplete = 75d }, new ExampleGanttNode { TaskName = "Sub MyTask 4", StartDate = nodes[2].StartDate.AddDays(5), EndDate = nodes[2].StartDate.AddDays(1), Resources = "missy", PercentComplete = 100d } }; nodes[3].ChildNodes = new System.Collections.ObjectModel.ObservableCollection <IGanttNode> { new ExampleGanttNode { TaskName = "Sub MyTask 1", StartDate = nodes[3].StartDate, EndDate = nodes[3].StartDate.AddDays(2), Resources = "dave", PercentComplete = 25d }, new ExampleGanttNode { TaskName = "Sub MyTask 2", StartDate = nodes[3].StartDate.AddDays(2), EndDate = nodes[3].StartDate.AddDays(3), Resources = "parker", PercentComplete = 50d }, new ExampleGanttNode { TaskName = "Sub MyTask 3", StartDate = nodes[3].StartDate.AddDays(3), EndDate = nodes[3].StartDate.AddDays(5), Resources = "dylan", PercentComplete = 75d }, new ExampleGanttNode { TaskName = "Sub MyTask 4", StartDate = nodes[3].StartDate.AddDays(5), EndDate = nodes[3].StartDate.AddDays(1), Resources = "missy", PercentComplete = 100d } }; nodes[4].ChildNodes = new System.Collections.ObjectModel.ObservableCollection <IGanttNode> { new ExampleGanttNode { TaskName = "Sub MyTask 1", StartDate = nodes[4].StartDate, EndDate = nodes[4].StartDate.AddDays(2), Resources = "dave", PercentComplete = 25d }, new ExampleGanttNode { TaskName = "Sub MyTask 2", StartDate = nodes[4].StartDate.AddDays(2), EndDate = nodes[4].StartDate.AddDays(3), Resources = "parker", PercentComplete = 50d }, new ExampleGanttNode { TaskName = "Sub MyTask 3", StartDate = nodes[4].StartDate.AddDays(3), EndDate = nodes[4].StartDate.AddDays(5), Resources = "dylan", PercentComplete = 75d }, new ExampleGanttNode { TaskName = "Sub MyTask 4", StartDate = nodes[4].StartDate.AddDays(5), EndDate = nodes[4].StartDate.AddDays(1), Resources = "missy", PercentComplete = 100d } }; nodes[5].ChildNodes = new System.Collections.ObjectModel.ObservableCollection <IGanttNode> { new ExampleGanttNode { TaskName = "Sub MyTask 1", StartDate = nodes[5].StartDate, EndDate = nodes[5].StartDate.AddDays(2), Resources = "dave", PercentComplete = 25d }, new ExampleGanttNode { TaskName = "Sub MyTask 2", StartDate = nodes[5].StartDate.AddDays(2), EndDate = nodes[5].StartDate.AddDays(3), Resources = "parker", PercentComplete = 50d }, new ExampleGanttNode { TaskName = "Sub MyTask 3", StartDate = nodes[5].StartDate.AddDays(3), EndDate = nodes[5].StartDate.AddDays(5), Resources = "dylan", PercentComplete = 75d }, new ExampleGanttNode { TaskName = "Sub MyTask 4", StartDate = nodes[5].StartDate.AddDays(5), EndDate = nodes[5].StartDate.AddDays(1), Resources = "missy", PercentComplete = 100d } }; gantt.Nodes = nodes; }
private void LoadData() { int pageCount = 0; string filter = ""; string years = ""; string months = ""; loadbar.Start(); int sType = 0; string sValue = ""; string selectedType = treeOrganization.sType; if (!string.IsNullOrEmpty(selectedType)) { switch (selectedType) { case "Company": sType = 0; break; case "Department": sType = 1; break; case "Post": sType = 2; break; } sValue = treeOrganization.sValue; } else { loadbar.Stop(); //if (frist) frist = false; else Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), "PLEASESELECT"); return; } System.Collections.ObjectModel.ObservableCollection <string> paras = new System.Collections.ObjectModel.ObservableCollection <string>(); TextBox txtName = Utility.FindChildControl <TextBox>(expander, "employeeName"); ComboBox cbxPaystate = Utility.FindChildControl <ComboBox>(expander, "cbxPayState"); NumericUpDown nudyears = Utility.FindChildControl <NumericUpDown>(expander, "years"); NumericUpDown nudmonths = Utility.FindChildControl <NumericUpDown>(expander, "months"); if (nudyears != null && nudmonths != null) { years = nudyears.Value.ToString(); months = nudmonths.Value.ToString(); } else { years = System.DateTime.Now.Year.ToString(); months = System.DateTime.Now.Month.ToString(); } if (txtName != null && !string.IsNullOrEmpty(txtName.Text.Trim())) { filter += "EMPLOYEENAME==@" + paras.Count().ToString(); paras.Add(txtName.Text.Trim()); } if (cbxPaystate != null && cbxPaystate.SelectedIndex > 0) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "PAYCONFIRM==@" + paras.Count().ToString(); paras.Add((cbxPaystate.SelectedIndex - 1).ToString()); } if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "CHECKSTATE==@" + paras.Count().ToString(); paras.Add(CHECKSTATEED.ToString()); client.GetPaymentPagingsAsync(dataPager.PageIndex, dataPager.PageSize, "EMPLOYEESALARYRECORDID", filter, paras, pageCount, years, months, sType, sValue, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID); }
/// <summary> /// Default constructor. Protected due to required properties, but present because EF needs it. /// </summary> protected UParentRequired() { UChildCollection = new System.Collections.ObjectModel.ObservableCollection <UChild>(); Init(); }
//<summary> //选择当前员工的请假类型 //</summary> //<param name="sender"></param> //<param name="e"></param> private void lkLeaveTypeName_FindClick(object sender, EventArgs e) { Dictionary <string, string> cols = new Dictionary <string, string>(); cols.Add("LEAVETYPENAME", "LEAVETYPENAME"); cols.Add("ISFREELEAVEDAY", "ISFREELEAVEDAY,ISCHECKED,DICTIONARYCONVERTER"); string filter = ""; System.Collections.ObjectModel.ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); filter += " ISFREELEAVEDAY=@" + paras.Count().ToString() + ""; paras.Add("2"); LookupForm lookup = new LookupForm(SMT.Saas.Tools.OrganizationWS.EntityNames.LeaveTypeSet, typeof(SMT.Saas.Tools.AttendanceWS.T_HR_LEAVETYPESET[]), cols, filter, paras); lookup.SelectedClick += (o, ev) => { SMT.Saas.Tools.AttendanceWS.T_HR_LEAVETYPESET ent = lookup.SelectedObj as SMT.Saas.Tools.AttendanceWS.T_HR_LEAVETYPESET; if (ent != null) { if (ent.SEXRESTRICT != "2") { if (ent.SEXRESTRICT != tbEmpSex.Text) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("EMPLOYEELEAVERECORD"), Utility.GetResourceStr("LEAVETYPERESTRICT", "SEXRESTRICT")); return; } } if (!string.IsNullOrEmpty(ent.POSTLEVELRESTRICT)) { decimal dlevel = 0, dCheckLevel = 0; //decimal.TryParse(tbEmpLevel.Text, out dlevel); decimal.TryParse(ent.POSTLEVELRESTRICT, out dCheckLevel); if (dlevel > dCheckLevel) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("EMPLOYEELEAVERECORD"), Utility.GetResourceStr("LEAVETYPERESTRICT", "POSTLEVELRESTRICT")); return; } } //LeaveRecord = new Saas.Tools.AttendanceWS.T_HR_EMPLOYEELEAVERECORD(); //LeaveRecord.T_HR_LEAVETYPESET = ent; this.lkLeaveTypeName.DataContext = ent; strleaveType = ent.LEAVETYPESETID; if (ent.FINETYPE == (Convert.ToInt32(LeaveFineType.Free) + 1).ToString() || ent.FINETYPE == (Convert.ToInt32(LeaveFineType.Deduct) + 1).ToString()) { //toolbar1.IsEnabled = false; //toolbar1.Visibility = System.Windows.Visibility.Collapsed; //dgLevelDayList.Visibility = System.Windows.Visibility.Collapsed; } } }; lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }); }
void LoadDocTypeInfos() { int pageCount = 0; string filter = ""; //查询过滤条件 string StrName = ""; string StrRecord = ""; string StrStart = ""; string StrEnd = ""; string StrTypeFlag = ""; //文档类型 StrStart = dpStart.Text.ToString(); StrEnd = dpEnd.Text.ToString(); DateTime DtStart = new DateTime(); DateTime DtEnd = new DateTime(); StrRecord = this.cbxIsSave.SelectedIndex.ToString(); StrName = this.txtDocType.Text.Trim().ToString(); switch (this.cbxIsSave.SelectedIndex) { case 0: break; case 1: StrTypeFlag ="1"; break; case 2: StrTypeFlag ="0"; break; } ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>(); //参数值 if (!string.IsNullOrEmpty(StrStart) && string.IsNullOrEmpty(StrEnd)) { //Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("WARING"), Utility.GetResourceStr("ENDTIMENOTNULL")); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ENDTIMENOTNULL"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); return; } if (string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd)) { //Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("WARING"), Utility.GetResourceStr("MEETINGSTARTTIMENOTNULL")); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STARTTIMENOTNULL"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); 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.Caution, Utility.GetResourceStr("WARING"), Utility.GetResourceStr("ERRORSTARTDATEGTENDDATE")); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORSTARTDATEGTENDDATE"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); return; } else { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "CREATEDATE >=@" + paras.Count().ToString();//开始时间 paras.Add(DtStart); filter += " and "; filter += "CREATEDATE <=@" + paras.Count().ToString();//结束时间 paras.Add(DtEnd); } } //if (!string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd)) //{ // DtStart = System.Convert.ToDateTime(StrStart); // DtEnd = System.Convert.ToDateTime(StrEnd); // if (DtStart > DtEnd) // { // //MessageBox.Show("开始时间不能大于结束时间"); // Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARING"), Utility.GetResourceStr("MEETINGSTARTTIMENOTNULL")); // return; // } // else // { // } //} if (!string.IsNullOrEmpty(StrName)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "SENDDOCTYPE ^@" + paras.Count().ToString();//类型名称 paras.Add(StrName); } if(!string.IsNullOrEmpty(StrTypeFlag)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "OPTFLAG ==@" + paras.Count().ToString();//类型名称 paras.Add(StrTypeFlag); } 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; loadbar.Start(); //client.GetLendingListByUserIdAsync(dataPager.PageIndex, dataPager.PageSize, "archivesLending.CREATEDATE", filter, paras, pageCount, checkState, loginUserInfo); start = DateTime.Now; BumfClient.GetDocTypeInfosListBySearchAsync(dataPager.PageIndex, dataPager.PageSize, "CREATEDATE descending", filter, paras, pageCount, loginUserInfo); }
public TableMetadata(string name, string schema, string description, bool isNewDescription) : base(name, schema, description, isNewDescription) { Columns = new ObservableCollection <ColumnMetaData>(); }
/// <summary> /// Use this to supply a ReadOnly ObservableCollection for view lists etc. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="list"></param> /// <param name="eq"></param> /// <returns></returns> public static ReadOnlyObservableCollection <T> CreateObservableCollection <T>(this ICompositeList <T> list, IEqualityComparer <T> eq) { var collection = new System.Collections.ObjectModel.ObservableCollection <T>(); return(new ReadOnlyObservableCollection <T>(list, collection, eq)); }
private void InitData() { int pageCount = 0; string filter = ""; //查询过滤条件 ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); //参数值 if (Common.CurrentLoginUserInfo != null) { if (!string.IsNullOrEmpty(Common.CurrentLoginUserInfo.UserPosts[0].CompanyID)) { filter += "(q.VIEWER =@" + paras.Count().ToString(); paras.Add(Common.CurrentLoginUserInfo.UserPosts[0].CompanyID); } if (!string.IsNullOrEmpty(Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID)) { if (!string.IsNullOrEmpty(filter)) { filter += " or "; } filter += "q.VIEWER =@" + paras.Count().ToString(); paras.Add(Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID); } if (!string.IsNullOrEmpty(Common.CurrentLoginUserInfo.UserPosts[0].PostID)) { if (!string.IsNullOrEmpty(filter)) { filter += " or "; } filter += "q.VIEWER =@" + paras.Count().ToString(); paras.Add(Common.CurrentLoginUserInfo.UserPosts[0].PostID); } if (!string.IsNullOrEmpty(Common.CurrentLoginUserInfo.EmployeeID)) { if (!string.IsNullOrEmpty(filter)) { filter += " or "; } filter += "q.VIEWER =@" + paras.Count().ToString() + ")"; paras.Add(Common.CurrentLoginUserInfo.EmployeeID); } } if (!string.IsNullOrEmpty(txtUptown.Text.Trim())) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "l.m.COMMUNITY ^@" + paras.Count().ToString(); paras.Add(txtUptown.Text.Trim()); } if (!string.IsNullOrEmpty(txtHouseName.Text.Trim())) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "l.m.HOUSENAME ^@" + paras.Count().ToString(); paras.Add(txtHouseName.Text.Trim()); } loadbar.Start(); SMT.SaaS.OA.UI.SmtOACommonAdminService.LoginUserInfo loginUserInfo = new SMT.SaaS.OA.UI.SmtOACommonAdminService.LoginUserInfo(); if (string.IsNullOrEmpty(loginUserInfo.companyID)) { Utility.GetLoginUserInfo(loginUserInfo); } client.GetHireAppHouseListPagingAsync(dataPager.PageIndex, dataPager.PageSize, "CREATEDATE", filter, paras, pageCount, loginUserInfo); }
/// <summary> /// 保存 /// </summary> /// <returns>保存结果</returns> public bool Save() { RefreshUI(RefreshedTypes.ProgressBar); if (EmployeeAddsumInfoList.Count == 0) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("MUSTSEPARATOR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); RefreshUI(RefreshedTypes.ProgressBar); return(false); } if (combProtectType.SelectedIndex == -1) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("加扣款类型不能为空"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); RefreshUI(RefreshedTypes.ProgressBar); return(false); } if (FormType == FormTypes.New) { System.Collections.ObjectModel.ObservableCollection <T_HR_EMPLOYEEADDSUM> eaddsum = new System.Collections.ObjectModel.ObservableCollection <T_HR_EMPLOYEEADDSUM>(); // List <V_EmployeeAddsumView> infoList = new List <V_EmployeeAddsumView>(); infoList.AddRange(EmployeeAddsumInfoList); //添加删除的员工加扣款 infoList.AddRange(EmployeeAddsumDelList); foreach (var admSum in infoList) { if (admSum.PROJECTCODE != "del") { //不是删除的则做数据校验 if (admSum.PROJECTMONEY == 0 || isZore()) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("输入的金额不能为0"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); RefreshUI(RefreshedTypes.ProgressBar); return(false); } if (admSum.PROJECTMONEY == null) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("请输入正确的金额"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); RefreshUI(RefreshedTypes.ProgressBar); return(false); } } T_HR_EMPLOYEEADDSUM EmployeeAddSumNew = new T_HR_EMPLOYEEADDSUM(); //EmployeeAddSumNew.PROJECTNAME = admSum.PROJECTNAME; EmployeeAddSumNew.PROJECTMONEY = admSum.PROJECTMONEY; EmployeeAddSumNew.SYSTEMTYPE = combProtectType.SelectedIndex.ToString(); EmployeeAddSumNew.DEALYEAR = numYear.Value.ToString(); EmployeeAddSumNew.DEALMONTH = numMonth.Value.ToString(); EmployeeAddSumNew.ADDSUMID = admSum.ADDSUMID; EmployeeAddSumNew.EMPLOYEEID = admSum.EMPLOYEEID; EmployeeAddSumNew.EMPLOYEECODE = admSum.EMPLOYEECODE; //string employeeName = admSum.EMPLOYEENAME.Split('-')[0]; EmployeeAddSumNew.EMPLOYEENAME = admSum.EMPLOYEENAME; EmployeeAddSumNew.CREATEDATE = System.DateTime.Now; EmployeeAddSumNew.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; EmployeeAddSumNew.CREATECOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; EmployeeAddSumNew.CREATEDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; EmployeeAddSumNew.CREATEPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID; EmployeeAddSumNew.CHECKSTATE = Convert.ToInt32(CheckStates.UnSubmit).ToString(); EmployeeAddSumNew.OWNERCOMPANYID = admSum.OWNERCOMPANYID; EmployeeAddSumNew.OWNERDEPARTMENTID = admSum.OWNERDEPARTMENTID; EmployeeAddSumNew.OWNERID = admSum.OWNERID; EmployeeAddSumNew.OWNERPOSTID = admSum.OWNERPOSTID; EmployeeAddSumNew.PROJECTCODE = admSum.PROJECTCODE; EmployeeAddSumNew.REMARK = admSum.REMARK; eaddsum.Add(EmployeeAddSumNew); } //只提交第一个 EmployeeAddSum = eaddsum.FirstOrDefault(); client.EmployeeAddSumLotsofADDAsync(eaddsum); } else { initAddSum("2"); if (EmployeeAddSum.PROJECTMONEY == 0 || EmployeeAddSum.PROJECTMONEY == null || isZore()) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("加扣款金额不能为0"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); RefreshUI(RefreshedTypes.ProgressBar); return(false); } EmployeeAddSum.UPDATEDATE = System.DateTime.Now; EmployeeAddSum.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; client.EmployeeAddSumUpdateAsync(EmployeeAddSum, "Edit"); } return(true); }
/// <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(); } }
/// <summary> /// 加载地区差异补贴 /// </summary> private void BindAreaAllowanceData() { string solutionId = string.Empty; if (cmbSolution.SelectedItem != null) { solutionsObj = cmbSolution.SelectedItem as T_OA_TRAVELSOLUTIONS; solutionId = solutionsObj.TRAVELSOLUTIONSID; } int pageCount = 0; allowanceList = new ObservableCollection <T_OA_AREAALLOWANCE>(); List <T_OA_AREAALLOWANCE> temp = new List <T_OA_AREAALLOWANCE>(); System.Collections.ObjectModel.ObservableCollection <string> paras = new System.Collections.ObjectModel.ObservableCollection <string>(); if (PostLevelDicts != null) { if (areaAllowance != null) { var ents = from c in PostLevelDicts join b in areaAllowance on c.DICTIONARYVALUE.ToString() equals b.POSTLEVEL into d from b in d.DefaultIfEmpty() //where b.T_OA_TRAVELSOLUTIONS.TRAVELSOLUTIONSID == solutionId select new T_OA_AREAALLOWANCE { //ALLOWANCE = b == null ? null : b.ALLOWANCE, ACCOMMODATION = b == null ? null : b.ACCOMMODATION, TRANSPORTATIONSUBSIDIES = b == null ? null : b.TRANSPORTATIONSUBSIDIES, MEALSUBSIDIES = b == null ? null : b.MEALSUBSIDIES, OVERSEASSUBSIDIES = b == null ? null : b.OVERSEASSUBSIDIES, POSTLEVEL = c.DICTIONARYNAME, AREAALLOWANCEID = b == null?Guid.NewGuid().ToString() : b.AREAALLOWANCEID, CREATEUSERID = b == null ? null : b.CREATEUSERID }; if (ents != null && ents.Count() > 0) { temp = Pager(ents.AsQueryable(), 0, 100, ref pageCount); DtGrid.ItemsSource = temp; } //dataPager.PageCount = pageCount; } else { var ents = from c in PostLevelDicts //join b in areaAllowance on c.DICTIONARYNAME equals b.POSTLEVEL into d //from b in d.DefaultIfEmpty() select new T_OA_AREAALLOWANCE { //ALLOWANCE = null, POSTLEVEL = c.DICTIONARYNAME, AREAALLOWANCEID = Guid.NewGuid().ToString(), CREATEUSERID = null }; temp = Pager(ents.AsQueryable(), 0, 100, ref pageCount); DtGrid.ItemsSource = temp; } foreach (T_OA_AREAALLOWANCE tmp in temp) { tmp.T_OA_AREADIFFERENCE = new T_OA_AREADIFFERENCE(); tmp.T_OA_AREADIFFERENCE.AREADIFFERENCEID = AreaID; if (string.IsNullOrEmpty(tmp.CREATEUSERID)) { tmp.CREATEUSERID = SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; tmp.CREATEDATE = System.DateTime.Now; } else { tmp.UPDATEUSERID = SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; tmp.UPDATEDATE = System.DateTime.Now; } allowanceList.Add(tmp); } } }
/// <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(); }
/// <summary> /// 获取派车单数据 1 /// </summary> /// <param name="pageIndex"></param> /// <param name="checkState"></param> private void GetData() { loadbar.Start(); int pageCount = 0; string filter = ""; //查询过滤条件 ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); //参数值 if (IsQuery) { string StrTitle = ""; string StrStart = ""; string StrEnd = ""; StrStart = dpStart.Text.ToString(); StrEnd = dpEnd.Text.ToString(); DateTime DtStart = new DateTime(); DateTime DtEnd = new DateTime(); StrTitle = this.txtRoute.Text.ToString().Trim(); if (!string.IsNullOrEmpty(StrStart) && string.IsNullOrEmpty(StrEnd)) { Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARING"), Utility.GetResourceStr("ENDTIMENOTNULL")); //MessageBox.Show("结束时间不能为空"); return; } if (string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd)) { Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARING"), Utility.GetResourceStr("MEETINGSTARTTIMENOTNULL")); //MessageBox.Show("开始时间不能为空"); 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("WARING"), Utility.GetResourceStr("ERRORSTARTDATEGTENDDATE")); return; } else { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "STARTTIME >=@" + paras.Count().ToString();//开始时间 paras.Add(DtStart); filter += " and "; filter += "STARTTIME <=@" + paras.Count().ToString();//结束时间 paras.Add(DtEnd); } } if (!string.IsNullOrEmpty(StrTitle)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "ROUTE ^@" + paras.Count().ToString();//类型名称 paras.Add(StrTitle); } } SMT.SaaS.OA.UI.SmtOACommonAdminService.LoginUserInfo loginUserInfo = new SMT.SaaS.OA.UI.SmtOACommonAdminService.LoginUserInfo(); loginUserInfo.companyID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; loginUserInfo.userID = Common.CurrentLoginUserInfo.EmployeeID; vehicleDispatchManager.Gets_VDInfoAsync(dataPager.PageIndex, dataPager.PageSize, "UPDATEDATE", filter, paras, pageCount, checkState, loginUserInfo); }
private void GetData() { int pageCount = 0; string filter = ""; //查询过滤条件 ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); //参数值 string strChargeCode = string.Empty, strDateStart = string.Empty, strDateEnd = string.Empty; strChargeCode = txtCode.Text.ToString(); if (dpStart.SelectedDate != null) { strDateStart = dpStart.SelectedDate.Value.ToString("yyyy-MM-dd"); } if (dpEnd.SelectedDate != null) { strDateEnd = dpEnd.SelectedDate.Value.ToString(); } if (!string.IsNullOrEmpty(strChargeCode)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "@" + paras.Count().ToString() + ".Contains(BORROWAPPLYMASTERCODE) "; //费用申请单编号 paras.Add(strChargeCode); } if (lkOrg.DataContext != null) { SMT.FBAnalysis.UI.CommonTools.MultiValuesItem <ExtOrgObj> mutilValues = lkOrg.SelectItem as SMT.FBAnalysis.UI.CommonTools.MultiValuesItem <ExtOrgObj>; if (mutilValues != null) { Dictionary <OrgTreeItemTypes, string> dictTypes = new Dictionary <OrgTreeItemTypes, string>(); dictTypes.Add(OrgTreeItemTypes.Company, "OWNERCOMPANYID"); dictTypes.Add(OrgTreeItemTypes.Department, "OWNERDEPARTMENTID"); dictTypes.Add(OrgTreeItemTypes.Personnel, "OWNERID"); dictTypes.Add(OrgTreeItemTypes.Post, "OWNERPOSTID"); if (!string.IsNullOrEmpty(filter)) { filter += " AND "; } filter += " ("; for (int i = 0; i < mutilValues.Values.Count(); i++) { if (i > 0 && i < mutilValues.Values.Count() - 1) { filter += " OR "; } ExtOrgObj item = mutilValues.Values[i]; string propertyName = dictTypes[item.ObjectType]; string strOrgID = item.ObjectID; filter += propertyName + " ==@" + paras.Count().ToString(); paras.Add(strOrgID); } ; filter += " )"; } } strOwnerID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; loadbar.Start(); client.GetBorrowApplyMasterListByMultSearchAsync(strOwnerID, strDateStart, strDateEnd, checkState, filter, paras, "UPDATEDATE DESC", dataPager.PageIndex, dataPager.PageSize, pageCount); }
private static System.Collections.ObjectModel.ObservableCollection <object> Get_tabControl_Items() { System.Collections.ObjectModel.ObservableCollection <object> items = new System.Collections.ObjectModel.ObservableCollection <object>(); // e_1 element TabItem e_1 = new TabItem(); e_1.Name = "e_1"; e_1.Header = "TabItem"; // e_2 element Grid e_2 = new Grid(); e_1.Content = e_2; e_2.Name = "e_2"; e_2.Background = new SolidColorBrush(new ColorW(51, 51, 51, 255)); // groupBox element GroupBox groupBox = new GroupBox(); e_2.Children.Add(groupBox); groupBox.Name = "groupBox"; groupBox.Height = 200F; groupBox.Width = 200F; groupBox.Margin = new Thickness(10F, 10F, 0F, 0F); groupBox.HorizontalAlignment = HorizontalAlignment.Left; groupBox.VerticalAlignment = VerticalAlignment.Top; groupBox.Header = "Window"; // e_3 element Grid e_3 = new Grid(); groupBox.Content = e_3; e_3.Name = "e_3"; // CmbResolutionSetting element ComboBox CmbResolutionSetting = new ComboBox(); e_3.Children.Add(CmbResolutionSetting); CmbResolutionSetting.Name = "CmbResolutionSetting"; CmbResolutionSetting.Height = 31F; CmbResolutionSetting.Width = 180F; CmbResolutionSetting.Margin = new Thickness(4F, 0F, 0F, 0F); CmbResolutionSetting.HorizontalAlignment = HorizontalAlignment.Left; CmbResolutionSetting.VerticalAlignment = VerticalAlignment.Top; Binding binding_CmbResolutionSetting_ItemsSource = new Binding("DisplayedResolutions"); binding_CmbResolutionSetting_ItemsSource.Mode = BindingMode.TwoWay; CmbResolutionSetting.SetBinding(ComboBox.ItemsSourceProperty, binding_CmbResolutionSetting_ItemsSource); // checkBox element CheckBox checkBox = new CheckBox(); e_3.Children.Add(checkBox); checkBox.Name = "checkBox"; checkBox.Margin = new Thickness(5F, 35F, 5F, 0F); checkBox.VerticalAlignment = VerticalAlignment.Top; checkBox.Content = "Fullscreen"; Binding binding_checkBox_IsChecked = new Binding("Fullscreen"); binding_checkBox_IsChecked.Mode = BindingMode.TwoWay; checkBox.SetBinding(CheckBox.IsCheckedProperty, binding_checkBox_IsChecked); // BtnApplyVideoSettings element Button BtnApplyVideoSettings = new Button(); e_2.Children.Add(BtnApplyVideoSettings); BtnApplyVideoSettings.Name = "BtnApplyVideoSettings"; BtnApplyVideoSettings.Height = 50F; BtnApplyVideoSettings.Width = 200F; BtnApplyVideoSettings.Margin = new Thickness(0F, 0F, 10F, 10F); BtnApplyVideoSettings.HorizontalAlignment = HorizontalAlignment.Right; BtnApplyVideoSettings.VerticalAlignment = VerticalAlignment.Bottom; BtnApplyVideoSettings.Content = "Apply"; Binding binding_BtnApplyVideoSettings_Command = new Binding("VideoSettingsApplyCommand"); BtnApplyVideoSettings.SetBinding(Button.CommandProperty, binding_BtnApplyVideoSettings_Command); // BtnBackToMainmenu element Button BtnBackToMainmenu = new Button(); e_2.Children.Add(BtnBackToMainmenu); BtnBackToMainmenu.Name = "BtnBackToMainmenu"; BtnBackToMainmenu.Height = 50F; BtnBackToMainmenu.Width = 200F; BtnBackToMainmenu.Margin = new Thickness(10F, 0F, 0F, 10F); BtnBackToMainmenu.HorizontalAlignment = HorizontalAlignment.Left; BtnBackToMainmenu.VerticalAlignment = VerticalAlignment.Bottom; BtnBackToMainmenu.Content = "Back"; Binding binding_BtnBackToMainmenu_Command = new Binding("BackButtonCommand"); BtnBackToMainmenu.SetBinding(Button.CommandProperty, binding_BtnBackToMainmenu_Command); items.Add(e_1); return(items); }
private void LoadData() { int pageCount = 0; string filter = ""; //查询过滤条件 ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); //参数值 //checkState = //if (!string.IsNullOrEmpty(StrTitle)) //{ // IsNull = true; // if (!string.IsNullOrEmpty(filter)) // { // filter += " and "; // } // filter += "OACompanySendDoc.SENDDOCTITLE ^@" + paras.Count().ToString();//标题名称 // paras.Add(StrTitle); //} if (checkState != "2") { filter += "HouseRecordObj.ISSETTLEMENT ^@" + paras.Count().ToString();//标题名称 paras.Add(checkState); } SMT.SaaS.OA.UI.SmtOACommonAdminService.LoginUserInfo loginUserInfo = new SMT.SaaS.OA.UI.SmtOACommonAdminService.LoginUserInfo(); if (string.IsNullOrEmpty(loginUserInfo.companyID)) { //Utility.GetLoginUserInfo(loginUserInfo); loginUserInfo.companyID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; loginUserInfo.userID = Common.CurrentLoginUserInfo.EmployeeID; loginUserInfo.departmentID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; } if (!string.IsNullOrEmpty(txtUptown.Text.Trim())) { filter += "houseInfoObj.UPTOWN^@" + paras.Count().ToString(); paras.Add(txtUptown.Text.Trim()); } if (!string.IsNullOrEmpty(txtHouseName.Text.Trim())) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "houseInfoObj.HOUSENAME^@" + paras.Count().ToString(); paras.Add(txtHouseName.Text.Trim()); } string StrStart = ""; string StrEnd = ""; StrStart = dpStart.Text.ToString(); StrEnd = dpEnd.Text.ToString(); DateTime DtStart = new DateTime(); DateTime DtEnd = new DateTime(); if (!string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd)) { DtStart = System.Convert.ToDateTime(StrStart); DtEnd = System.Convert.ToDateTime(StrEnd + " 23:59:59"); if (DtStart > DtEnd) { //MessageBox.Show("开始时间不能大于结束时间"); Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("SEARCH"), Utility.GetResourceStr("STARTTIMENOTGREATENDTIME")); return; } else { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "houseAppObj.STARTDATE >=@" + paras.Count().ToString(); paras.Add(DtStart); if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "houseAppObj.STARTDATE <=@" + paras.Count().ToString(); paras.Add(DtEnd); } } loadbar.Start(); client.GetHireRecordListPagingAsync(dataPager.PageIndex, dataPager.PageSize, "HouseRecordObj.CREATEDATE descending", filter, paras, pageCount, checkState, loginUserInfo); }
void LoadMeetingInfos() { string StrTitle = ""; string StrType = ""; string StrDepartment = ""; string StrContent = ""; string StrStart = ""; string StrEnd = ""; int pageCount = 0; string filter = ""; //查询过滤条件 ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); //参数值 if (checkState == ((int)CheckStates.UnSubmit).ToString()) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "meetinginfo.OWNERID==@" + paras.Count().ToString(); paras.Add(Common.CurrentLoginUserInfo.EmployeeID); } if (IsQueryBtn) { StrTitle = txtMeetingTitle.Text.Trim().ToString(); if (cbMeetingType.SelectedIndex > 0) //if (cbMeetingType.SelectedItem.ToString() != "请选择") { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } StrType = ((cbMeetingType.SelectedItem) as T_OA_MEETINGTYPE).MEETINGTYPE.ToString(); filter += "meetingtype.meetingtype ==@" + paras.Count().ToString(); paras.Add(StrType); } if (!string.IsNullOrEmpty(StrTitle)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "meetinginfo.MEETINGTITLE ^@" + paras.Count().ToString(); paras.Add(StrTitle); } StrStart = dpStart.Text.ToString(); StrEnd = dpEnd.Text.ToString(); DateTime DtStart = new DateTime(); DateTime DtEnd = new DateTime(); if (!string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd)) { DtStart = System.Convert.ToDateTime(StrStart); DtEnd = System.Convert.ToDateTime(StrEnd + " 23:59:59"); if (DtStart > DtEnd) { //MessageBox.Show("开始时间不能大于结束时间"); Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("SEARCH"), Utility.GetResourceStr("STARTTIMENOTGREATENDTIME")); return; } else { if (!string.IsNullOrEmpty(filter)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "meetinginfo.CREATEDATE >=@" + paras.Count().ToString(); paras.Add(DtStart); if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "meetinginfo.CREATEDATE <=@" + paras.Count().ToString(); paras.Add(DtEnd); } } } } else { if (!string.IsNullOrEmpty(StrStart) && string.IsNullOrEmpty(StrEnd))//选择了开始时间 { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "meetinginfo.CREATEDATE >=@" + paras.Count().ToString(); paras.Add(System.Convert.ToDateTime(StrStart)); } if (string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd))//选择了结束时间 { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "meetinginfo.CREATEDATE <=@" + paras.Count().ToString(); paras.Add(System.Convert.ToDateTime(StrEnd)); } } 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; loadbar.Start(); MeetingClient.GetMeetingInfoListByFlowAsync(dataPager.PageIndex, dataPager.PageSize, "meetinginfo.CREATEDATE descending", filter, paras, pageCount, checkState, loginUserInfo); }
private void LoadData() { loadbar.Start(); int pageCount = 0; string filter = ""; string strState = ""; DateTime?starttimes; DateTime?endtimes = DateTime.Now.Date; if (DateTime.Now.Month <= 2) { starttimes = new DateTime(DateTime.Now.Year - 1, 1, 1); } else { starttimes = new DateTime(DateTime.Now.Year, DateTime.Now.Month - 2, 1); } DatePicker dpstarttimes = Utility.FindChildControl <DatePicker>(expander, "dpstarttime"); DatePicker dpendtimes = Utility.FindChildControl <DatePicker>(expander, "dpendtime"); System.Collections.ObjectModel.ObservableCollection <string> paras = new System.Collections.ObjectModel.ObservableCollection <string>(); TextBox txtName = Utility.FindChildControl <TextBox>(expander, "txtName"); NumericUpDown nudyears = Utility.FindChildControl <NumericUpDown>(expander, "Nuyear"); NumericUpDown nudmonths = Utility.FindChildControl <NumericUpDown>(expander, "NuMounth"); try { starttimes = dpstarttimes.SelectedDate; endtimes = dpendtimes.SelectedDate; if (starttimes > endtimes) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("开始时间不能小于结束时间"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); // Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("开始时间不能小于结束时间")); return; } } catch (Exception ex) { ex.Message.ToString(); } if (txtName != null && !string.IsNullOrEmpty(txtName.Text.Trim())) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } //filter += "EMPLOYEENAME==@" + paras.Count().ToString(); filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEENAME)"; paras.Add(txtName.Text.Trim()); } if (Checkstate != Convert.ToInt32(CheckStates.All).ToString()) { strState = Checkstate; } if (nudyears != null) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "SALARYYEAR==@" + paras.Count().ToString(); paras.Add(nudyears.Value.ToString()); } if (nudmonths != null) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "SALARYMONTH==@" + paras.Count().ToString(); paras.Add(nudmonths.Value.ToString()); } client.GetPerformanceRewardRecordWithPagingAsync(dataPager.PageIndex, dataPager.PageSize, "PERFORMANCEREWARDRECORDID", filter, paras, pageCount, Convert.ToDateTime(starttimes), Convert.ToDateTime(endtimes), SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, strState); }
/// <summary> /// Default constructor /// </summary> public Master() { Children = new System.Collections.ObjectModel.ObservableCollection <Child>(); Init(); }
private void LoadData(string id) { //int pageCount = 0; System.Collections.ObjectModel.ObservableCollection <string> paras = new System.Collections.ObjectModel.ObservableCollection <string>(); client.GetCustomGuerdonAsync(id); }
//加载数据 private void GetData() { loadbar.Start(); int pageCount = 0; string filter = ""; //查询过滤条件 ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); //参数值 if (IsQuery) { string StrContent = ""; string StrStart = ""; string StrEnd = ""; string StrConservateType = ((SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY)cmbConserVationName.SelectedItem).DICTIONARYNAME.ToString(); StrStart = dpStart.Text.ToString(); StrEnd = dpEnd.Text.ToString(); DateTime DtStart = new DateTime(); DateTime DtEnd = new DateTime(); StrContent = this.txtConserVationContent.Text.ToString().Trim(); if (!string.IsNullOrEmpty(StrStart) && string.IsNullOrEmpty(StrEnd)) { Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARING"), Utility.GetResourceStr("ENDTIMENOTNULL")); //MessageBox.Show("结束时间不能为空"); return; } if (string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd)) { Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARING"), Utility.GetResourceStr("MEETINGSTARTTIMENOTNULL")); //MessageBox.Show("开始时间不能为空"); 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("WARING"), Utility.GetResourceStr("ERRORSTARTDATEGTENDDATE")); return; } else { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "REPAIRDATE >=@" + paras.Count().ToString();//开始时间 paras.Add(DtStart); filter += " and "; filter += "REPAIRDATE <=@" + paras.Count().ToString();//结束时间 paras.Add(DtEnd); } } if (cmbConserVationName.SelectedIndex > 0) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "MAINTENANCETYPE ==@" + paras.Count().ToString();//类型 paras.Add(StrConservateType); } if (!string.IsNullOrEmpty(StrContent)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "CONTENT ^@" + paras.Count().ToString();//类型名称 paras.Add(StrContent); } } maWS.GetMaintenanceAppListAsync(dataPager.PageIndex, dataPager.PageSize, "UPDATEDATE", filter, paras, pageCount, Common.CurrentLoginUserInfo.UserPosts[0].CompanyID, Common.CurrentLoginUserInfo.EmployeeID, checkState); }
private void LoadSalaryRecordData() { loadbar.Start(); int pageCount = 0; itemsAll.Clear(); string filter = ""; int sType = 0; string sValue = ""; list = null; string years = ""; string months = ""; loadbar.Start(); DateTime?starttimes; DateTime?endtimes = DateTime.Now.Date; if (DateTime.Now.Month <= 2) { starttimes = new DateTime(DateTime.Now.Year - 1, 1, 1); } else { starttimes = new DateTime(DateTime.Now.Year, DateTime.Now.Month - 2, 1); } DtGrid.RowDetailsVisibilityMode = DataGridRowDetailsVisibilityMode.Collapsed; string selectedType = treeOrganization.sType; if (!string.IsNullOrEmpty(selectedType)) { switch (selectedType) { case "Company": sType = 0; break; case "Department": sType = 1; break; case "Post": sType = 2; break; } sValue = treeOrganization.sValue; } else { loadbar.Stop(); //if (frist) frist = false; else Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), "PLEASESELECT"); return; } System.Collections.ObjectModel.ObservableCollection <string> paras = new System.Collections.ObjectModel.ObservableCollection <string>(); TextBox txtName = Utility.FindChildControl <TextBox>(expander, "employeeName"); ComboBox cbxPaystate = Utility.FindChildControl <ComboBox>(expander, "cbxPayState"); NumericUpDown nudyears = Utility.FindChildControl <NumericUpDown>(expander, "years"); NumericUpDown nudmonths = Utility.FindChildControl <NumericUpDown>(expander, "months"); if (nudyears != null && nudmonths != null) { years = nudyears.Value.ToString(); months = nudmonths.Value.ToString(); } else { years = System.DateTime.Now.Year.ToString(); months = System.DateTime.Now.Month.ToString(); } try { starttimes = new DateTime(nudyears.Value.ToInt32(), nudmonths.Value.ToInt32(), 1); endtimes = new DateTime(nudyears.Value.ToInt32(), nudmonths.Value.ToInt32(), DateTime.DaysInMonth(nudyears.Value.ToInt32(), nudmonths.Value.ToInt32())); //if (nudmonths.Value.ToInt32() == 12) endtimes = new DateTime(nudyears.Value.ToInt32() + 1, 1, 1); else endtimes = new DateTime(nudyears.Value.ToInt32(), nudmonths.Value.ToInt32(), 1); } catch (Exception ex) { ex.Message.ToString(); } if (txtName != null && !string.IsNullOrEmpty(txtName.Text.Trim())) { //filter += "EMPLOYEENAME==@" + paras.Count().ToString(); //filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEENAME)"; filter += " EMPLOYEENAME.Contains(@" + paras.Count().ToString() + ")"; paras.Add(txtName.Text.Trim()); } if (cbxPaystate != null && cbxPaystate.SelectedIndex >= 0) { if (cbxPaystate.SelectedIndex == 2 || cbxPaystate.SelectedIndex == 0) { _ImgButtonSalaryPaidConfirm.Visibility = System.Windows.Visibility.Collapsed; } else { _ImgButtonSalaryPaidConfirm.Visibility = System.Windows.Visibility.Visible; } if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "PAYCONFIRM==@" + paras.Count().ToString(); paras.Add(cbxPaystate.SelectedIndex.ToString()); } else { loadbar.Stop(); return; } #region 薪资标准过滤 if (!string.IsNullOrEmpty(salaryStandardid)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "SALARYSTANDARDID==@" + paras.Count().ToString(); paras.Add(salaryStandardid); } //else //{ // loadbar.Stop(); // return; //} #endregion client.GetAutoEmployeeSalaryRecordPagingsAsync(dataPager.PageIndex, dataPager.PageSize, "EMPLOYEESALARYRECORDID", filter, paras, pageCount, Convert.ToDateTime(starttimes), Convert.ToDateTime(endtimes), sType, sValue, CHECKSTATEED.ToString(), SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID); }
private void PlayPlaylist() { var str = this.SelectedEntries.Select((t) => new Track { Id = t.TrackId }); var selectedTracks = new System.Collections.ObjectModel.ObservableCollection<Track>(str); if (selectedTracks != null && selectedTracks.Count() > 0) { this.m_playerManager.PlayTracks(selectedTracks, PlayerMode.Song); } else { var tr = this.Entries.Select((t) => new Track { Id = t.TrackId }); var tracks = new System.Collections.ObjectModel.ObservableCollection<Track>(tr); if (tracks != null && tracks.Count() > 0) { this.m_playerManager.PlayTracks(tracks, PlayerMode.Playlist); } } }
void LoadDocTypeTemplateInfos() { int pageCount = 0; string filter = ""; string StrTitle = ""; //标题 string StrStart = ""; //添加文档的起始时间 string StrEnd = ""; //添加文档的结束时间 string StrGrade = ""; //级别 string StrProritity = ""; //缓急 string StrDocType = ""; //文档类型 bool IsNull = false; //用来控制是否有查询条件 string StrTemplateName = ""; //模板名称 ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); //参数值 StrTitle = this.txtSendDocTitle.Text.Trim().ToString(); StrStart = this.dpStart.Text.Trim().ToString(); StrEnd = this.dpEnd.Text.Trim().ToString(); StrTemplateName = this.txtTemplateName.Text.Trim().ToString(); if (IsQueryBtn) { T_SYS_DICTIONARY GradeObj = cbxGrade.SelectedItem as T_SYS_DICTIONARY; //级别 T_SYS_DICTIONARY ProritityObj = cbxProritity.SelectedItem as T_SYS_DICTIONARY; //缓急 if (this.cbxGrade.SelectedIndex > 0) { StrGrade = GradeObj.DICTIONARYNAME.ToString(); } if (this.cbxProritity.SelectedIndex > 0) { StrProritity = ProritityObj.DICTIONARYNAME.ToString(); } if (this.cbxdoctype.SelectedItem.ToString() != "请选择") { StrDocType = this.cbxdoctype.SelectedItem.ToString(); } if (!string.IsNullOrEmpty(StrTitle)) { IsNull = true; if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "SENDDOCTITLE ^@" + paras.Count().ToString();//标题名称 paras.Add(StrTitle); } if (!string.IsNullOrEmpty(StrTemplateName)) { IsNull = true; if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "TEMPLATENAME ^@" + paras.Count().ToString();//模板名称 paras.Add(StrTemplateName); } if (!string.IsNullOrEmpty(StrProritity)) { IsNull = true; if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "PRIORITIES==@" + paras.Count().ToString();//缓急名称 paras.Add(StrProritity); } if (!string.IsNullOrEmpty(StrDocType)) { IsNull = true; if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "SENDDOCTYPE ^@" + paras.Count().ToString();//类型名称 paras.Add(StrDocType); } if (!string.IsNullOrEmpty(StrGrade)) { IsNull = true; if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "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.Caution, Utility.GetResourceStr("SEARCH"), Utility.GetResourceStr("ENDTIMENOTNULL")); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ENDTIMENOTNULL"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); return; } if (string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd)) { //Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("SEARCH"), Utility.GetResourceStr("STARTTIMENOTNULL")); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STARTTIMENOTNULL"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); 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.Caution, Utility.GetResourceStr("SEARCH"), Utility.GetResourceStr("STARTTIMENOTGREATENDTIME")); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STARTTIMENOTGREATENDTIME"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); return; } else { IsNull = true; if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "CREATEDATE >=@" + paras.Count().ToString(); paras.Add(DtStart); if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "CREATEDATE <=@" + paras.Count().ToString(); paras.Add(DtEnd); } } //if (!IsNull) //{ // Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("SEARCH"), Utility.GetResourceStr("REQUIRED","SEARCH")); // return; //} } 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; loadbar.Start(); DocTypeTemplateClient.GetDocTypeTemplateInfosListBySearchAsync(dataPager.PageIndex, dataPager.PageSize, "CREATEDATE descending", filter, paras, pageCount, "", loginUserInfo); }
private void LoadData() { int pageCount = 0; string filter = ""; //查询过滤条件 ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>(); //参数值 if (!string.IsNullOrEmpty(txtTitle.Text.Trim())) { filter += "ISSUANCETITLE ^@" + paras.Count().ToString(); paras.Add(txtTitle.Text.Trim()); } //if (!string.IsNullOrEmpty(txtContent.Text.Trim())) //{ // if (!string.IsNullOrEmpty(filter)) // { // filter += " and "; // } // filter += "CONTENT ^@" + paras.Count().ToString(); // paras.Add(txtContent.Text.Trim()); //} SMT.SaaS.OA.UI.SmtOACommonAdminService.LoginUserInfo loginUserInfo = new SMT.SaaS.OA.UI.SmtOACommonAdminService.LoginUserInfo(); if (string.IsNullOrEmpty(loginUserInfo.companyID)) { Utility.GetLoginUserInfo(loginUserInfo); } loginUserInfo.companyID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; loginUserInfo.userID = Common.CurrentLoginUserInfo.EmployeeID; loadbar.Start(); client.GetIssunaceListPagingAsync(dataPager.PageIndex, dataPager.PageSize, "CREATEDATE descending", filter, paras, pageCount, checkState, loginUserInfo); }
private void ExecuteAddChequeCommand(object sender) { View.Cheque.UC_ChequeInwardScreen uccheque = sender as View.Cheque.UC_ChequeInwardScreen; ChequeBusinessLogic business; try { ControlValidationStatus validation = ValidateControls.ValidateAllControls(sender); if (validation != null && !validation.isValid) { WPFCustomMessageBox.CustomMessageBox.ShowOK(validation.ValidationMessage, "S360 Application", "OK"); return; } decimal chequeNo = 0; decimal Amt = 0; decimal.TryParse(CurrentChequeInwardModel.ChequeNo, out chequeNo); if (string.IsNullOrEmpty(CurrentChequeInwardModel.ChequeNo) || chequeNo <= 0) { WPFCustomMessageBox.CustomMessageBox.ShowOK("Invalid Cq. No", "Warning", "OK"); S360Controlls.BasicControls.S360TextBox txt = FindVisualChildren <S360Controlls.BasicControls.S360TextBox>(uccheque).Where(S => S.Name == "txtCqNo").FirstOrDefault(); txt.Text = string.Empty; txt.Focus(); return; } if (!decimal.TryParse(CurrentChequeInwardModel.ChqAmount.ToString(), out Amt)) { WPFCustomMessageBox.CustomMessageBox.ShowOK("Invalid Amount", "Warning", "OK"); S360Controlls.BasicControls.S360TextBox txt = FindVisualChildren <S360Controlls.BasicControls.S360TextBox>(uccheque).Where(S => S.Name == "txtAmt").FirstOrDefault(); txt.Text = string.Empty; txt.Focus(); return; } if (Amt <= 0) { WPFCustomMessageBox.CustomMessageBox.ShowOK("Invalid Amount", "Warning", "OK"); S360Controlls.BasicControls.S360TextBox txt = FindVisualChildren <S360Controlls.BasicControls.S360TextBox>(uccheque).Where(S => S.Name == "txtAmt").FirstOrDefault(); txt.Text = string.Empty; txt.Focus(); return; } if (this._chequeList == null) { _chequeList = new ObservableCollection <ChequeInwardsModel>(); } CurrentChequeInwardModel.User = LoginBusinessLogic.GetUserByID(S360Configuration.Instance.UserID).Username; CurrentChequeInwardModel.EnteredBy = S360Model.S360Configuration.Instance.UserID; CurrentChequeInwardModel.Login_ID = S360Model.S360Configuration.Instance.LoginID; business = new ChequeBusinessLogic(); CurrentChequeInwardModel = ConvertToCheque(business.SaveChequeTemp(ConvertToCheque(CurrentChequeInwardModel, true) as CHQ_Cheques_Master_Temp), false) as ChequeInwardsModel; CurrentChequeInwardModel.SerialNo = ChequeList.Count + 1; ChequeList.Add(CurrentChequeInwardModel); } catch (Exception ex) { throw new S360Exceptions.S360Exception(ex.Message, ex.InnerException); } CurrentChequeInwardModel = null; business = null; }
private void LoadData() { loadbar.Start(); int pageCount = 0; string filter = ""; string strState = ""; System.Collections.ObjectModel.ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>(); if (Checkstate != Convert.ToInt32(CheckStates.All).ToString()) { strState = Checkstate; } //ComboBox cbxCompanyName = Utility.FindChildControl<ComboBox>(expander, "cbxCompanyName"); AutoCompleteComboBox acbCompanyName = Utility.FindChildControl<AutoCompleteComboBox>(expander, "acbCompanyName"); TextBox txtEmpName = Utility.FindChildControl<TextBox>(expander, "txtEmpName"); if (acbCompanyName != null) { if (acbCompanyName.SelectedItem != null) { T_HR_COMPANY ent = acbCompanyName.SelectedItem as T_HR_COMPANY; if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "T_HR_COMPANY.CNAME==@" + paras.Count().ToString(); paras.Add(ent.CNAME); } } if (txtEmpName != null) { if (!string.IsNullOrEmpty(txtEmpName.Text)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } // filter += "T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME.Contains(@" + paras.Count().ToString()+")"; filter += " @" + paras.Count().ToString() + ".Contains(T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME)"; paras.Add(txtEmpName.Text.Trim()); } } client.DepartmentPagingAsync(dataPager.PageIndex, dataPager.PageSize, "SORTINDEX", filter, paras, pageCount, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, strState); }
private void GetData(int pageIndex) { int pageCount = 0; string filter = ""; //查询过滤条件 ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); //参数值 if (IsQuery) { string StrContent = ""; string StrAssetid = ""; string StrStart = ""; string StrEnd = ""; StrStart = dpStart.Text.ToString(); StrEnd = dpEnd.Text.ToString(); DateTime DtStart = new DateTime(); DateTime DtEnd = new DateTime(); StrContent = this.txtConserVationContent.Text.ToString().Trim(); StrAssetid = this.txtVIN.Text.ToString().Trim(); if (!string.IsNullOrEmpty(StrStart) && string.IsNullOrEmpty(StrEnd)) { Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARING"), Utility.GetResourceStr("ENDTIMENOTNULL")); //MessageBox.Show("结束时间不能为空"); return; } if (string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd)) { Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARING"), Utility.GetResourceStr("MEETINGSTARTTIMENOTNULL")); //MessageBox.Show("开始时间不能为空"); 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("WARING"), Utility.GetResourceStr("ERRORSTARTDATEGTENDDATE")); return; } else { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "COSTDATE >=@" + paras.Count().ToString();//开始时间 paras.Add(DtStart); filter += " and "; filter += "COSTDATE <=@" + paras.Count().ToString();//结束时间 paras.Add(DtEnd); } } if (!string.IsNullOrEmpty(StrContent)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } filter += "CONTENT ^@" + paras.Count().ToString();//类型名称 paras.Add(StrContent); } if (!string.IsNullOrEmpty(StrAssetid)) { if (!string.IsNullOrEmpty(filter)) { filter += " and "; } //filter += "T_OA_VEHICLE.VIN ^@" + paras.Count().ToString(); filter += "T_OA_VEHICLE.VIN.Contains(@" + paras.Count().ToString() + ") "; paras.Add(StrAssetid); } } if (pageIndex < 0) { pageIndex = 0; } pageIndex++; loadbar.Start(); vehicleClient.GetCostRecordListAsync(pageIndex, dataPager.PageSize, "UPDATEDATE", filter, paras, pageCount, Common.CurrentLoginUserInfo.EmployeeID); }