// JObject here is very very important... public ActionResult <string> Post([FromBody] JObject entityObj) { ORDER_DETAIL_MST postedEntity = entityObj.ToObject <ORDER_DETAIL_MST>(); var orderListEntity = myContext.ORDER_LIST_MST.Where(d => d.ORDER_NO != null); if (!String.IsNullOrEmpty(postedEntity.ORDER_NO)) { orderListEntity = orderListEntity.Where(d => d.ORDER_NO.Equals(postedEntity.ORDER_NO)); } if (orderListEntity.Count() == 0) { // INSERT myContext.ORDER_LIST_MST.Add(postedEntity); myContext.SaveChanges(); return(""); } else { orderListEntity.First().CONTRACT_NO = postedEntity.CONTRACT_NO; orderListEntity.First().PROJECT_NM = postedEntity.PROJECT_NM; orderListEntity.First().ORDER_UNIT = postedEntity.ORDER_UNIT; orderListEntity.First().SALES_PERSON = postedEntity.SALES_PERSON; orderListEntity.First().DEPARTURE_DATE = postedEntity.DEPARTURE_DATE.ToLocalTime(); orderListEntity.First().DELIVERY_DATE = postedEntity.DELIVERY_DATE.ToLocalTime(); orderListEntity.First().REMARK = postedEntity.REMARK; orderListEntity.First().APPLICATION_ENGINEER = postedEntity.APPLICATION_ENGINEER; myContext.SaveChanges(); return(""); } }
// JObject here is very very important... public ActionResult <string> Post([FromBody] JObject entityObj) { ORDER_LIST_ATTACHMENT postedEntity = entityObj.ToObject <ORDER_LIST_ATTACHMENT>(); // 校验主键 if (String.IsNullOrEmpty(postedEntity.ORDER_NO)) { return(""); } var orderListEntity = myContext.ORDER_LIST_ATTACHMENT.Where(d => d.ORDER_NO.Equals(postedEntity.ORDER_NO)); if (orderListEntity.Count() == 0) { // INSERT myContext.ORDER_LIST_ATTACHMENT.Add(postedEntity); myContext.SaveChanges(); return(""); } else { orderListEntity.First().QUALIFICATION = postedEntity.QUALIFICATION; orderListEntity.First().IDENTIFICATION = postedEntity.IDENTIFICATION; orderListEntity.First().PRODUCT_SAMPLE = postedEntity.PRODUCT_SAMPLE; orderListEntity.First().DYNAMIC_REPORT = postedEntity.DYNAMIC_REPORT; orderListEntity.First().STATIC_REPORT = postedEntity.STATIC_REPORT; orderListEntity.First().PERFORMANCE_REPORT = postedEntity.PERFORMANCE_REPORT; orderListEntity.First().BLUEPRINT = postedEntity.BLUEPRINT; orderListEntity.First().PERFORMANCE_CURVE = postedEntity.PERFORMANCE_CURVE; orderListEntity.First().OTHER = postedEntity.OTHER; myContext.SaveChanges(); return(""); } }
// JObject here is very very important... public ActionResult <string> Post([FromBody] JObject entityObj) { M_DICT postedEntity = entityObj.ToObject <M_DICT>(); // 校验主键 if (String.IsNullOrEmpty(postedEntity.DICT_ID)) { return(""); } var orderListEntity = myContext.M_DICT.Where(d => d.DICT_ID.Equals(postedEntity.DICT_ID)); if (orderListEntity.Count() == 0) { // INSERT myContext.M_DICT.Add(postedEntity); myContext.SaveChanges(); return(""); } else { orderListEntity.First().DICT_ID = postedEntity.DICT_ID; orderListEntity.First().DICT_NAME = postedEntity.DICT_NAME; orderListEntity.First().TYPE = postedEntity.TYPE; orderListEntity.First().TYPE_NAME = postedEntity.TYPE_NAME; myContext.SaveChanges(); return(""); } }
public ActionResult <string> Delete(string BUMP_TYPE) { Boolean isSuccess = true; string data = "Delete success"; if (!String.IsNullOrEmpty(BUMP_TYPE)) { String[] BUMP_TYPE_LIST = BUMP_TYPE.Split(","); String[] RESULTS_BUMP_TYPE_LIST = new String [BUMP_TYPE_LIST.Length]; for (int i = 0; i < BUMP_TYPE_LIST.Length; i++) { RESULTS_BUMP_TYPE_LIST[i] = BUMP_TYPE_LIST[i].Replace('*', '/'); } foreach (string BUMP_ITEM in RESULTS_BUMP_TYPE_LIST) { OTHER_COMPONENT_MODEL_MST delMstEntity = new OTHER_COMPONENT_MODEL_MST() { BUMP_TYPE = BUMP_ITEM }; if (delMstEntity.Equals(null)) { isSuccess = false; data = "No such data."; break; } else { // FIND DB ITEM myContext.OTHER_COMPONENT_MODEL_MST.Attach(delMstEntity); // DELETE DB ITEM var delRes = myContext.OTHER_COMPONENT_MODEL_MST.Remove(delMstEntity); if (delRes.State == EntityState.Deleted) { // SAVE CHANGES AND DO NOT RETURN myContext.SaveChanges(); } else { isSuccess = false; data = "No such data."; break; } } } } else { isSuccess = false; data = "No such data."; } JsonRes res = new JsonRes(); res.isSuccess = isSuccess; res.data = data; return(JsonConvert.SerializeObject(res)); }
public ActionResult <string> Delete(string ID) { Boolean isSuccess = true; string data = "Delete success"; if (!String.IsNullOrEmpty(ID)) { String[] ID_LIST = ID.Split(","); foreach (string RESULTS_ITEM in ID_LIST) { ABD_INTEGRATE_SEAL_MST delMstEntity = new ABD_INTEGRATE_SEAL_MST() { ID = Convert.ToInt32(RESULTS_ITEM) }; if (delMstEntity.Equals(null)) { isSuccess = false; data = "No such data."; break; } else { // FIND DB ITEM myContext.ABD_INTEGRATE_SEAL_MST.Attach(delMstEntity); // DELETE DB ITEM var delRes = myContext.ABD_INTEGRATE_SEAL_MST.Remove(delMstEntity); if (delRes.State == EntityState.Deleted) { // SAVE CHANGES AND DO NOT RETURN myContext.SaveChanges(); } else { isSuccess = false; data = "No such data."; break; } } } } else { isSuccess = false; data = "No such data."; } JsonRes res = new JsonRes { isSuccess = isSuccess, data = data }; return(JsonConvert.SerializeObject(res)); }
public ActionResult <string> Delete(int SeqID) { Boolean isSuccess = true; string data = "Delete success"; if (!String.IsNullOrEmpty(SeqID.ToString())) { int ID = Convert.ToInt32(SeqID); ACCESSORIES_TEMPLATE delEntity = new ACCESSORIES_TEMPLATE() { SEQ_ID = ID }; if (delEntity.Equals(null)) { isSuccess = false; data = "No such data."; } else { // FIND DB ITEM myContext.ACCESSORIES_TEMPLATE.Attach(delEntity); // DELETE DB ITEM var delRes = myContext.ACCESSORIES_TEMPLATE.Remove(delEntity); if (delRes.State == EntityState.Deleted) { // SAVE CHANGES AND DO NOT RETURN myContext.SaveChanges(); } else { isSuccess = false; data = "No such data."; } } } else { isSuccess = false; data = "No such data."; } JsonRes res = new JsonRes(); res.isSuccess = isSuccess; res.data = data; return(JsonConvert.SerializeObject(res)); }
// JObject here is very very important... public ActionResult <string> Post([FromBody] JObject entityObj) { ORDER_LIST_MST postedEntity = entityObj.ToObject <ORDER_LIST_MST>(); // 校验主键 if (String.IsNullOrEmpty(postedEntity.ORDER_NO)) { return(""); } var orderListEntity = myContext.ORDER_LIST_MST.Where(d => d.ORDER_NO.Equals(postedEntity.ORDER_NO)); if (orderListEntity.Count() == 0) { // INSERT myContext.ORDER_LIST_MST.Add(postedEntity); myContext.SaveChanges(); return(""); } else { orderListEntity.First().CONTRACT_NO = postedEntity.CONTRACT_NO; orderListEntity.First().PROJECT_NM = postedEntity.PROJECT_NM; orderListEntity.First().ORDER_UNIT = postedEntity.ORDER_UNIT; orderListEntity.First().SALES_PERSON = postedEntity.SALES_PERSON; orderListEntity.First().DEPARTURE_DATE = postedEntity.DEPARTURE_DATE.ToLocalTime(); orderListEntity.First().DELIVERY_DATE = postedEntity.DELIVERY_DATE.ToLocalTime(); orderListEntity.First().REMARK = postedEntity.REMARK; orderListEntity.First().APPLICATION_ENGINEER = postedEntity.APPLICATION_ENGINEER; orderListEntity.First().DEBUG = postedEntity.DEBUG; orderListEntity.First().TOTAL_QTY = postedEntity.TOTAL_QTY; orderListEntity.First().TEX_RATE = postedEntity.TEX_RATE; orderListEntity.First().GUARANTEE_DATE = postedEntity.GUARANTEE_DATE; orderListEntity.First().TOTAL_AMT = postedEntity.TOTAL_AMT; orderListEntity.First().PAYMENT = postedEntity.PAYMENT; orderListEntity.First().TARGET_PRICE = postedEntity.TARGET_PRICE; orderListEntity.First().DISCOUNT = postedEntity.DISCOUNT; orderListEntity.First().CHANGE_HIS1 = postedEntity.CHANGE_HIS1; orderListEntity.First().CHANGE_HIS2 = postedEntity.CHANGE_HIS2; myContext.SaveChanges(); return(""); } }
public ActionResult <string> Delete(string BUMP_INFO) { Boolean isSuccess = true; string data = "Delete success"; if (!String.IsNullOrEmpty(BUMP_INFO)) { string[] ORDER_NO_AND_BUMP_IDS = BUMP_INFO.Replace("|SLASH|", "/").Split("|DASH|"); string[] BUMP_ID_LIST = { }; string ORDER_NO_T = String.Empty; if (ORDER_NO_AND_BUMP_IDS.Length > 1) { ORDER_NO_T = ORDER_NO_AND_BUMP_IDS[0]; BUMP_ID_LIST = ORDER_NO_AND_BUMP_IDS[1].Split(","); } else { isSuccess = false; data = "Need more arguments."; } foreach (string BUMP_ID_T in BUMP_ID_LIST) { ORDER_LIST_DETAIL delEntity = new ORDER_LIST_DETAIL() { BUMP_ID = BUMP_ID_T, ORDER_NO = ORDER_NO_T }; if (delEntity.Equals(null)) { isSuccess = false; data = "No such data."; break; } else { // FIND DB ITEM myContext.ORDER_LIST_DETAIL.Attach(delEntity); // DELETE DB ITEM var delRes = myContext.ORDER_LIST_DETAIL.Remove(delEntity); if (delRes.State == EntityState.Deleted) { // SAVE CHANGES AND DO NOT RETURN myContext.SaveChanges(); } else { isSuccess = false; data = "No such data."; break; } } } } else { isSuccess = false; data = "No such data."; } JsonRes res = new JsonRes(); res.isSuccess = isSuccess; res.data = data; return(JsonConvert.SerializeObject(res)); }
public ActionResult <string> Delete(string ORDER_NO) { Boolean isSuccess = true; string data = "Delete success"; if (!String.IsNullOrEmpty(ORDER_NO)) { String[] ORDER_NO_LIST = ORDER_NO.Replace("|SLASH|", "/").Split(","); foreach (string ORDER_ITEM in ORDER_NO_LIST) { ORDER_LIST_MST delMstEntity = new ORDER_LIST_MST() { ORDER_NO = ORDER_ITEM }; if (delMstEntity.Equals(null)) { isSuccess = false; data = "No such data."; break; } else { // FIND ORDER DETAIL /* * int deteilNum = myContext.ORDER_LIST_DETAIL.Count(d => d.ORDER_NO == ORDER_ITEM); * if (deteilNum > 0) * { * isSuccess = false; * data = ORDER_ITEM + " has detail info."; * break; * } */ // FIND DB ITEM myContext.ORDER_LIST_MST.Attach(delMstEntity); // DELETE DB ITEM myContext.ORDER_LIST_MST.Remove(delMstEntity); // DELETE DETAIL ITEM int deteilNum = myContext.ORDER_LIST_DETAIL.Count(d => d.ORDER_NO == ORDER_ITEM); if (deteilNum > 0) { foreach (ORDER_LIST_DETAIL DetailEntity in myContext.ORDER_LIST_DETAIL.Where(d => d.ORDER_NO == ORDER_ITEM).ToList()) { myContext.ORDER_LIST_DETAIL.Remove(DetailEntity); } } // NEED TO CHECK DELETE RESULT HERE if (true) { // SAVE CHANGES AND DO NOT RETURN myContext.SaveChanges(); } else { isSuccess = false; data = "No such data."; break; } } } } else { isSuccess = false; data = "No such data."; } JsonRes res = new JsonRes(); res.isSuccess = isSuccess; res.data = data; return(JsonConvert.SerializeObject(res)); }
public ActionResult <string> UploadFile() { try { var file = Request.Form.Files[0]; string folderName = "UploadExcel"; string contentRootPath = _hostingEnvironment.ContentRootPath; string newPath = Path.Combine(contentRootPath, folderName); if (!Directory.Exists(newPath)) { Directory.CreateDirectory(newPath); } if (file.Length > 0) { string fileName = ContentDispositionHeaderValue.Parse(file.ContentDisposition).FileName.Trim('"'); string fullPath = Path.Combine(newPath, fileName); using (FileStream stream = new FileStream(fullPath, FileMode.Create)) { file.CopyTo(stream); IWorkbook workbook = WorkbookFactory.Create(stream); ISheet sheet = workbook.GetSheetAt(0); if (sheet != null) { int iRowCount = sheet.LastRowNum; /* * BOM信息 */ // BOM编号 String BOM_ID = DateTime.Now.ToString("yyyyMMddHHmmss"); bool bIsStandard = false; bool bIsBase = false; for (int i = 0; i < Convert.ToInt32(iRowCount - BUMP_OFFSET); i++) { String ITEM_NO = getCellValue(sheet, "A" + (BUMP_OFFSET + i), CELL_TYP_STRING); String ITEM_NAME = getCellValue(sheet, "B" + (BUMP_OFFSET + i), CELL_TYP_STRING); int iITEM_NO = 0; bool ITEM_NO_Parse = int.TryParse(ITEM_NO, out iITEM_NO); if (ITEM_NO_Parse == false) { if (ITEM_NAME.Equals("标准件明细表")) { bIsStandard = true; bIsBase = false; } else if (ITEM_NAME.Equals("基本件明细表")) { bIsBase = true; bIsStandard = false; } continue; } // 规格及代号 String SPEC = getCellValue(sheet, "C" + (BUMP_OFFSET + i), CELL_TYP_STRING); // 数量 String QTY = getCellValue(sheet, "D" + (BUMP_OFFSET + i), CELL_TYP_STRING); // 材料 String MATERIAL = getCellValue(sheet, "E" + (BUMP_OFFSET + i), CELL_TYP_STRING); // 备注 String REMARK = getCellValue(sheet, "F" + (BUMP_OFFSET + i), CELL_TYP_STRING); // 构造JObject,并保存水泵信息至数据库中 JObject entityObjForBom = new JObject(); entityObjForBom.Add("BOM_ID", BOM_ID); entityObjForBom.Add("ITEM_NO", ITEM_NO); entityObjForBom.Add("ITEM_NAME", ITEM_NAME); entityObjForBom.Add("SPEC", SPEC); entityObjForBom.Add("QTY", QTY); entityObjForBom.Add("MATERIAL", MATERIAL); entityObjForBom.Add("REMARK", REMARK); if (bIsStandard == true) { BOM_ITEM_STANDARD excelBomItemStdEntity = entityObjForBom.ToObject <BOM_ITEM_STANDARD>(); var BomItemStdEntity = myContext.BOM_ITEM_STANDARD .Where(d => d.BOM_ID.Equals(excelBomItemStdEntity.BOM_ID)) .Where(d => d.ITEM_NO.Equals(excelBomItemStdEntity.ITEM_NO)); if (BomItemStdEntity.Count() == 0) { // INSERT myContext.BOM_ITEM_STANDARD.Add(excelBomItemStdEntity); // 以后有可能做一个FLG,到水泵信息保存完成后再保存更改 myContext.SaveChanges(); } else { BomItemStdEntity.First().BOM_ID = excelBomItemStdEntity.BOM_ID; BomItemStdEntity.First().ITEM_NO = excelBomItemStdEntity.ITEM_NO; BomItemStdEntity.First().ITEM_NAME = excelBomItemStdEntity.ITEM_NAME; BomItemStdEntity.First().SPEC = excelBomItemStdEntity.SPEC; BomItemStdEntity.First().QTY = excelBomItemStdEntity.QTY; BomItemStdEntity.First().MATERIAL = excelBomItemStdEntity.MATERIAL; BomItemStdEntity.First().REMARK = excelBomItemStdEntity.REMARK; myContext.SaveChanges(); } } else if (bIsBase == true) { BOM_ITEM_BASE excelBomItemBaseEntity = entityObjForBom.ToObject <BOM_ITEM_BASE>(); var BomItemBaseEntity = myContext.BOM_ITEM_BASE .Where(d => d.BOM_ID.Equals(excelBomItemBaseEntity.BOM_ID)) .Where(d => d.ITEM_NO.Equals(excelBomItemBaseEntity.ITEM_NO)); if (BomItemBaseEntity.Count() == 0) { // INSERT myContext.BOM_ITEM_BASE.Add(excelBomItemBaseEntity); // 以后有可能做一个FLG,到水泵信息保存完成后再保存更改 myContext.SaveChanges(); } else { BomItemBaseEntity.First().BOM_ID = excelBomItemBaseEntity.BOM_ID; BomItemBaseEntity.First().ITEM_NO = excelBomItemBaseEntity.ITEM_NO; BomItemBaseEntity.First().ITEM_NAME = excelBomItemBaseEntity.ITEM_NAME; BomItemBaseEntity.First().SPEC = excelBomItemBaseEntity.SPEC; BomItemBaseEntity.First().QTY = excelBomItemBaseEntity.QTY; BomItemBaseEntity.First().MATERIAL = excelBomItemBaseEntity.MATERIAL; BomItemBaseEntity.First().REMARK = excelBomItemBaseEntity.REMARK; myContext.SaveChanges(); } } } } } } return(String.Empty); } catch (System.Exception ex) { return("Upload Failed: " + ex.Message); } }
public ActionResult <string> UploadFile() { try { var file = Request.Form.Files[0]; string folderName = "UploadExcel"; string contentRootPath = _hostingEnvironment.ContentRootPath; string newPath = Path.Combine(contentRootPath, folderName); if (!Directory.Exists(newPath)) { Directory.CreateDirectory(newPath); } if (file.Length > 0) { string fileName = ContentDispositionHeaderValue.Parse(file.ContentDisposition).FileName.Trim('"'); string fullPath = Path.Combine(newPath, fileName); using (FileStream stream = new FileStream(fullPath, FileMode.Create)) { file.CopyTo(stream); IWorkbook workbook = WorkbookFactory.Create(stream); ISheet sheet = workbook.GetSheetAt(0); if (sheet != null) { /* * 订单信息 */ // 订单编号 String ORDER_NO = getCellValue(sheet, "C3", CELL_TYP_STRING); if (String.IsNullOrEmpty(ORDER_NO)) { // 订单号(主键)为空时,直接返回 return("OrderNo is empty."); } // 合同编号 String CONTRACT_NO = getCellValue(sheet, "C4", CELL_TYP_STRING); // 项目名称 String PROJECT_NM = getCellValue(sheet, "C5", CELL_TYP_STRING); // 销售部门/销售员 String SALES_PERSON = getCellValue(sheet, "C6", CELL_TYP_STRING); // 订货单位 String ORDER_UNIT = getCellValue(sheet, "C7", CELL_TYP_STRING); // 应用工程师 String APPLICATION_ENGINEER = getCellValue(sheet, "F3", CELL_TYP_STRING); // 下发日期 String DEPARTURE_DATE_STR = getCellValue(sheet, "F4", CELL_TYP_DATE); // 交货日期 String DELIVERY_DATE_STR = getCellValue(sheet, "F5", CELL_TYP_DATE); // 此订单页数 String BUMP_DETAIL_NUM = getCellValue(sheet, "F6", CELL_TYP_NUMBER); // 构造JObject,并保存订单信息至数据库中 JObject entityObjForOrder = new JObject(); entityObjForOrder.Add("ORDER_NO", ORDER_NO); entityObjForOrder.Add("CONTRACT_NO", CONTRACT_NO); entityObjForOrder.Add("PROJECT_NM", PROJECT_NM); entityObjForOrder.Add("SALES_PERSON", SALES_PERSON); entityObjForOrder.Add("ORDER_UNIT", ORDER_UNIT); entityObjForOrder.Add("APPLICATION_ENGINEER", APPLICATION_ENGINEER); entityObjForOrder.Add("DEPARTURE_DATE", Convert.ToDateTime(DEPARTURE_DATE_STR)); entityObjForOrder.Add("DELIVERY_DATE", Convert.ToDateTime(DELIVERY_DATE_STR)); ORDER_LIST_MST excelOrderListMstEntity = entityObjForOrder.ToObject <ORDER_LIST_MST>(); var orderListMstEntity = myContext.ORDER_LIST_MST.Where(d => d.ORDER_NO.Equals(excelOrderListMstEntity.ORDER_NO)); if (orderListMstEntity.Count() == 0) { // INSERT myContext.ORDER_LIST_MST.Add(excelOrderListMstEntity); // 以后有可能做一个FLG,到水泵信息保存完成后再保存更改 myContext.SaveChanges(); } else { orderListMstEntity.First().CONTRACT_NO = excelOrderListMstEntity.CONTRACT_NO; orderListMstEntity.First().PROJECT_NM = excelOrderListMstEntity.PROJECT_NM; orderListMstEntity.First().ORDER_UNIT = excelOrderListMstEntity.ORDER_UNIT; orderListMstEntity.First().SALES_PERSON = excelOrderListMstEntity.SALES_PERSON; orderListMstEntity.First().DEPARTURE_DATE = excelOrderListMstEntity.DEPARTURE_DATE.ToLocalTime(); orderListMstEntity.First().DELIVERY_DATE = excelOrderListMstEntity.DELIVERY_DATE.ToLocalTime(); orderListMstEntity.First().REMARK = excelOrderListMstEntity.REMARK; orderListMstEntity.First().APPLICATION_ENGINEER = excelOrderListMstEntity.APPLICATION_ENGINEER; myContext.SaveChanges(); } /* * 水泵信息 */ for (int i = 0; i < Convert.ToInt32(BUMP_DETAIL_NUM); i++) { // 序号(校验用) String NO = getCellValue(sheet, "A" + (BUMP_OFFSET + i), CELL_TYP_STRING); // 序号校验(还应考虑不是数字Convert失败的情况,未写) if (Convert.ToInt32(NO) != i + 1) { return(""); } // 泵名称 String BUMP_NM = getCellValue(sheet, "B" + (BUMP_OFFSET + i), CELL_TYP_STRING); // 工位 String STATION = getCellValue(sheet, "C" + (BUMP_OFFSET + i), CELL_TYP_STRING); // 型号 String BUMP_TYPE = getCellValue(sheet, "D" + (BUMP_OFFSET + i), CELL_TYP_STRING); // 数量 String NUMBER = getCellValue(sheet, "F" + (BUMP_OFFSET + i), CELL_TYP_NUMBER); // 流量 String FLOW = getCellValue(sheet, "G" + (BUMP_OFFSET + i), CELL_TYP_NUMBER); // 扬程 String LIFT = getCellValue(sheet, "H" + (BUMP_OFFSET + i), CELL_TYP_NUMBER); // 材质 String MATERIAL = getCellValue(sheet, "I" + (BUMP_OFFSET + i), CELL_TYP_STRING); // 机封 String SEAL = getCellValue(sheet, "J" + (BUMP_OFFSET + i), CELL_TYP_STRING); // 序列号 String BUMP_SERIAL_NO = getCellValue(sheet, "K" + (BUMP_OFFSET + i), CELL_TYP_STRING); // 备注 String REMARK = getCellValue(sheet, "L" + (BUMP_OFFSET + i), CELL_TYP_STRING); // 构造水泵ID String BUMP_ID = ""; if (String.IsNullOrEmpty(BUMP_TYPE) || String.IsNullOrEmpty(MATERIAL)) { return("BumpType or material is empty."); } else { BUMP_ID = BUMP_TYPE + "_" + MATERIAL; } // 构造JObject,并保存水泵信息至数据库中 JObject entityObjForBump = new JObject(); entityObjForBump.Add("ORDER_NO", ORDER_NO); entityObjForBump.Add("BUMP_ID", BUMP_ID); entityObjForBump.Add("BUMP_NM", BUMP_NM); entityObjForBump.Add("STATION", STATION); entityObjForBump.Add("BUMP_TYPE", BUMP_TYPE); entityObjForBump.Add("NUMBER", Convert.ToInt32(NUMBER)); entityObjForBump.Add("FLOW", Convert.ToInt32(FLOW)); entityObjForBump.Add("LIFT", Convert.ToInt32(LIFT)); entityObjForBump.Add("MATERIAL", MATERIAL); entityObjForBump.Add("SEAL", SEAL); entityObjForBump.Add("BUMP_SERIAL_NO", BUMP_SERIAL_NO); entityObjForBump.Add("REMARK", REMARK); ORDER_LIST_DETAIL excelOrderListDetailEntity = entityObjForBump.ToObject <ORDER_LIST_DETAIL>(); var orderListDetailEntity = myContext.ORDER_LIST_DETAIL .Where(d => d.ORDER_NO.Equals(excelOrderListDetailEntity.ORDER_NO)) .Where(d => d.BUMP_ID.Equals(excelOrderListDetailEntity.BUMP_ID)); if (orderListDetailEntity.Count() == 0) { // INSERT myContext.ORDER_LIST_DETAIL.Add(excelOrderListDetailEntity); // 以后有可能做一个FLG,到水泵信息保存完成后再保存更改 myContext.SaveChanges(); } else { orderListDetailEntity.First().BUMP_NM = excelOrderListDetailEntity.BUMP_NM; orderListDetailEntity.First().STATION = excelOrderListDetailEntity.STATION; orderListDetailEntity.First().BUMP_TYPE = excelOrderListDetailEntity.BUMP_TYPE; orderListDetailEntity.First().NUMBER = excelOrderListDetailEntity.NUMBER; orderListDetailEntity.First().FLOW = excelOrderListDetailEntity.FLOW; orderListDetailEntity.First().LIFT = excelOrderListDetailEntity.LIFT; orderListDetailEntity.First().MATERIAL = excelOrderListDetailEntity.MATERIAL; orderListDetailEntity.First().SEAL = excelOrderListDetailEntity.SEAL; orderListDetailEntity.First().BUMP_SERIAL_NO = excelOrderListDetailEntity.BUMP_SERIAL_NO; orderListDetailEntity.First().REMARK = excelOrderListDetailEntity.REMARK; myContext.SaveChanges(); } } } } } return(String.Empty); } catch (System.Exception ex) { return("Upload Failed: " + ex.Message); } }
public ActionResult <string> Post([FromBody] JObject postObj) { // FROM WEB PAGE ORDER_LIST_DETAIL_DICT_NAME orderListDetailPostEntity = postObj.GetValue("orderListDetailTableModel").ToObject <ORDER_LIST_DETAIL_DICT_NAME>(); INNER_ORDER_BASIC_SEAL_MST innerOrderBasicSealPostEntity = postObj.GetValue("basicAndSealModel").ToObject <INNER_ORDER_BASIC_SEAL_MST>(); INNER_ORDER_OTHER_COMPONENT_MST innerOrderOtherComponentPostEntity = postObj.GetValue("otherComponentModel").ToObject <INNER_ORDER_OTHER_COMPONENT_MST>(); IList innerOrderBOMItemStandard = new ArrayList(); IList innerOrderBOMItemBase = new ArrayList(); if (postObj.GetValue("componentListTableData") != null) { innerOrderBOMItemStandard = postObj.GetValue("componentListTableData").ToList(); } if (postObj.GetValue("basicPartListTableData") != null) { innerOrderBOMItemBase = postObj.GetValue("basicPartListTableData").ToList(); } // 校验主键 if (String.IsNullOrEmpty(orderListDetailPostEntity.ORDER_NO) || String.IsNullOrEmpty(orderListDetailPostEntity.BUMP_ID)) { return(""); } // FROM DB // 登录BOM的GRID部分,先用SQL删除对应ID项目,之后批量插入 myContext.Database.ExecuteSqlCommand("DELETE FROM \"INNER_ORDER_BOM_ITEM_BASE\" WHERE \"ORDER_NO\" = @ORDER_NO AND \"BUMP_ID\" = @BUMP_ID", new NpgsqlParameter("@ORDER_NO", orderListDetailPostEntity.ORDER_NO), new NpgsqlParameter("@BUMP_ID", orderListDetailPostEntity.BUMP_ID)); myContext.Database.ExecuteSqlCommand("DELETE FROM \"INNER_ORDER_BOM_ITEM_STANDARD\" WHERE \"ORDER_NO\" = @ORDER_NO AND \"BUMP_ID\" = @BUMP_ID", new NpgsqlParameter("@ORDER_NO", orderListDetailPostEntity.ORDER_NO), new NpgsqlParameter("@BUMP_ID", orderListDetailPostEntity.BUMP_ID)); foreach (JObject item in innerOrderBOMItemStandard) { INNER_ORDER_BOM_ITEM_STANDARD itemEntity = item.ToObject <INNER_ORDER_BOM_ITEM_STANDARD>(); itemEntity.ORDER_NO = orderListDetailPostEntity.ORDER_NO; itemEntity.BUMP_ID = orderListDetailPostEntity.BUMP_ID; myContext.INNER_ORDER_BOM_ITEM_STANDARD.AddAsync(itemEntity); } foreach (JObject item in innerOrderBOMItemBase) { INNER_ORDER_BOM_ITEM_BASE itemEntity = item.ToObject <INNER_ORDER_BOM_ITEM_BASE>(); itemEntity.ORDER_NO = orderListDetailPostEntity.ORDER_NO; itemEntity.BUMP_ID = orderListDetailPostEntity.BUMP_ID; myContext.INNER_ORDER_BOM_ITEM_BASE.AddAsync(itemEntity); } myContext.SaveChanges(); var innerOrderbBasicSealMstEntity = myContext.INNER_ORDER_BASIC_SEAL_MST .Where(d => d.ORDER_NO.Equals(orderListDetailPostEntity.ORDER_NO) && d.BUMP_ID.Equals(orderListDetailPostEntity.BUMP_ID)); var innerOrderOtherComponentMstEntity = myContext.INNER_ORDER_OTHER_COMPONENT_MST .Where(d => d.ORDER_NO.Equals(orderListDetailPostEntity.ORDER_NO) && d.BUMP_ID.Equals(orderListDetailPostEntity.BUMP_ID)); if (innerOrderbBasicSealMstEntity.Count() == 0 && innerOrderOtherComponentMstEntity.Count() == 0) { // 补充项目 innerOrderBasicSealPostEntity.ORDER_NO = orderListDetailPostEntity.ORDER_NO; innerOrderBasicSealPostEntity.BUMP_ID = orderListDetailPostEntity.BUMP_ID; innerOrderBasicSealPostEntity.BUMP_TYPE = orderListDetailPostEntity.BUMP_TYPE; innerOrderBasicSealPostEntity.BUMP_SERIAL_NO = orderListDetailPostEntity.BUMP_SERIAL_NO; innerOrderBasicSealPostEntity.NUMBER = orderListDetailPostEntity.NUMBER; innerOrderBasicSealPostEntity.FLOW = orderListDetailPostEntity.FLOW; innerOrderBasicSealPostEntity.LIFT = orderListDetailPostEntity.LIFT; innerOrderBasicSealPostEntity.STATION = orderListDetailPostEntity.STATION; innerOrderBasicSealPostEntity.MATERIAL_BUMP = orderListDetailPostEntity.MATERIAL_BUMP; innerOrderBasicSealPostEntity.MATERIAL_FAN = orderListDetailPostEntity.MATERIAL_FAN; innerOrderBasicSealPostEntity.MATERIAL_ROLLER = orderListDetailPostEntity.MATERIAL_ROLLER; innerOrderBasicSealPostEntity.SEAL_FORM = orderListDetailPostEntity.SEAL_FORM_NAME; innerOrderBasicSealPostEntity.SEAL_BRAND = orderListDetailPostEntity.SEAL_BRAND_NAME; innerOrderBasicSealPostEntity.SEAL_BRAND_MANUAL = orderListDetailPostEntity.SEAL_BRAND_MANUAL; innerOrderBasicSealPostEntity.NPSH = orderListDetailPostEntity.CAVITATION_ALLOWANCE; innerOrderBasicSealPostEntity.BUMP_SPEED = orderListDetailPostEntity.ACTUAL_BUMP_SPEED; innerOrderBasicSealPostEntity.TEMPERATURE = orderListDetailPostEntity.TEMPERATURE; innerOrderBasicSealPostEntity.DENSITY = orderListDetailPostEntity.DENSITY; innerOrderBasicSealPostEntity.INLET_PRESSURE = orderListDetailPostEntity.IN_PRESSURE; innerOrderBasicSealPostEntity.MEDIA = orderListDetailPostEntity.MEDIUM; innerOrderBasicSealPostEntity.VISCOSITY = orderListDetailPostEntity.VISCOSITY; innerOrderBasicSealPostEntity.PARTICULATES = orderListDetailPostEntity.PARTICULATES; innerOrderBasicSealPostEntity.WORKING_PRESSURE = orderListDetailPostEntity.WORKING_PRESSURE; innerOrderBasicSealPostEntity.FLANGE_STANDARD = orderListDetailPostEntity.FLANGES_STANDARD_NAME; innerOrderBasicSealPostEntity.FLANGE_LEVEL = orderListDetailPostEntity.FLANGES_LEVEL_NAME; innerOrderBasicSealPostEntity.BEARING_BRAND = orderListDetailPostEntity.ROLLER_BRAND_NAME; innerOrderBasicSealPostEntity.NEED_SEAL_COOLER_FLG = orderListDetailPostEntity.SEAL_COOLER_NAME; innerOrderOtherComponentPostEntity.ORDER_NO = orderListDetailPostEntity.ORDER_NO; innerOrderOtherComponentPostEntity.BUMP_ID = orderListDetailPostEntity.BUMP_ID; innerOrderOtherComponentPostEntity.ELECTRIC_MOTER_TYPE = orderListDetailPostEntity.MOTOR_BRAND_NAME; innerOrderOtherComponentPostEntity.COUPLING_TYPE = orderListDetailPostEntity.COUPLING_NAME; innerOrderOtherComponentPostEntity.BASE_TYPE = orderListDetailPostEntity.BASE_NAME; innerOrderOtherComponentPostEntity.COUPLING_HOOD_TYPE = orderListDetailPostEntity.COUPLING_HOOD_NAME; innerOrderOtherComponentPostEntity.ANCHOR_BOLT_TYPE = orderListDetailPostEntity.ANCHOR_BOLT_NAME; innerOrderOtherComponentPostEntity.COLOR_TYPE = orderListDetailPostEntity.PAINT_NAME; innerOrderOtherComponentPostEntity.SURFACE_TREAT_TYPE = orderListDetailPostEntity.SURFACE_TREATMENT_NAME; innerOrderOtherComponentPostEntity.PACKAGING_TYPE = orderListDetailPostEntity.PACKAGE_NAME; innerOrderOtherComponentPostEntity.TRANSPORT_TYPE = orderListDetailPostEntity.TRANSPORT_NAME; // TODO myContext.INNER_ORDER_OTHER_COMPONENT_MST.Add(innerOrderOtherComponentPostEntity); myContext.INNER_ORDER_BASIC_SEAL_MST.Add(innerOrderBasicSealPostEntity); myContext.SaveChanges(); return(""); } else { // 补充项目 innerOrderbBasicSealMstEntity.First().BUMP_TYPE = orderListDetailPostEntity.BUMP_TYPE; innerOrderbBasicSealMstEntity.First().BUMP_SERIAL_NO = orderListDetailPostEntity.BUMP_SERIAL_NO; innerOrderbBasicSealMstEntity.First().NUMBER = orderListDetailPostEntity.NUMBER; innerOrderbBasicSealMstEntity.First().FLOW = orderListDetailPostEntity.FLOW; innerOrderbBasicSealMstEntity.First().LIFT = orderListDetailPostEntity.LIFT; innerOrderbBasicSealMstEntity.First().STATION = orderListDetailPostEntity.STATION; innerOrderbBasicSealMstEntity.First().MATERIAL_BUMP = orderListDetailPostEntity.MATERIAL_BUMP; innerOrderbBasicSealMstEntity.First().MATERIAL_FAN = orderListDetailPostEntity.MATERIAL_FAN; innerOrderbBasicSealMstEntity.First().MATERIAL_ROLLER = orderListDetailPostEntity.MATERIAL_ROLLER; innerOrderbBasicSealMstEntity.First().SEAL_FORM = orderListDetailPostEntity.SEAL_FORM_NAME; innerOrderbBasicSealMstEntity.First().SEAL_BRAND = orderListDetailPostEntity.SEAL_BRAND_NAME; innerOrderbBasicSealMstEntity.First().SEAL_BRAND_MANUAL = orderListDetailPostEntity.SEAL_BRAND_MANUAL; innerOrderbBasicSealMstEntity.First().NPSH = orderListDetailPostEntity.CAVITATION_ALLOWANCE; innerOrderbBasicSealMstEntity.First().BUMP_SPEED = orderListDetailPostEntity.ACTUAL_BUMP_SPEED; innerOrderbBasicSealMstEntity.First().TEMPERATURE = orderListDetailPostEntity.TEMPERATURE; innerOrderbBasicSealMstEntity.First().DENSITY = orderListDetailPostEntity.DENSITY; innerOrderbBasicSealMstEntity.First().INLET_PRESSURE = orderListDetailPostEntity.IN_PRESSURE; innerOrderbBasicSealMstEntity.First().MEDIA = orderListDetailPostEntity.MEDIUM; innerOrderbBasicSealMstEntity.First().VISCOSITY = orderListDetailPostEntity.VISCOSITY; innerOrderbBasicSealMstEntity.First().PARTICULATES = orderListDetailPostEntity.PARTICULATES; innerOrderbBasicSealMstEntity.First().WORKING_PRESSURE = orderListDetailPostEntity.WORKING_PRESSURE; innerOrderbBasicSealMstEntity.First().FLANGE_STANDARD = orderListDetailPostEntity.FLANGES_STANDARD_NAME; innerOrderbBasicSealMstEntity.First().FLANGE_LEVEL = orderListDetailPostEntity.FLANGES_LEVEL_NAME; innerOrderbBasicSealMstEntity.First().BEARING_BRAND = orderListDetailPostEntity.ROLLER_BRAND_NAME; innerOrderbBasicSealMstEntity.First().NEED_SEAL_COOLER_FLG = orderListDetailPostEntity.SEAL_COOLER_NAME; innerOrderOtherComponentMstEntity.First().ELECTRIC_MOTER_TYPE = orderListDetailPostEntity.MOTOR_BRAND_NAME; innerOrderOtherComponentMstEntity.First().COUPLING_TYPE = orderListDetailPostEntity.COUPLING_NAME; innerOrderOtherComponentMstEntity.First().BASE_TYPE = orderListDetailPostEntity.BASE_NAME; innerOrderOtherComponentMstEntity.First().COUPLING_HOOD_TYPE = orderListDetailPostEntity.COUPLING_HOOD_NAME; innerOrderOtherComponentMstEntity.First().ANCHOR_BOLT_TYPE = orderListDetailPostEntity.ANCHOR_BOLT_NAME; innerOrderOtherComponentMstEntity.First().COLOR_TYPE = orderListDetailPostEntity.PAINT_NAME; innerOrderOtherComponentMstEntity.First().SURFACE_TREAT_TYPE = orderListDetailPostEntity.SURFACE_TREATMENT_NAME; innerOrderOtherComponentMstEntity.First().PACKAGING_TYPE = orderListDetailPostEntity.PACKAGE_NAME; innerOrderOtherComponentMstEntity.First().TRANSPORT_TYPE = orderListDetailPostEntity.TRANSPORT_NAME; // 其他项目 innerOrderbBasicSealMstEntity.First().TEST_PRESSURE = innerOrderBasicSealPostEntity.TEST_PRESSURE; innerOrderbBasicSealMstEntity.First().SUPPRESS_PRESSURE = innerOrderBasicSealPostEntity.SUPPRESS_PRESSURE; innerOrderbBasicSealMstEntity.First().SEAL_TYPE = innerOrderBasicSealPostEntity.SEAL_TYPE; innerOrderbBasicSealMstEntity.First().SEAL_MODEL = innerOrderBasicSealPostEntity.SEAL_MODEL; innerOrderbBasicSealMstEntity.First().SEAL_MATERIAL = innerOrderBasicSealPostEntity.SEAL_MATERIAL; innerOrderbBasicSealMstEntity.First().ABD_SEAL_INFO = innerOrderBasicSealPostEntity.ABD_SEAL_INFO; innerOrderbBasicSealMstEntity.First().OTHER_SEAL_PROVIDER = innerOrderBasicSealPostEntity.OTHER_SEAL_PROVIDER; innerOrderbBasicSealMstEntity.First().OTHER_SEAL_INFO = innerOrderBasicSealPostEntity.OTHER_SEAL_INFO; innerOrderbBasicSealMstEntity.First().OTHER_SEAL_MODEL = innerOrderBasicSealPostEntity.OTHER_SEAL_MODEL; innerOrderbBasicSealMstEntity.First().NEED_SEAL_COOLER_FLG = innerOrderBasicSealPostEntity.NEED_SEAL_COOLER_FLG; innerOrderbBasicSealMstEntity.First().SEAL_COOLER_MODEL = innerOrderBasicSealPostEntity.SEAL_COOLER_MODEL; innerOrderbBasicSealMstEntity.First().BEARING_BRAND = innerOrderBasicSealPostEntity.BEARING_BRAND; innerOrderbBasicSealMstEntity.First().BEARING_OTHER_INFO = innerOrderBasicSealPostEntity.BEARING_OTHER_INFO; innerOrderbBasicSealMstEntity.First().INSTALL_DIRECTION = innerOrderBasicSealPostEntity.INSTALL_DIRECTION; innerOrderbBasicSealMstEntity.First().DOUBLE_SEAL_PRESSURE = innerOrderBasicSealPostEntity.DOUBLE_SEAL_PRESSURE; innerOrderbBasicSealMstEntity.First().SERIES = innerOrderBasicSealPostEntity.SERIES; innerOrderbBasicSealMstEntity.First().MAIN_SHAFT_FORM = innerOrderBasicSealPostEntity.MAIN_SHAFT_FORM; innerOrderbBasicSealMstEntity.First().PUMP_STEERING = innerOrderBasicSealPostEntity.PUMP_STEERING; innerOrderbBasicSealMstEntity.First().ASSEMBLE_DIRECTION = innerOrderBasicSealPostEntity.ASSEMBLE_DIRECTION; innerOrderbBasicSealMstEntity.First().LINE_LOCATION_DESCRIPTION = innerOrderBasicSealPostEntity.LINE_LOCATION_DESCRIPTION; innerOrderbBasicSealMstEntity.First().DRAWING_CONFIRM = innerOrderBasicSealPostEntity.DRAWING_CONFIRM; innerOrderbBasicSealMstEntity.First().LUBRICATING_FORM = innerOrderBasicSealPostEntity.LUBRICATING_FORM; innerOrderOtherComponentMstEntity.First().BASE_TYPE = innerOrderOtherComponentPostEntity.BASE_TYPE; innerOrderOtherComponentMstEntity.First().BASE_SPEC = innerOrderOtherComponentPostEntity.BASE_SPEC; innerOrderOtherComponentMstEntity.First().SPECIAL_BASE_DETAIL = innerOrderOtherComponentPostEntity.SPECIAL_BASE_DETAIL; innerOrderOtherComponentMstEntity.First().COUPLING_HOOD_TYPE = innerOrderOtherComponentPostEntity.COUPLING_HOOD_TYPE; innerOrderOtherComponentMstEntity.First().COUPLING_HOOD_SPEC = innerOrderOtherComponentPostEntity.COUPLING_HOOD_SPEC; innerOrderOtherComponentMstEntity.First().SPECIAL_HOOD_TYPE_DETAIL = innerOrderOtherComponentPostEntity.SPECIAL_HOOD_TYPE_DETAIL; innerOrderOtherComponentMstEntity.First().ANCHOR_BOLT_TYPE = innerOrderOtherComponentPostEntity.ANCHOR_BOLT_TYPE; innerOrderOtherComponentMstEntity.First().ANCHOR_BOLT_SPEC = innerOrderOtherComponentPostEntity.ANCHOR_BOLT_SPEC; innerOrderOtherComponentMstEntity.First().ANCHOR_BOLT_MATERIAL = innerOrderOtherComponentPostEntity.ANCHOR_BOLT_MATERIAL; innerOrderOtherComponentMstEntity.First().ANCHOR_BOLT_EXTRA_NUT_SPEC = innerOrderOtherComponentPostEntity.ANCHOR_BOLT_EXTRA_NUT_SPEC; innerOrderOtherComponentMstEntity.First().ANCHOR_BOLT_EXTRA_PAD_SPEC = innerOrderOtherComponentPostEntity.ANCHOR_BOLT_EXTRA_PAD_SPEC; innerOrderOtherComponentMstEntity.First().ANCHOR_BOLT_NUM = innerOrderOtherComponentPostEntity.ANCHOR_BOLT_NUM; innerOrderOtherComponentMstEntity.First().COUPLING_TYPE = innerOrderOtherComponentPostEntity.COUPLING_TYPE; innerOrderOtherComponentMstEntity.First().COUPLING_BUMP_COUPLET = innerOrderOtherComponentPostEntity.COUPLING_BUMP_COUPLET; innerOrderOtherComponentMstEntity.First().COUPLING_ELECTRIC_COUPLET = innerOrderOtherComponentPostEntity.COUPLING_ELECTRIC_COUPLET; innerOrderOtherComponentMstEntity.First().COUPLING_PIN = innerOrderOtherComponentPostEntity.COUPLING_PIN; innerOrderOtherComponentMstEntity.First().COUPLING_JUMP_RING = innerOrderOtherComponentPostEntity.COUPLING_JUMP_RING; innerOrderOtherComponentMstEntity.First().COUPLING_PROVIDER = innerOrderOtherComponentPostEntity.COUPLING_PROVIDER; innerOrderOtherComponentMstEntity.First().COUPLING_SPEC = innerOrderOtherComponentPostEntity.COUPLING_SPEC; innerOrderOtherComponentMstEntity.First().COUPLING_NUM = innerOrderOtherComponentPostEntity.COUPLING_NUM; innerOrderOtherComponentMstEntity.First().SPECIAL_COUPLING_TYPE_DETAIL = innerOrderOtherComponentPostEntity.SPECIAL_COUPLING_TYPE_DETAIL; innerOrderOtherComponentMstEntity.First().ELECTRIC_MOTER_TYPE = innerOrderOtherComponentPostEntity.ELECTRIC_MOTER_TYPE; innerOrderOtherComponentMstEntity.First().ELECTRIC_MOTER_PROVIDER = innerOrderOtherComponentPostEntity.ELECTRIC_MOTER_PROVIDER; innerOrderOtherComponentMstEntity.First().ELECTRIC_MOTER_POWER = innerOrderOtherComponentPostEntity.ELECTRIC_MOTER_POWER; innerOrderOtherComponentMstEntity.First().ELECTRIC_MOTER_SPEED = innerOrderOtherComponentPostEntity.ELECTRIC_MOTER_SPEED; innerOrderOtherComponentMstEntity.First().ELECTRIC_MOTER_PFV = innerOrderOtherComponentPostEntity.ELECTRIC_MOTER_PFV; innerOrderOtherComponentMstEntity.First().ELECTRIC_MOTER_EXTRA_INFO = innerOrderOtherComponentPostEntity.ELECTRIC_MOTER_EXTRA_INFO; innerOrderOtherComponentMstEntity.First().COLOR_TYPE = innerOrderOtherComponentPostEntity.COLOR_TYPE; innerOrderOtherComponentMstEntity.First().SPECIAL_COLOR_DETAIL = innerOrderOtherComponentPostEntity.SPECIAL_COLOR_DETAIL; innerOrderOtherComponentMstEntity.First().SURFACE_TREAT_TYPE = innerOrderOtherComponentPostEntity.SURFACE_TREAT_TYPE; innerOrderOtherComponentMstEntity.First().SURFACE_TREAT_EXTRA_INFO = innerOrderOtherComponentPostEntity.SURFACE_TREAT_EXTRA_INFO; innerOrderOtherComponentMstEntity.First().TRANSPORT_TYPE = innerOrderOtherComponentPostEntity.TRANSPORT_TYPE; innerOrderOtherComponentMstEntity.First().TRANSPORT_PLACE = innerOrderOtherComponentPostEntity.TRANSPORT_PLACE; innerOrderOtherComponentMstEntity.First().PACKAGING_TYPE = innerOrderOtherComponentPostEntity.PACKAGING_TYPE; innerOrderOtherComponentMstEntity.First().SPECIAL_PACK_DETAIL = innerOrderOtherComponentPostEntity.SPECIAL_PACK_DETAIL; innerOrderOtherComponentMstEntity.First().NEED_FUME_CERTIFICATE = innerOrderOtherComponentPostEntity.NEED_FUME_CERTIFICATE; innerOrderOtherComponentMstEntity.First().ADDRESS_INFO = innerOrderOtherComponentPostEntity.ADDRESS_INFO; innerOrderOtherComponentMstEntity.First().REMARK = innerOrderOtherComponentPostEntity.REMARK; myContext.SaveChanges(); return(""); } }