/// <summary> /// 删除采购供应目录 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDelete_Click(object sender, EventArgs e) { //提示信息 if (XtraMessageBox.Show("确认删除采购供应目录信息吗?", Constant.MsgTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } string strHitDommId = GetGridViewColValue(this.gVStockList, "ID"); try { StockListBLL.GetInstance().DelOrdHitCommModel(strHitDommId); //刷新数据集 RefreshDt(); XtraMessageBox.Show("采购供应目录信息删除成功!", Constant.MsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); //清空制单时用到供应目录缓存 string strProjectID = LueProject.EditValue.ToString(); string strDataNameByPurchace = Constant.ORDPRODUCT + strProjectID + "经常采购目录"; if (ClientCache.CachedDS.Tables.IndexOf(strDataNameByPurchace) != -1) { ClientCache.CachedDS.Tables.Remove(strDataNameByPurchace); } } catch (Exception ex) { XtraMessageBox.Show("采购供应目录信息删除失败!", Constant.MsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void AddHitComm() { //当采购供应目录不存在该产品时,作新增操作 List <OrdHitCommMode> ListOrdHitCommModel = new List <OrdHitCommMode>(); DataTable Dt = NoSend_OrdInvoiceFromItemDt.DefaultView.ToTable(); foreach (DataRow dr in Dt.Rows) { string strSel = dr["Sel"].ToString(); if (strSel.Equals("1")) { //当该产品不在采购目录表中存在 作增加操作 if (string.IsNullOrEmpty(dr["ordHitCommId"].ToString())) { OrdHitCommMode model = GetOrdHitCommModel(dr); ListOrdHitCommModel.Add(model); } } } //当采购供应目录不存在该产品时,作新增操作 if (ListOrdHitCommModel.Count > 0) { StockListBLL.GetInstance().SaveOrdHitCommListModel(ListOrdHitCommModel, this.CurrentUser); } }
/// <summary> /// 修改保存操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnSave_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(this.txtProductMnemonic.Text)) { if (DefineCodeBLL.GetInstance().DefineCodeIsAddProductMnemonic(this.txtProductMnemonic.Text, strHitCommID)) { XtraMessageBox.Show("自定义编码已存在,请重新输入!", Constant.MsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); this.txtProductMnemonic.Focus(); return; } } if (this.LueSenderName.EditValue == null) { XtraMessageBox.Show("请选择配送商企业!", Constant.MsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } OrdHitCommMode ordHitCommmodel = GetOrdHitCommModel(); List <DefineInfoModel> defineInfoListmodel = new List <DefineInfoModel>(); DefineInfoModel defineInfoModel = GetDefineInfoModel(); defineInfoListmodel.Add(defineInfoModel); try { StockListBLL.GetInstance().PostOrdHitCommInfo(ordHitCommmodel, CurrentUser); DefineCodeBLL.GetInstance().OperatorDefineInfoList(defineInfoListmodel, CurrentUser); XtraMessageBox.Show("采购目录信息修改成功!", Constant.MsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); this.EditFlag = true; this.Close(); } catch (Exception ex) { XtraMessageBox.Show("采购目录信息修改失败!", Constant.MsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// 数据绑定 /// </summary> private void DataBind() { //获取所选择项目类型 string strProjectID = string.Empty; if (LueProject.EditValue != null) { strProjectID = LueProject.EditValue.ToString(); } //使用缓存 获取采购目录查询数据集 string strDataName = Constant.HITCOMMTABLE + strProjectID; //使用缓存 获取采购目录查询数据集 if (ClientCache.CachedDS.Tables.IndexOf(strDataName) == -1) { DataTable tempDt = new DataTable(strDataName); //获取采购目录查询数据集 tempDt = StockListBLL.GetInstance().GetStockList(CurrentUser, strProjectID, strDataName); HitCommDt = tempDt.Copy(); if (ClientCache.CachedDS.Tables.IndexOf(strDataName) != -1) { ClientCache.CachedDS.Tables.Remove(strDataName); } ClientCache.CachedDS.Tables.Add(HitCommDt); } //存入缓存 InitFromCacheByData(strDataName); //从缓存取数据集绑定到GRID bindingDsHitComm(); }
public ViewStockListForm(string HitCommID) { InitializeComponent(); strHitCommID = HitCommID; ordHitCommModel = StockListBLL.GetInstance().GetOrdHitCommModel(HitCommID); }