public JsonResult Save(SET_CLIENT_DEPT_BOXES item) { bool is_saved = false; string str_error = ""; int?BOX_NO = 0; try { using (DBEntities db = new DBEntities()) { if (item.BOX_NO > 0) { db.SET_CLIENT_DEPT_BOXES_UPDATE(item.BOX_NO, item.CLIENT_NO, item.DEPT_NO, item.PROD_TYPE_NO, item.ARCHIVE_DATE, item.CLIENT_BOX_ID, item.CHALLAN_NO, item.TRN_TYPE_NO, item.REQ_TYPE_NO, item.TRANSMIT_NO, item.IS_OLD_DATA, item.RECALL_BOX_NO, this.USER_NO, this.LOGON_NO); } else { ObjectParameter BOX_NO_parameter = new ObjectParameter("BOX_NO", BOX_NO); db.SET_CLIENT_DEPT_BOXES_INSERT(BOX_NO_parameter, item.CLIENT_NO, item.DEPT_NO, item.PROD_TYPE_NO, item.ARCHIVE_DATE, item.CLIENT_BOX_ID, item.CHALLAN_NO, item.TRN_TYPE_NO, item.REQ_TYPE_NO, item.TRANSMIT_NO, item.IS_OLD_DATA, item.RECALL_BOX_NO, this.USER_NO, this.LOGON_NO); BOX_NO = (int?)BOX_NO_parameter.Value; } is_saved = true; } } catch (Exception ex) { str_error += Environment.NewLine + ex.Message; } var ret_val = new { @is_success = is_saved, @msg = str_error, }; return(Json(ret_val, JsonRequestBehavior.AllowGet)); }
public JsonResult Save(SET_CLIENT_DEPT_BOXES item) { bool is_saved = false; string str_error = ""; try { GET_RECALL_BOX_NO_BY_CLIENT_BOX_ID_Result box_no_by_client_box_id = new GET_RECALL_BOX_NO_BY_CLIENT_BOX_ID_Result(); using (DBEntities db = new DBEntities()) { box_no_by_client_box_id = db.GET_RECALL_BOX_NO_BY_CLIENT_BOX_ID(item.CLIENT_BOX_ID, item.CLIENT_NO).FirstOrDefault(); if (box_no_by_client_box_id.CLIENT_NO == item.CLIENT_NO) { db.SET_CLIENT_DEPT_BOXES_RECALL_UPDATE(item.CLIENT_NO, box_no_by_client_box_id.DEPT_NO, item.CLIENT_BOX_ID, item.RECALL_BOX_NO, this.USER_NO, this.LOGON_NO); is_saved = true; } else { is_saved = false; } } } catch (Exception ex) { str_error += Environment.NewLine + ex.Message; } var ret_val = new { @is_success = is_saved, @msg = str_error, }; return(Json(ret_val, JsonRequestBehavior.AllowGet)); }