public void LoadDETAIL() { string _tbxINV_ID = tbxINV_ID.Text; if (!String.IsNullOrEmpty(_tbxINV_ID)) { List <ConditionFun.SqlqueryCondition> conditiondetail = new List <ConditionFun.SqlqueryCondition>(); conditiondetail.Add(new ConditionFun.SqlqueryCondition(ConstraintType.Where, Inventory01Table.INV_ID, Comparison.Equals, _tbxINV_ID, false, false)); Inventory01Bll.GetInstence().BindGrid(Grid2, 0, 0, conditiondetail, sortList); } }
/// <summary> /// 子表保存 /// </summary> /// <returns></returns> public string DetailEdit() { JArray jarr = Grid2.GetMergedData(); var OlUser = OnlineUsersBll.GetInstence().GetModelForCache(x => x.UserHashKey == Session[OnlineUsersTable.UserHashKey].ToString()); string result = ""; int n = 0; for (int i = 0; i < jarr.Count; i++) { try { int id = ConvertHelper.Cint(jarr[i]["values"]["Id01"].ToString()); var model2 = new Inventory01(x => x.Id == id); //string str = jarr[i]["status"].ToString(); if (jarr[i]["status"].ToString().Equals("modified")) { model2.SetIsNew(false); } //else if (jarr[i]["status"].ToString().Equals("unchanged")) //{ // continue; //} else { model2.SetIsNew(true); } model2.SHOP_ID = jarr[i]["values"]["SHOP_ID01"].ToString(); if (!String.IsNullOrEmpty(tbxINV_ID.Text)) { model2.INV_ID = tbxINV_ID.Text; } else { return("保存失败"); } model2.SNo = ConvertHelper.Cint(jarr[i]["values"]["SNo01"].ToString()); model2.PROD_ID = jarr[i]["values"]["PROD_ID01"].ToString(); model2.QUANTITY = ConvertHelper.Cdbl(jarr[i]["values"]["QUANTITY01"].ToString()); model2.QUAN = ConvertHelper.Cdbl(jarr[i]["values"]["QUAN01"].ToString()); model2.QUAN1 = ConvertHelper.Cint(jarr[i]["values"]["QUAN101"].ToString()); model2.QUAN2 = ConvertHelper.Cdbl(jarr[i]["values"]["QUAN201"].ToString()); model2.QUAN_B = ConvertHelper.Cdbl(jarr[i]["values"]["QUAN_B01"].ToString()); model2.MEMO = jarr[i]["values"]["MEMO01"].ToString(); Inventory01Bll.GetInstence().Save(this, model2); } catch (Exception err) { n++; result = "明细保存失败" + n + "条"; } } LoadDETAIL(); return(result); }