private void BaseButton_Search_Click(object sender, EventArgs e) { try { if (CommonGlobalUtil.EngineUnconnectioned(this)) { return; } int brand = Convert.ToInt32(ValidateUtil.CheckEmptyValue(this.skinComboBox_Brand.SelectedValue)); string typeStr = ValidateUtil.CheckEmptyValue(skinComboBoxGroup.SelectedValue); pagePara = new GetSalesAnalysisPara() { ShopID = ValidateUtil.CheckEmptyValue(this.skinComboBoxShopID.SelectedValue), CostumeID = this.skinTextBoxID.SkinTxt.Text, StartDate = new CJBasic.Date(this.dateTimePicker_Start.Value), EndDate = new CJBasic.Date(this.dateTimePicker_End.Value), BrandID = brand, SupplierID = ValidateUtil.CheckEmptyValue(skinComboBoxSupplier.SelectedValue), Type = typeStr, ClassID = (int)skinComboBoxBigClass.SelectedValue.ClassID, //GroupType = (GroupType)skinComboBoxGroup.SelectedValue, // IsGetGeneralStore = CommonGlobalCache.IsGeneralStoreRetail=="1" }; //if (pagePara.GroupType == GroupType.Shop) //{ // ColumnDetail.Visible = true; //} //else //{ // ColumnDetail.Visible = false; //} DateTime STime = DateTime.Now; InteractResult <SalesAnalysisInfo> list = CommonGlobalCache.ServerProxy.GetSalesAnalysis(this.pagePara); DateTime ETime = DateTime.Now; TimeSpan spanA = (TimeSpan)(ETime - STime); WriteLog("销售分析零售数据加载开始时间:" + STime + " 结束时间:" + ETime + " 总耗时数:" + spanA.TotalSeconds + "秒"); //GlobalMessageBox.Show("数据加载完成!"); /* if (String.IsNullOrEmpty(pagePara.CostumeID)) * { * groupTypeNameDataGridViewTextBoxColumn.HeaderText = "分组"; * } * else * { * if (pagePara.ShopID == null) * { * groupTypeNameDataGridViewTextBoxColumn.HeaderText = "店鋪"; * } * else * { * groupTypeNameDataGridViewTextBoxColumn.HeaderText = "款号"; * } * }*/ DateTime startTime = DateTime.Now; String[] strs = typeStr.Split('+'); if (strs.Length == 1) {//款号 TypeValue1.Visible = true; TypeValue1.HeaderText = strs[0]; TypeValue2.Visible = false; TypeValue3.Visible = false; List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>(); listColumn.Add(TypeValue4); listColumn.Add(TypeValue5); listColumn.Add(TypeValue6); listColumn.Add(TypeValue7); listColumn.Add(TypeValue8); SetVisible(listColumn); } else if (strs.Length == 2) {//供应商+款号、品牌 + 款号、日期 + 款号 TypeValue1.Visible = true; TypeValue1.HeaderText = strs[0]; TypeValue2.Visible = true; TypeValue2.HeaderText = strs[1]; TypeValue3.Visible = false; List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>(); listColumn.Add(TypeValue4); listColumn.Add(TypeValue5); listColumn.Add(TypeValue6); listColumn.Add(TypeValue7); listColumn.Add(TypeValue8); SetVisible(listColumn); } else if (strs.Length == 3) {//日期 + 单号 + 供应商 TypeValue1.Visible = true; TypeValue1.HeaderText = strs[0]; TypeValue2.Visible = true; TypeValue2.HeaderText = strs[1]; TypeValue3.Visible = true; TypeValue3.HeaderText = strs[2]; List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>(); listColumn.Add(TypeValue4); listColumn.Add(TypeValue5); listColumn.Add(TypeValue6); listColumn.Add(TypeValue7); listColumn.Add(TypeValue8); SetVisible(listColumn); } else if (strs.Length == 4) {//日期 + 单号 + 供应商 TypeValue1.Visible = true; TypeValue1.HeaderText = strs[0]; TypeValue2.Visible = true; TypeValue2.HeaderText = strs[1]; TypeValue3.Visible = true; TypeValue3.HeaderText = strs[2]; TypeValue4.Visible = true; TypeValue4.HeaderText = strs[3]; List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>(); listColumn.Add(TypeValue5); listColumn.Add(TypeValue6); listColumn.Add(TypeValue7); listColumn.Add(TypeValue8); SetVisible(listColumn); } else if (strs.Length == 5) {//日期 + 单号 + 供应商 TypeValue1.Visible = true; TypeValue1.HeaderText = strs[0]; TypeValue2.Visible = true; TypeValue2.HeaderText = strs[1]; TypeValue3.Visible = true; TypeValue3.HeaderText = strs[2]; TypeValue4.Visible = true; TypeValue4.HeaderText = strs[3]; TypeValue5.Visible = true; TypeValue5.HeaderText = strs[4]; List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>(); listColumn.Add(TypeValue6); listColumn.Add(TypeValue7); listColumn.Add(TypeValue8); SetVisible(listColumn); } else if (strs.Length == 6) {//日期 + 单号 + 供应商 TypeValue1.Visible = true; TypeValue1.HeaderText = strs[0]; TypeValue2.Visible = true; TypeValue2.HeaderText = strs[1]; TypeValue3.Visible = true; TypeValue3.HeaderText = strs[2]; TypeValue4.Visible = true; TypeValue4.HeaderText = strs[3]; TypeValue5.Visible = true; TypeValue5.HeaderText = strs[4]; TypeValue6.Visible = true; TypeValue6.HeaderText = strs[5]; List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>(); listColumn.Add(TypeValue7); listColumn.Add(TypeValue8); SetVisible(listColumn); } else if (strs.Length == 7) {//日期 + 单号 + 供应商 TypeValue1.Visible = true; TypeValue1.HeaderText = strs[0]; TypeValue2.Visible = true; TypeValue2.HeaderText = strs[1]; TypeValue3.Visible = true; TypeValue3.HeaderText = strs[2]; TypeValue4.Visible = true; TypeValue4.HeaderText = strs[3]; TypeValue5.Visible = true; TypeValue5.HeaderText = strs[4]; TypeValue6.Visible = true; TypeValue6.HeaderText = strs[5]; TypeValue7.Visible = true; TypeValue7.HeaderText = strs[6]; List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>(); listColumn.Add(TypeValue8); SetVisible(listColumn); } else if (strs.Length == 8) {//日期 + 单号 + 供应商 TypeValue1.Visible = true; TypeValue1.HeaderText = strs[0]; TypeValue2.Visible = true; TypeValue2.HeaderText = strs[1]; TypeValue3.Visible = true; TypeValue3.HeaderText = strs[2]; TypeValue4.Visible = true; TypeValue4.HeaderText = strs[3]; TypeValue5.Visible = true; TypeValue5.HeaderText = strs[4]; TypeValue6.Visible = true; TypeValue6.HeaderText = strs[5]; TypeValue7.Visible = true; TypeValue7.HeaderText = strs[6]; TypeValue8.Visible = true; TypeValue8.HeaderText = strs[7]; } if (!String.IsNullOrEmpty(pagePara.CostumeID)) { if (strs.Length == 1) {//款号 TypeValue1.Visible = true; TypeValue1.HeaderText = strs[0]; TypeValue2.Visible = false; TypeValue3.Visible = false; List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>(); listColumn.Add(TypeValue4); listColumn.Add(TypeValue5); listColumn.Add(TypeValue6); listColumn.Add(TypeValue7); listColumn.Add(TypeValue8); SetVisible(listColumn); } else if (strs.Length == 2) {//供应商+款号、品牌 + 款号、日期 + 款号 TypeValue1.Visible = true; TypeValue1.HeaderText = strs[0]; TypeValue2.Visible = true; TypeValue2.HeaderText = strs[1]; TypeValue3.Visible = false; List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>(); listColumn.Add(TypeValue4); listColumn.Add(TypeValue5); listColumn.Add(TypeValue6); listColumn.Add(TypeValue7); listColumn.Add(TypeValue8); SetVisible(listColumn); } else if (strs.Length == 3) {//日期 + 单号 + 供应商 TypeValue1.Visible = true; TypeValue1.HeaderText = strs[0]; TypeValue2.Visible = true; TypeValue2.HeaderText = strs[1]; TypeValue3.Visible = true; TypeValue3.HeaderText = strs[2]; List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>(); listColumn.Add(TypeValue4); listColumn.Add(TypeValue5); listColumn.Add(TypeValue6); listColumn.Add(TypeValue7); listColumn.Add(TypeValue8); SetVisible(listColumn); } else if (strs.Length == 4) {//日期 + 单号 + 供应商 TypeValue1.Visible = true; TypeValue1.HeaderText = strs[0]; TypeValue2.Visible = true; TypeValue2.HeaderText = strs[1]; TypeValue3.Visible = true; TypeValue3.HeaderText = strs[2]; TypeValue4.Visible = true; TypeValue4.HeaderText = strs[3]; List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>(); listColumn.Add(TypeValue5); listColumn.Add(TypeValue6); listColumn.Add(TypeValue7); listColumn.Add(TypeValue8); SetVisible(listColumn); } else if (strs.Length == 5) {//日期 + 单号 + 供应商 TypeValue1.Visible = true; TypeValue1.HeaderText = strs[0]; TypeValue2.Visible = true; TypeValue2.HeaderText = strs[1]; TypeValue3.Visible = true; TypeValue3.HeaderText = strs[2]; TypeValue4.Visible = true; TypeValue4.HeaderText = strs[3]; TypeValue5.Visible = true; TypeValue5.HeaderText = strs[4]; List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>(); listColumn.Add(TypeValue6); listColumn.Add(TypeValue7); listColumn.Add(TypeValue8); SetVisible(listColumn); } else if (strs.Length == 6) {//日期 + 单号 + 供应商 TypeValue1.Visible = true; TypeValue1.HeaderText = strs[0]; TypeValue2.Visible = true; TypeValue2.HeaderText = strs[1]; TypeValue3.Visible = true; TypeValue3.HeaderText = strs[2]; TypeValue4.Visible = true; TypeValue4.HeaderText = strs[3]; TypeValue5.Visible = true; TypeValue5.HeaderText = strs[4]; TypeValue6.Visible = true; TypeValue6.HeaderText = strs[5]; List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>(); listColumn.Add(TypeValue7); listColumn.Add(TypeValue8); SetVisible(listColumn); } else if (strs.Length == 7) {//日期 + 单号 + 供应商 TypeValue1.Visible = true; TypeValue1.HeaderText = strs[0]; TypeValue2.Visible = true; TypeValue2.HeaderText = strs[1]; TypeValue3.Visible = true; TypeValue3.HeaderText = strs[2]; TypeValue4.Visible = true; TypeValue4.HeaderText = strs[3]; TypeValue5.Visible = true; TypeValue5.HeaderText = strs[4]; TypeValue6.Visible = true; TypeValue6.HeaderText = strs[5]; TypeValue7.Visible = true; TypeValue7.HeaderText = strs[6]; List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>(); listColumn.Add(TypeValue8); SetVisible(listColumn); } else if (strs.Length == 8) {//日期 + 单号 + 供应商 TypeValue1.Visible = true; TypeValue1.HeaderText = strs[0]; TypeValue2.Visible = true; TypeValue2.HeaderText = strs[1]; TypeValue3.Visible = true; TypeValue3.HeaderText = strs[2]; TypeValue4.Visible = true; TypeValue4.HeaderText = strs[3]; TypeValue5.Visible = true; TypeValue5.HeaderText = strs[4]; TypeValue6.Visible = true; TypeValue6.HeaderText = strs[5]; TypeValue7.Visible = true; TypeValue7.HeaderText = strs[6]; TypeValue8.Visible = true; TypeValue8.HeaderText = strs[7]; } } DateTime endTime = DateTime.Now; TimeSpan span = (TimeSpan)(endTime - startTime); WriteLog("销售分析零售数据设置加载开始时间:" + startTime + " 结束时间:" + endTime + " 总耗时数:" + span.TotalSeconds + "秒"); this.BindingDataSource(list.Data); } catch (Exception ex) { ShowError(ex); } finally { UnLockPage(); } }
private void CostumeManageCtrl_Load(object sender, EventArgs e) { try { dataGridViewPagingSumCtrl.SetDataSource <SalesAnalysis>(null); pagePara = new GetSalesAnalysisPara(); this.skinComboBoxShopID.Initialize(false, CommonGlobalCache.IsGeneralStoreRetail != "1", CommonGlobalCache.BusinessAccount.OnlineEnabled); if (TypeValue1.HeaderText == "TypeValue1") { TypeValue1.HeaderText = "款号"; this.TypeValue1.Visible = false; } if (TypeValue2.HeaderText == "TypeValue2") { TypeValue2.HeaderText = "品牌"; this.TypeValue2.Visible = false; } if (TypeValue3.HeaderText == "TypeValue3") { TypeValue3.HeaderText = "供应商"; this.TypeValue3.Visible = false; } if (TypeValue4.HeaderText == "TypeValue4") { TypeValue4.HeaderText = "大类"; this.TypeValue4.Visible = false; } if (TypeValue5.HeaderText == "TypeValue5") { TypeValue5.HeaderText = "小类"; this.TypeValue5.Visible = false; } if (TypeValue6.HeaderText == "TypeValue6") { TypeValue6.HeaderText = "款号"; this.TypeValue6.Visible = false; } if (TypeValue7.HeaderText == "TypeValue7") { TypeValue7.HeaderText = "名称"; this.TypeValue7.Visible = false; } if (TypeValue8.HeaderText == "TypeValue8") { TypeValue8.HeaderText = "年份"; this.TypeValue8.Visible = false; } if (!HasPermission(RolePermissionEnum.查看_毛利)) { dataGridViewPagingSumCtrl.AppendNotShowInColumnSettings(benefitRateDataGridViewTextBoxColumn); // this.benefitRateDataGridViewTextBoxColumn.Visible = false; this.benefitRateDataGridViewTextBoxColumn.HeaderText = " "; } else { dataGridViewPagingSumCtrl.RemoveNotShowInColumnSettings(benefitRateDataGridViewTextBoxColumn); } } catch (Exception ex) { ShowError(ex); } }
internal void ShowDialog(SalesAnalysis salesAnalysis, DateTimePicker dateTimePicker_Start, DateTimePicker dateTimePicker_End, GetSalesAnalysisPara curPara, BaseUserControl CurCtrl) { // this.Show(CurCtrl); para = new GetSalesAnalysisDeatilInfoPara() { ShopID = salesAnalysis.ShopID, Type = salesAnalysis.Type, BrandID = curPara.BrandID, SupplierID = curPara.SupplierID, ClassID = curPara.ClassID, ParaValue1 = salesAnalysis.TypeValue1, ParaValue2 = salesAnalysis.TypeValue2, ParaValue3 = salesAnalysis.TypeValue3, ParaValue4 = salesAnalysis.TypeValue4, ParaValue5 = salesAnalysis.TypeValue5, ParaValue6 = salesAnalysis.TypeValue6, ParaValue7 = salesAnalysis.TypeValue7, ParaValue8 = salesAnalysis.TypeValue8, StartDate = new CJBasic.Date(dateTimePicker_Start.Value), EndDate = new CJBasic.Date(dateTimePicker_End.Value), CostumeID = salesAnalysis.CostumeID, IsChooseSize = skinCheckBoxCostumeSize.Checked, IsChooseColor = skinCheckBoxColor.Checked }; String startDate = dateTimePicker_Start.Value.GetDateTimeFormats('D')[0].ToString(); String endDate = dateTimePicker_End.Value.GetDateTimeFormats('D')[0].ToString(); if (startDate.Equals(endDate)) { skinLabelTime.Text = startDate; } else { skinLabelTime.Text = startDate + " 至 " + endDate; } Search(); this.ShowDialog(CurCtrl); }