ztl 2 лет назад
Родитель
Сommit
b3bf2ab881

+ 1 - 1
DK.Client/SystemModule/F_MST_1003.cs

@@ -379,7 +379,7 @@ namespace Dongke.IBOSS.PRD.Client.SystemModule
 				}
 				try
 				{
-				if (this.dgvGoods.DataSource != null)
+				if (this.dgvGoods.DataSource != null&&this.dgvGoods.CurrentRow != null)
 				{
 					int goodsid = Convert.ToInt32(this.dgvGoods.CurrentRow.Cells["GoodsID"].Value);
 					int logoid = Convert.ToInt32(this.dgvGoodsSap.CurrentRow.Cells["logoid"].Value);

+ 2 - 0
DK.Client/SystemModule/F_MST_1013.Designer.cs

@@ -170,8 +170,10 @@ namespace Dongke.IBOSS.PRD.Client.SystemModule
 			this.dgvDataAccess.HorizontalMergeColumn = null;
 			this.dgvDataAccess.IsAutoCountSum = true;
 			this.dgvDataAccess.IsAutoResizeColumns = false;
+			this.dgvDataAccess.IsCanDelete = true;
 			this.dgvDataAccess.IsClickF12 = false;
 			this.dgvDataAccess.IsOpenMergeCellFlag = false;
+			this.dgvDataAccess.IsShowDelete = true;
 			this.dgvDataAccess.IsSubTotalFlag = false;
 			this.dgvDataAccess.IsTopDeep = false;
 			this.dgvDataAccess.Location = new System.Drawing.Point(48, 66);

+ 5 - 4
DK.Client/SystemModule/F_MST_1013.cs

@@ -68,7 +68,6 @@ namespace Dongke.IBOSS.PRD.Client.SystemModule
 				ds.Tables.Add(tb);
 				cre.Data = ds;
 
-
 				// 调用服务器端获取数据集
 				ServiceResultEntity sre = SystemModuleProxy.Service.DoRequest(cre);
 				if (sre != null && sre.Data != null && sre.Data.Tables.Count > 0)
@@ -86,7 +85,8 @@ namespace Dongke.IBOSS.PRD.Client.SystemModule
 		//保存事件
 		private void btnSave_Click(object sender, EventArgs e)
 		{
-				if (this.GOODSCODE.SelectedValue.ToString() == string.Empty)
+				((DataTable)this.dgvDataAccess.DataSource).AcceptChanges();
+			if (this.GOODSCODE.SelectedValue.ToString() == string.Empty)
 				{
 					this.GOODSCODE.Focus();
 					MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "产品编码"),
@@ -111,7 +111,7 @@ namespace Dongke.IBOSS.PRD.Client.SystemModule
 										this.Text,
 										MessageBoxButtons.OK,
 										MessageBoxIcon.Information,
-										MessageBoxDefaultButton.Button1);
+										MessageBoxDefaultButton.Button1); 
 							return;
 						}
 						if (gvrAcc.Cells["ACCESSORIESCODE"].Value == null || gvrAcc.Cells["ACCESSORIESCODE"].Value == DBNull.Value)
@@ -127,7 +127,8 @@ namespace Dongke.IBOSS.PRD.Client.SystemModule
 				}
 			if (this._formStatus == Constant.FormMode.Edit)
 			{
-				DataTable dtAcc = this.dgvDataAccess.CurrentDataTable.DataSet.Tables[0];
+				this.dgvDataAccess.CurrentRow.ErrorText = string.Empty;
+				DataTable dtAcc = (DataTable)this.dgvDataAccess.DataSource;
 
 				ClientRequestEntity cre = new ClientRequestEntity();
 				cre.NameSpace = "EditGoods";