/// <summary> /// 修改入库方式 /// </summary> public void ShowSapBill() { ASNHeaderEntity header = IParent.GetFocusedBill(); if (header == null) { MsgBox.Warn("请选中要查看的单据行!"); return; } //FrmShowSapAsn frmSapBill = new FrmShowSapAsn(header.BillNO); //frmSapBill.ShowDialog(); }
public void DoCloseBill() { List <ASNHeaderEntity> focusedBills = IParent.GetFocusedBills(); if (focusedBills == null || focusedBills.Count == 0) { MsgBox.Warn("请选中要收货完成的单据。"); return; } if (MsgBox.AskOK(string.Format("一共选中了“{0}”个单据“{1}”,确定要将单据设置收货完成(关闭单据)吗?", focusedBills.Count, GetBillNOs(focusedBills))) != DialogResult.OK) { return; } try { foreach (ASNHeaderEntity header in focusedBills) { int result = asnDal.SetStatusToPutawayComplete(header.BillID, GlobeSettings.LoginedUser.UserName); ASNHeaderEntity _header = asnDal.GetLastestHeaderStatus(header.BillID); if (result == 0) { //从服务器重新获取单据信息,并更新界面 header.UpdateState(_header); } else if (result == -1) { MsgBox.Warn(string.Format("单据“{0}”的当前状态为{1},无法设置为完成,请刷新后重试。", header.BillNO, _header.StatusName)); break; } else if (result == -2) { MsgBox.Warn(string.Format("单据“{0}”仍有已验收的物料没有上架,无法设置为收获完成状态。", header.BillNO)); break; } else { MsgBox.Warn(string.Format("单据“{0}”无法设置为完成,请检查组分料的每一项上架数量是否完全一样。", header.BillNO)); break; } } IParent.RefreshHeaderGrid(); } catch (Exception ex) { MsgBox.Err(ex.Message); } }
/// <summary> /// 显示单据状态更新日志 /// </summary> /// <param name="billID"></param> public void ShowBillLog() { ASNHeaderEntity header = IParent.GetFocusedBill(); if (header == null) { MsgBox.Warn("请选中要查看的行。"); } else { //FrmViewBillLog frmLog = new FrmViewBillLog(header.BillID, header.BillID); //frmLog.ShowDialog(); } }
string IsSelectedBill() { ASNHeaderEntity header = IParent.GetFocusedBill(); if (header == null) { MsgBox.Warn("请选中要查看的行。"); return(null); } else { return(header.BillID); } }
public void ShowFocusDetail() { ASNHeaderEntity selectedHeader = SelectedHeader; if (selectedHeader == null) { gridDetails.DataSource = null; gvDetails.ViewCaption = "未选择单据"; } else { gridDetails.DataSource = asnDal.GetDetailsByBillID(selectedHeader.BillID); gvDetails.ViewCaption = string.Format("单据号: {0}", selectedHeader.BillNO); } }
/// <summary> /// 利用RowCellStyle给特殊的行标记字体颜色 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnHeaderRowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e) { GridView vw = (sender as GridView); try { ASNHeaderEntity header = vw.GetRow(e.RowHandle) as ASNHeaderEntity; if (header != null) { if (header.RowBackgroundColor != null) { e.Appearance.ForeColor = Color.FromArgb(header.RowBackgroundColor.Value); } } } catch (Exception ex) { } }
public void WriteWMSRemark() { ASNHeaderEntity header = IParent.GetFocusedBill(); if (header == null) { MsgBox.Warn("请选中要修改的单据。"); } else { //FrmEditAsn frmEdit = new FrmEditAsn(header); //if (frmEdit.ShowDialog() == DialogResult.OK) //{ // //刷新界面显示 // header.UpdateRemark(asnDal.GetHeaderInfoByBillID(header.BillID)); //} } }
/// <summary> /// 修改入库方式 /// </summary> public void ChangeInboundStyle() { ASNHeaderEntity header = IParent.GetFocusedBill(); if (header == null) { MsgBox.Warn("请选中要修改的单据行!"); return; } if (SysCodeConstant.ASN_STATUS_AWAIT_CHECK != header.Status) { MsgBox.Warn("只有等待验收状态的单据才能制定入库策略!"); return; } //FrmStrategyDialog frmStrategyDialog = new FrmStrategyDialog(header); //frmStrategyDialog.dataSourceChanged += OnEditChanage; //frmStrategyDialog.ShowDialog(); }
/// <summary> /// 从列表中移除 /// </summary> /// <param name="header"></param> public void RemoveBill(ASNHeaderEntity header) { bindingSource1.Remove(header); }