/// <summary> /// 数据绑定 /// </summary> private void DataBind() { //获取当取用户对象 CurrentUser = base.CurrentUser; //获取发货单列表数据集 OrdInvoiceFromDt = OrdInvoiceBLL.GetInstance().GetOrdInvoiceFromList(); this.bindingSource1.DataSource = OrdInvoiceFromDt.DefaultView; }
/// <summary> /// 数据绑定发货单明细 /// </summary> private void DataBind(string StrInvoiceFromId) { //获取发货单明细列表数据集 OrdInvoiceFromItemDt = OrdInvoiceBLL.GetInstance().GetOrdInvoiceFromItemList(StrInvoiceFromId); //排序 OrdInvoiceFromItemDt.DefaultView.Sort = " Send_Operate_Date DESC"; if (OrdInvoiceFromItemDt != null) { this.BsInvoiceItem.DataSource = OrdInvoiceFromItemDt.DefaultView; } }
/// <summary> /// 到货事件操作 1、修改明细表中状态 到货数量、入库批次 2、做采购单 订单 备货 到货流程 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnReceive_Click(object sender, EventArgs e) { string strError = string.Empty; if (!Validata(out strError)) { XtraMessageBox.Show(strError, Constant.MsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } //提示信息 //if (XtraMessageBox.Show("确认是否作到货操作?", Constant.MsgTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) // return; try { //0、添加到采购供应目录中 AddHitComm(); //1、修改明细表中状态 到货数量、入库批次 ListOrdInvoiceFromItemModel = GetListOrdInvoiceFromItemModel(); OrdInvoiceBLL.GetInstance().ModifyOrdInvoiceFromItemState(ListOrdInvoiceFromItemModel, StrInvoiceFromId, "2", CurrentUser); //2、走发货流程 ListOrdSecondAyrlnvUseModel = GetListOrdSecondAyrlnvUseModelToAudi(); OrdSecondAyrlnvUseBLL.GetInstance().OrdInvoiceFrom(ListOrdSecondAyrlnvUseModel, ordPurchaseModel, ordOrderModel, CurrentUser); //刷新数据 DataBind(StrInvoiceFromId); DataBind_SendList(); XtraMessageBox.Show("到货操作成功!", Constant.MsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); //刷新标头显示数据 IniData(StrInvoiceFromId); EditFlag = true;//设置已修改状态 } catch (Exception ex) { XtraMessageBox.Show("到货操作失败!", Constant.MsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// 初始化订单标题信息 /// </summary> /// <param name="StrInvoiceFromId"></param> private void IniData(string StrInvoiceFromId) { OrdInvoiceFromModel ordInvoiceFromModel = OrdInvoiceBLL.GetInstance().GetOrdInvoiceFromModel(StrInvoiceFromId); if (ordInvoiceFromModel != null) { this.lbl_Invoice_Code.Text = ordInvoiceFromModel.Invoice_Code; this.lbl_Create_Name.Text = ordInvoiceFromModel.Create_User_Name; this.lbl_Create_Date.Text = ordInvoiceFromModel.Create_Date; this.lbl_Modify_Name.Text = ordInvoiceFromModel.Modify_User_Name; this.lbl_Modify_Date.Text = ordInvoiceFromModel.Modify_Date; this.lbl_Sender_Name.Text = ordInvoiceFromModel.Sender_Name; this.lbl_StateName.Text = ordInvoiceFromModel.StateName; this.lbl_Total_Sum.Text = base.SetNumFormat(ordInvoiceFromModel.Total_Sum); this.lbl_Over_Sum.Text = base.SetNumFormat(ordInvoiceFromModel.Over_Sum); this.lbl_buyer_Remark.Text = ordInvoiceFromModel.Buyer_Descriptions; this.lbl_saler_Remark.Text = ordInvoiceFromModel.Saler_Descriptions; } }
/// <summary> /// 作废事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnBlank_Click(object sender, EventArgs e) { //判断是否为空数据集 if (this.gvInvoiceList.RowCount == 0) { return; } //发货单状态 string strState = GetGridViewColValue(this.gvInvoiceList, "STATE"); if (strState.Equals("5") || strState.Equals("4"))//作废状态 买方确认完成 { XtraMessageBox.Show("发货单已完成,不能进行作废操作!", Constant.MsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } //提示信息 if (XtraMessageBox.Show("确认是否对该发货单作废?", Constant.MsgTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } try { //发货单ID string strInvoiceID = GetGridViewColValue(this.gvInvoiceList, "ID"); OrdInvoiceFromModel model = new OrdInvoiceFromModel(); model.Id = strInvoiceID; OrdInvoiceBLL.GetInstance().ModifyOrdInvoiceFromState(model, "4", this.CurrentUser); RefreshDt(strInvoiceID); XtraMessageBox.Show("发货单作废成功!", Constant.MsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { XtraMessageBox.Show("发货单作废失败!", Constant.MsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); } }