1
yangle
2023-05-22 680b605296b299a426438579b8a271882521dc8a
WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
@@ -1230,5 +1230,92 @@
        }
        #endregion
        #region 单据变更 页面初始化
        [Route("Sc_ProcessExchangeBill/GetProcessExchangeBillMain_Change_init")]
        [HttpGet]
        public object GetProcessExchangeBillMain_Change_init(string HInterID)
        {
            try
            {
                if (string.IsNullOrEmpty(HInterID))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "Exception!HInterID不能为空";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery  where hmainid = " + HInterID + " ", "h_v_Sc_ProcessExchangeBillQuery");
                if (ds==null||ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "Exception!不存在工序流转卡";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 单据变更 保存
        [Route("Sc_ProcessExchangeBill/GetProcessExchangeBillMain_Change_save")]
        [HttpGet]
        public object GetProcessExchangeBillMain_Change_save(string HInterID,string HMaterModel2)
        {
            try
            {
                if (string.IsNullOrEmpty(HInterID))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "Exception!HInterID不能为空";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                oCN.BeginTran();
                oCN.RunProc("update Sc_ProcessExchangeBillMain set HMaterModel2 = '" + HMaterModel2 + "' where HInterID = " + HInterID + "");
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}