private void BaseButton_Search_Click(object sender, EventArgs e) { CommonGlobalUtil.Debug("开始查询"); try { if (CommonGlobalUtil.EngineUnconnectioned(this)) { return; } string curPfCustomerID = ""; if (skinComboBox_PfCustomer.SelectedValue != null) { curPfCustomerID = ValidateUtil.CheckEmptyValue(skinComboBox_PfCustomer.SelectedValue); } else { if (skinComboBox_PfCustomer.Text != "" && skinComboBox_PfCustomer.Text != "所有") { GlobalMessageBox.Show("请输入正确的客户信息后再进行查询!"); this.skinComboBox_PfCustomer.Focus(); return; } } this.pagePara = new GetPfCustomerInvoicingPara() { PfCustomerID = curPfCustomerID, StartDate = new CJBasic.Date(this.dateTimePicker_Start.Value), EndDate = new CJBasic.Date(this.dateTimePicker_End.Value), CostumeID = this.skinTextBox_costumeID.Text, }; //找到对应的大类 if (!String.IsNullOrEmpty(this.skinTextBox_costumeID.Text) && skinComboBox_PfCustomer.SelectedValue == null) { InteractResult <List <PfCustomerInvoicing> > listPage = GlobalCache.ServerProxy.GetPfInvoicingOnlyCostumeID(this.pagePara); this.BindingCostumeStoreDataSource(listPage.Data); } else { InteractResult <List <PfCustomerInvoicing> > listPage = GlobalCache.ServerProxy.GetPfCustomerInvoicing(this.pagePara); this.BindingCostumeStoreDataSource(listPage.Data); } } catch (Exception ee) { ShowError(ee); } finally { UnLockPage(); } CommonGlobalUtil.Debug("结束查询"); }
/// <summary> /// 绑定完成的时候,记录哪些列的显示状态,供给工具中使用的状态切换时可以判断显示的 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void View_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e) { if (Debug) { CommonGlobalUtil.Debug("Begin View_DataBindingComplete" + DateTime.Now); } if (!Disabled) { CommonGlobalUtil.ChangeSizeGroup(view, sizeGroup, true); } // CheckCommonSize(); // CheckAtmSize(); if (Debug) { CommonGlobalUtil.Debug("End View_DataBindingComplete" + DateTime.Now); } }
private void BaseButton_Search_Click(object sender, EventArgs e) { CommonGlobalUtil.Debug("开始查询"); try { if (CommonGlobalUtil.EngineUnconnectioned(this)) { return; } Brand curBrand = this.skinComboBox_Brand.SelectedItem; int curBrandID = -2; if (curBrand == null) { curBrandID = -2; } else { curBrandID = curBrand.AutoID; } this.pagePara = new GetCostumeInvoicingPara() { ClassID = skinComboBoxBigClass.SelectedValue.ClassID, StartDate = new CJBasic.Date(this.dateTimePicker_Start.Value), EndDate = new CJBasic.Date(this.dateTimePicker_End.Value), CostumeID = this.skinTextBox_costumeID.Text, BrandID = curBrandID, ChooseColor = skinCheckBoxColor.Checked, ChooseSize = skinCheckBoxSizeName.Checked, Season = ((ListItem <String>) this.skinComboBoxSeason.skinComboBox.SelectedItem).Value, }; //找到对应的大类 // pagePara.ClassID = GetBigClass( pagePara.ClassID); DateTime startTime = DateTime.Now; InteractResult <List <CostumeInvoicing> > listPage = GlobalCache.ServerProxy.GetCostumeInvoicing(this.pagePara); DateTime endTime = DateTime.Now; TimeSpan span = (TimeSpan)(endTime - startTime); WriteLog("数据加载开始时间:" + startTime + " 结束时间:" + endTime + " 总耗时数:" + span.TotalSeconds + "秒"); startTime = DateTime.Now; SetSpanInfo(); endTime = DateTime.Now; span = (TimeSpan)(endTime - startTime); WriteLog("表头列设置加载开始时间:" + startTime + " 结束时间:" + endTime + " 总耗时数:" + span.TotalSeconds + "秒"); this.BindingCostumeStoreDataSource(listPage.Data); endTime = DateTime.Now; span = (TimeSpan)(endTime - startTime); WriteLog("总界面加载开始时间:" + startTime + " 结束时间:" + endTime + " 总耗时数:" + span.TotalSeconds + "秒"); } catch (Exception ee) { ShowError(ee); } finally { UnLockPage(); } CommonGlobalUtil.Debug("结束查询"); }
//获取相同运费的详情,构造一起成为一个CarriageCost public static CarriageCost GetCarriageCost(List <EmCarriageCostDetail> source) { CarriageCost cost = new CarriageCost(); List <Zone> zones = new List <Zone>(); if (source != null) { List <EmCarriageCostDetail> temp = new List <EmCarriageCostDetail>(); foreach (EmCarriageCostDetail item in source) { temp.Add(item); } if (temp != null) { //将相同的省份拼起来,再拼全部。 cost.Cost = temp[0].CarriageCost; //zones Zone zone = new Zone(); zone.Province = new List <Province>(); List <EmCarriageCostDetail> allSameList = null; while (temp.Count > 0) { foreach (EmCarriageCostDetail item in temp) { Province province = new Province(); province.Name = item.Province; province.Selected = true; //找到所有相同的省份, allSameList = temp.FindAll(t => t.Province == item.Province); CommonGlobalUtil.Debug("找到省份:" + item.Province + " " + allSameList.Count); if (!String.IsNullOrEmpty(item.City)) { cost.AreaStr += item.Province + ":"; //找出所有相同省份的城市信息 foreach (EmCarriageCostDetail cityData in allSameList) { if (province.Sub == null) { province.Sub = new List <City>(); } City city = new City(); city.Name = cityData.City; city.Selected = true; province.Sub.Add(city); cost.AreaStr += cityData.City + "、"; } if (cost.AreaStr.Length > 0) { cost.AreaStr = cost.AreaStr.Substring(0, cost.AreaStr.Length - 1) + ";"; } } else { cost.AreaStr += item.Province + ";"; } CommonGlobalUtil.Debug("添加:" + province); zone.Province.Add(province); break; } foreach (var removed in allSameList) { temp.Remove(removed); } } zones.Add(zone); if (cost.AreaStr.Length > 0) { cost.AreaStr = cost.AreaStr.Substring(0, cost.AreaStr.Length - 1) + ";"; } } } cost.Zones = zones; return(cost); }