private void BaseButton_AddCostume_Click(object sender, EventArgs e) { try { int buyCount = int.Parse(this.skinTextBox_bugCount.SkinTxt.Text); //if (buyCount <= 0) //{ // GlobalMessageBox.Show("退货数量必须大于0!"); // return; //} PfCustomerRetailDetail detail = new PfCustomerRetailDetail() { CostumeID = this.currentSelectedItem.Costume.ID, CostumeName = this.currentSelectedItem.Costume.Name, ColorName = this.skinComboBox_Color.Text, SizeName = ValidateUtil.CheckEmptyValue(this.skinComboBox_Size.SelectedValue), // 显示自己设置的尺码组和对应的尺码列表 SizeDisplayName = CostumeStoreHelper.GetCostumeSizeName(ValidateUtil.CheckEmptyValue(this.skinComboBox_Size.SelectedValue), CommonGlobalCache.GetSizeGroup(this.currentSelectedItem.Costume.SizeGroupName)), BuyCount = buyCount, }; if (!this.AddSelectedCostumeToList(detail)) { return; } dataGridViewPagingSumCtrl.BindingDataSource(this.PfCustomerRetailDetailList); this.skinTextBox_bugCount.SkinTxt.Text = "1"; } catch (Exception ee) { CommonGlobalUtil.WriteLog(ee); GlobalMessageBox.Show("添加失败!"); } }
private void ShowDiff() {//显示盘点录入中有差异的商品 List <CheckStoreDiff> diffList = new List <CheckStoreDiff>(); foreach (var item in costumeStores) { if (!CheckBrand(item)) { continue; } CheckStoreDetail real = item; CostumeStoreHistory shot = shots.Find(t => t.CostumeID.ToUpper() == item.CostumeID.ToUpper() && item.ColorName == t.ColorName); if (shot == null) { WebResponseObj <List <CostumeStoreHistory> > result = CommonGlobalCache.ServerProxy.GetCostumeStoreHistory4CheckStore( this.shopId, item.CostumeID, new Date(this.date), true ); if (result?.Data != null && result?.Data.Count > 0) { shot = result.Data.Find(t => t.CostumeID.ToUpper() == item.CostumeID.ToUpper() && item.ColorName == t.ColorName); } } CheckStoreDetail quick = ToCheckStoreDetail(shot); CheckStoreDetail liaojian = new CheckStoreDetail(); CheckStoreDetail diff = null; diff = SetCostumeStoreDiff(real, liaojian, quick, "差异"); foreach (string sizeName in CostumeStoreHelper.CostumeSizeColumn) { String dbSize = sizeName; //CostumeStoreHelper.GetCostumeSize(sizeName, sizeGroup); int differenceCount = Convert.ToInt32(CJBasic.Helpers.ReflectionHelper.GetProperty(diff, sizeName + "WinLost")); if (differenceCount != 0) { int realcount = Convert.ToInt32(CJBasic.Helpers.ReflectionHelper.GetProperty(real, sizeName)); int changeCount = Convert.ToInt32(CJBasic.Helpers.ReflectionHelper.GetProperty(liaojian, sizeName)); int storeCount = Convert.ToInt32(CJBasic.Helpers.ReflectionHelper.GetProperty(quick, sizeName + "Atm")); CheckStoreDiff storeDiff = new CheckStoreDiff(); ReflectionHelper.CopyProperty(real, storeDiff); Costume costume = CommonGlobalCache.GetCostume(storeDiff.CostumeID); String sizeDisplayName = CostumeStoreHelper.GetCostumeSizeName(sizeName, CommonGlobalCache.GetSizeGroup(costume.SizeGroupName)); storeDiff.SizeName = sizeDisplayName; storeDiff.BrandName = CommonGlobalCache.GetBrandName(costume.BrandID); storeDiff.DiffCount = differenceCount; storeDiff.RealCount = realcount; storeDiff.QuickCount = storeCount; storeDiff.ChangeCount = changeCount; diffList.Add(storeDiff); } } } dataGridViewPagingSumCtrl2.BindingDataSource(diffList); }
private void PrintRetail(RetailOrder retailOrder) { OrderPrintUtil printHelper = new OrderPrintUtil(); List <RetailDetail> retailDetailList = CommonGlobalCache.ServerProxy.GetRetailDetailList(retailOrder.ID); foreach (var item in retailDetailList) { Costume costume = CommonGlobalCache.GetCostume(item.CostumeID); // 显示自己设置的尺码组和对应的尺码列表 item.SizeDisplayName = CostumeStoreHelper.GetCostumeSizeName(item.SizeName, CommonGlobalCache.GetSizeGroup(costume.SizeGroupName)); } RetailCostume retailCostume = new RetailCostume() { RetailDetailList = retailDetailList, RetailOrder = retailOrder }; int times = CommonGlobalUtil.ConvertToInt32(CommonGlobalCache.GetParameter(ParameterConfigKey.PrintCount).ParaValue); DataGridView dgv = deepCopyDataGridView(); printHelper.Print(retailCostume, times, dgv); }
private void Export(RetailOrder retailOrder) { // RefundOrderPrintUtil printHelper = new RefundOrderPrintUtil(); // List<RetailDetail> retailDetailList = CommonGlobalCache.ServerProxy.GetRetailDetailList(retailOrder.ID); //foreach (var item in retailDetailList) //{ // Costume costume = CommonGlobalCache.GetCostume(item.CostumeID); // // 显示自己设置的尺码组和对应的尺码列表 // item.SizeDisplayName = CostumeStoreHelper.GetCostumeSizeName(item.SizeName, CommonGlobalCache.GetSizeGroup(costume.SizeGroupName)); //} try { List <RetailDetail> retailDetailList = CommonGlobalCache.ServerProxy.GetRetailDetailList(retailOrder.ID); // System.Collections.SortedList columns = new System.Collections.SortedList(); List <String> keys = new List <string>(); List <String> values = new List <string>(); keys.Add("BusinessTime"); values.Add("业务日期"); keys.Add("SaleBillID"); values.Add("销售单号"); keys.Add("GuidId"); values.Add("整单导购员"); keys.Add("Shop"); values.Add("店铺"); keys.Add("VIPCard"); values.Add("VIP卡号"); keys.Add("VIPName"); values.Add("VIP姓名"); foreach (DataGridViewColumn item in dataGridView_RetailDetail.Columns) { keys.Add(item.DataPropertyName); values.Add(item.HeaderText); } foreach (RetailDetail cItem in retailDetailList) { //cItem.CostumeName = CommonGlobalCache.GetCostumeName(cItem.CostumeID); Costume costume = CommonGlobalCache.GetCostume(cItem.CostumeID); cItem.CostumeName = costume.Name; cItem.SizeDisplayName = CostumeStoreHelper.GetCostumeSizeName(cItem.SizeName, CommonGlobalCache.GetSizeGroup(costume.SizeGroupName)); } /* List<CellType> cellList = new List<CellType>(); * NPOIHelper.hsRowCount = 4; * * * CellType curCellI = new CellType(); * curCellI.RowIndex = 0; * curCellI.CellName = ""; * if (ColNum % 2 == 0) * { * * curCellI.CellMergeNum = ColNum / 2 - 1; * } * else * { * curCellI.CellMergeNum = ColNum / 2; * } * cellList.Add(curCellI); * * * * CellType curCell = new CellType(); * curCell.RowIndex = 0; * curCell.CellName = retailOrder.ShopName; * if (ColNum % 2 == 0) * { * curCell.CellMergeNum = ColNum - (ColNum / 2) + 1; * } * else * { * curCell.CellMergeNum = ColNum - (ColNum / 2); * } * // curCell.CellMergeIndex = 12; * cellList.Add(curCell); * * CellType curCellOrder = new CellType(); * curCellOrder.RowIndex = 1; * curCellOrder.CellName = "单号:"; * curCellOrder.CellMergeNum = 1; * cellList.Add(curCellOrder); * * * * CellType curCellOrderValue = new CellType(); * curCellOrderValue.RowIndex = 1; * curCellOrderValue.CellName = retailOrder.ID; * curCellOrderValue.CellMergeNum = 2; * cellList.Add(curCellOrderValue); * * CellType curCellCreaterUser = new CellType(); * curCellCreaterUser.RowIndex = 1; * curCellCreaterUser.CellName = "日期"; * curCellCreaterUser.CellMergeNum = 1; * cellList.Add(curCellCreaterUser); * * CellType curCellCreaterUserValue = new CellType(); * curCellCreaterUserValue.RowIndex = 1; * curCellCreaterUserValue.CellName = retailOrder.CreateTime.GetDateTimeFormats('f')[0].ToString(); * curCellCreaterUserValue.CellMergeNum = 2; * cellList.Add(curCellCreaterUserValue); * * * * CellType curCellTime = new CellType(); * curCellTime.RowIndex = 2; * curCellTime.CellName = "电话"; * curCellTime.CellMergeNum = 1; * cellList.Add(curCellTime); * * CellType curCellTimeValue = new CellType(); * curCellTimeValue.RowIndex =2; * curCellTimeValue.CellName = CommonGlobalCache.CurrentShop?.PhoneNumber; * curCellTimeValue.CellMergeNum = 2; * cellList.Add(curCellTimeValue); * * * * CellType curCellSource = new CellType(); * curCellSource.RowIndex = 2; * curCellSource.CellName = "地址:"; * curCellSource.CellMergeNum = 1; * cellList.Add(curCellSource); * * * * CellType curCellSourceValue = new CellType(); * curCellSourceValue.RowIndex = 2; * curCellSourceValue.CellName = CommonGlobalCache.CurrentShop?.Address; * curCellSourceValue.CellMergeNum = 2; * cellList.Add(curCellSourceValue); * * * CellType curCellTarget = new CellType(); * curCellTarget.RowIndex = 3; * curCellTarget.CellName = "顾问:"; * curCellTarget.CellMergeNum = 1; * cellList.Add(curCellTarget); * * * * CellType curCellTargetValue = new CellType(); * curCellTargetValue.RowIndex = 3; * curCellTargetValue.CellName = CommonGlobalCache.GetUserName(retailOrder.GuideID); * curCellTargetValue.CellMergeNum = 2; * cellList.Add(curCellTargetValue); * * * NPOIHelper.CellValues = cellList;*/ DataTable dt = DataGridViewUtil.ToDataTable(retailDetailList); dt.Columns.Add("BusinessTime"); dt.Columns.Add("SaleBillID"); dt.Columns.Add("GuidId"); dt.Columns.Add("Shop"); dt.Columns.Add("VIPCard"); dt.Columns.Add("VIPName"); foreach (DataRow dr in dt.Rows) { dr["BusinessTime"] = retailOrder.EntryTime.GetDateTimeFormats('f')[0].ToString(); dr["SaleBillID"] = retailOrder.ID; dr["GuidId"] = retailOrder.GuideName; dr["Shop"] = retailOrder.ShopName; dr["VIPCard"] = retailOrder.MemeberID; dr["VIPName"] = retailOrder.MemeberID != null && retailOrder.MemeberID != "" ? CommonGlobalCache.ServerProxy.GetOneMember(retailOrder.MemeberID).Name:""; } List <CellType> cellList = new List <CellType>(); NPOIHelper.bottomHsRowCount = 1; CellType curCellIT = new CellType(); curCellIT.RowIndex = dt.Rows.Count + 1; curCellIT.CellName = "汇总:"; curCellIT.IsCollect = true; curCellIT.CellMergeNum = 1; cellList.Add(curCellIT); for (int k = 0; k < 11; k++) { CellType curCellI = new CellType(); curCellI.RowIndex = dt.Rows.Count + 1; curCellI.CellName = ""; curCellI.CellMergeNum = 1; cellList.Add(curCellI); } CellType curCellTotal = new CellType(); curCellTotal.RowIndex = dt.Rows.Count + 1;//1是要多加一行标题列 curCellTotal.CellName = retailOrder.TotalCount.ToString(); curCellTotal.IsCollect = true; curCellTotal.CellMergeNum = 1; cellList.Add(curCellTotal); CellType curCellTotalPrice = new CellType(); curCellTotalPrice.RowIndex = dt.Rows.Count + 1; curCellTotalPrice.CellName = retailOrder.TotalMoneyReceived.ToString(); curCellTotalPrice.CellMergeNum = 1; curCellTotalPrice.IsCollect = true; cellList.Add(curCellTotalPrice); NPOIHelper.BottomCellValues = cellList; NPOIHelper.Keys = keys.ToArray(); NPOIHelper.Values = values.ToArray(); NPOIHelper.ExportExcel(dt, path); GlobalMessageBox.Show("导出完毕!"); } catch (Exception ex) { ShowError(ex); } finally { UnLockPage(); } }
public string DisplaySizeName(SizeGroup sizeGroup) { return(CostumeStoreHelper.GetCostumeSizeName(this.SizeName, sizeGroup)); }
private void BaseButton_AddCostume_Click(object sender, EventArgs e) { try { int buyCount = int.Parse(this.skinTextBox_bugCount.SkinTxt.Text); if (buyCount <= 0) { GlobalMessageBox.Show("退货数量必须大于0!"); return; } string selectShopid = ValidateUtil.CheckEmptyValue(this.skinComboBoxShopID.SelectedValue); List <Guide> guideList = CommonGlobalCache.GuideList.FindAll(t => t.State == 0 && t.ShopID == selectShopid); this.GuideName.DataSource = guideList; this.GuideName.DisplayMember = "Name"; this.GuideName.ValueMember = "ID"; string defaultGuid = string.Empty; if (this.guideComboBox1.SelectedIndex > 0) { defaultGuid = ValidateUtil.CheckEmptyValue(this.guideComboBox1.SelectedValue); } RetailDetail detail = new RetailDetail() { Costume = this.currentSelectedItem.Costume, CostumeID = this.currentSelectedItem.Costume.ID, CostumeName = this.currentSelectedItem.Costume.Name, ColorName = this.skinComboBox_Color.Text, SizeName = ValidateUtil.CheckEmptyValue(this.skinComboBox_Size.SelectedValue), GuideID = defaultGuid, // 显示自己设置的尺码组和对应的尺码列表 SizeDisplayName = CostumeStoreHelper.GetCostumeSizeName(ValidateUtil.CheckEmptyValue(this.skinComboBox_Size.SelectedValue), CommonGlobalCache.GetSizeGroup(this.currentSelectedItem.Costume.SizeGroupName)), IsRefund = true, RefundCount = buyCount, BuyCount = buyCount, Price = this.currentSelectedItem.Costume.Price, SumMoney = this.currentSelectedItem.Costume.Price * buyCount, SumMoneyActual = this.currentSelectedItem.Costume.Price * buyCount, BrandName = ValidateUtil.CheckNotNullValue(currentSelectedItem.Costume.BrandName), // SinglePrice = this.currentSelectedItem.Costume.Price, IsUseTickets = false, ///288 收银时,商品的备注显示的是商品的备注 //Remarks = this.currentSelectedItem.Costume.Remarks, Discount = 100, DiscountOrigin = 100, AllowReviseDiscount = true,//this.currentSelectedStore.AllowReviseDiscount, CostPrice = this.currentSelectedItem.Costume.CostPrice, SumCost = this.currentSelectedItem.Costume.CostPrice * buyCount, }; if (!this.AddSelectedCostumeToList(detail)) { return; } dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(this.retailDetailList)); this.skinTextBox_bugCount.SkinTxt.Text = "1"; } catch (Exception ee) { CommonGlobalUtil.WriteLog(ee); GlobalMessageBox.Show("添加失败!"); } }