private void btnCancel_Click(object sender, EventArgs e) { try { BillHandler.CancelMaterialAsk(_db, _bill.VWToBill(GlobalVar.Oper.DeptCode)); NotifyController.AddNotify(_db, _bill.操作者, NotifyType.MaterialOutCancel, _bill.单据编号, ""); EntitiesFactory.SaveDb(_db); SetMasterDataSource(grid.PageIndex, grid.PageSize); } catch (Exception ex) { MessageHelper.ShowError(ex.ToString()); } }
private void btnExecute_Click(object sender, EventArgs e) { if (_bill == null || _bill.单据编号 == null) { MessageHelper.ShowInfo("请选择单据!"); return; } if (MessageHelper.ShowQuestion("确定要执行选定的领用还回单?") == DialogResult.Yes) { SpareEntities db = EntitiesFactory.CreateSpareInstance(); BillHandler.ExecuteSpareReturn(db, _bill.VWToBill(GlobalVar.Oper.DeptCode), (List <TB_RETURN>)(grid.Detail1DataSource)); EntitiesFactory.SaveDb(db); MessageHelper.ShowInfo("保存成功!"); } }
private void BtnSave_Click(object sender, EventArgs e) { try { bs.EndEdit(); if (_bill.单据类型 != (int)BillType.StockMove) { MessageHelper.ShowError("请输入有效的单据类型!移库单据类型为:" + (int)BillType.StockMove); return; } var detailList = (List <TB_STOCK_MOVE>)bs.DataSource; if (detailList.Count == 0) { MessageHelper.ShowError("请维护移动明细!"); return; } SpareEntities db = EntitiesFactory.CreateSpareInstance(); BillHandler.AddStockMove(db, _bill.VWToBill(GlobalVar.Oper.DeptCode), detailList); EntitiesFactory.SaveDb(db); MessageHelper.ShowInfo("保存成功!"); } catch (Exception ex) { MessageHelper.ShowInfo(ex.ToString()); } }
private void BtnSave_Click(object sender, EventArgs e) { try { bs.EndEdit(); if (_bill.单据类型 != (int)BillType.OtherInOut) { MessageHelper.ShowError("请输入有效的单据类型!其他出入库单据类型为:" + (int)BillType.OtherInOut); return; } if (_bill.子单据类型 != (int)SubBillType.OtherIn) { MessageHelper.ShowError("维护的子单据类型无效!其他入库类型为:" + (int)SubBillType.OtherIn); return; } var detailList = (List <TB_OTHER_IN>)bs.DataSource; if (detailList.Count == 0) { MessageHelper.ShowError("请维护其他入库明细!"); return; } SpareEntities db = EntitiesFactory.CreateSpareInstance(); BillHandler.AddOtherIn(db, _bill.VWToBill(GlobalVar.Oper.DeptCode), detailList); EntitiesFactory.SaveDb(db); NotifyController.AddStockSafeQty(db, GlobalVar.Oper.OperName); MessageHelper.ShowInfo("保存成功!"); } catch (Exception ex) { MessageHelper.ShowInfo(ex.ToString()); } }
private void BtnSave_Click(object sender, EventArgs e) { try { bs.EndEdit(); if (_bill.单据类型 != (int)BillType.SpareReturn) { MessageHelper.ShowError("请输入有效的单据类型!领用归还单据类型为:" + (int)BillType.SpareReturn); return; } var detailList = (List <TB_RETURN>)bs.DataSource; if (detailList.Count == 0) { MessageHelper.ShowError("请维护领用还回明细!"); return; } //List<TB_RETURN> detailList = (from TB_RETURN d in _list select d).ToList(); SpareEntities db = EntitiesFactory.CreateSpareInstance(); BillHandler.AddMaterialReturn(db, _bill.VWToBill(GlobalVar.Oper.DeptCode), detailList); EntitiesFactory.SaveDb(db); MessageHelper.ShowInfo("保存成功!"); } catch (Exception ex) { MessageHelper.ShowInfo(ex.ToString()); } }
private void BtnSave_Click(object sender, EventArgs e) { try { bs.EndEdit(); if (_bill.单据类型 != (int)BillType.MaterialAsk) { MessageHelper.ShowError("请输入有效的单据类型!申请单单据类型为:" + (int)BillType.MaterialAsk); return; } if (_bill.子单据类型 != (int)SubBillType.SpareLoan && _bill.子单据类型 != (int)SubBillType.SpareOut) { MessageHelper.ShowError("维护的子单据类型无效!领用出库类型为:" + (int)SubBillType.SpareOut + "借用出库类型为:" + (int)SubBillType.SpareLoan); return; } var detailList = (List <TB_ASK>)bs.DataSource; if (detailList.Count == 0) { MessageHelper.ShowError("请维护领用申请明细!"); return; } var bill = _bill.VWToBill(GlobalVar.Oper.DeptCode); //List<TB_ASK> detailList = (from TB_ASK d in _list select d).ToList(); SpareEntities db = EntitiesFactory.CreateSpareInstance(); BillHandler.AddMaterialAsk(db, bill, detailList); EntitiesFactory.SaveDb(db); MessageHelper.ShowInfo("保存成功!"); } catch (Exception ex) { MessageHelper.ShowInfo(ex.ToString()); } }
private void btnSave_Click(object sender, EventArgs e) { try { bs.EndEdit(); var detailList = (List <TB_INVENTORY_DETAIL>)bs.DataSource; SpareEntities db = EntitiesFactory.CreateSpareInstance(); BillHandler.AddOrUpdateInventoryDetail(db, _bill.VWToBill(GlobalVar.Oper.DeptCode), detailList); EntitiesFactory.SaveDb(db); MessageHelper.ShowInfo("保存成功!"); } catch (Exception ex) { MessageHelper.ShowInfo(ex.ToString()); } }
private void btnExecute_Click(object sender, EventArgs e) { if (_bill == null || _bill.单据编号 == null) { MessageHelper.ShowInfo("请选择单据!"); return; } if (MessageHelper.ShowQuestion("确定要执行选定的领用还回单?") == DialogResult.Yes) { SpareEntities db = EntitiesFactory.CreateSpareInstance(); var returnlist = db.TB_RETURN.Where(p => p.BillNum == _bill.单据编号).ToList(); BillHandler.ExecuteSpareReturn(db, _bill.VWToBill(GlobalVar.Oper.DeptCode), returnlist); EntitiesFactory.SaveDb(db); NotifyController.AddStockSafeQty(db, GlobalVar.Oper.OperName); MessageHelper.ShowInfo("保存成功!"); } }
private void btnSave_Click(object sender, EventArgs e) { try { bs.EndEdit(); if (_bill.单据类型 != (int)BillType.InventoryPlan) { MessageHelper.ShowError("请输入有效的单据类型!盘点单据类型为:" + (int)BillType.InventoryPlan); return; } var detailList = new List <TB_INVENTORY_LOC>(); foreach (var group in _listGroup) { if (group.IsCheck) { var loclist = _db.TA_STORE_LOCATION.Where(p => p.GroupCode == group.GroupCode).ToList(); foreach (var loc in loclist) { var detail = new TB_INVENTORY_LOC() { LocCode = loc.LocCode, BillTime = DateTime.Now, State = 0 }; detailList.Add(detail); } } } if (detailList.Count == 0) { MessageHelper.ShowError("请选择要盘点的库位!"); return; } //List<TB_ASK> detailList = (from TB_ASK d in _list select d).ToList(); SpareEntities db = EntitiesFactory.CreateSpareInstance(); BillHandler.AddInventoryLoc(db, _bill.VWToBill(GlobalVar.Oper.DeptCode), detailList); EntitiesFactory.SaveDb(db); MessageHelper.ShowInfo("保存成功!"); } catch (Exception ex) { MessageHelper.ShowInfo(ex.ToString()); } }
public FormInventoryPlan() { InitializeComponent(); _report = ReportHelper.InitReport(_billType); _report.Initialize += () => ReportHelper._report_Initialize(_report, _bill.VWToBill(GlobalVar.Oper.DeptCode), DetailTableName, IndexColumnName); }