yusijie
2022-11-25 494c68c9ad1cc3b085c27e87865269c4593c24e8
WebAPI/Controllers/Sc_MouldOtherInBillController.cs
@@ -88,7 +88,7 @@
            try
            {
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldOtherInBillList", 1, true, user))
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldOtherInBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -98,6 +98,7 @@
                }
                ds = Sc_MouldOtherInBill(sWhere, Organization);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "返回记录成功!";
@@ -223,7 +224,7 @@
            try
            {
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldOtherInBill_Edit", 1, true, msg4))
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldOtherInBill_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -312,15 +313,19 @@
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus  'in','{oBill.omodel.HInterID.ToString()}' ");
                    oCn.RunProc(sql);
                }
                else
                {
                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                    //修改成功
                    //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID  1,{oBill.omodel.HInterID.ToString()},' ' ");
                    string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
                    oCn.RunProc(sql);
                }
                if (bResult)
                {
                    string sql = $"exec h_p_Sc_MouldChangeFileStatus  'in','{oBill.omodel.HInterID.ToString()}' ";
                    oCn.RunProc(sql);
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
@@ -358,7 +363,7 @@
        public object DeltetMouldOtherInBill(string HInterID,string user)
        {
            //编辑权限
            if (!DBUtility.ClsPub.Security_Log("Sc_MouldOtherOutBill_Delete", 1, true, user))
            if (!DBUtility.ClsPub.Security_Log("Sc_MouldOtherOutBill_Delete", 1, false, user))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
@@ -397,10 +402,21 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //删除前查找当前单据的所有器具ID
                //string swhere = "";
                //DataSet ds = oCn.RunProcReturn("select HMaterID from Sc_MouldStockBillSub where HinterID=" + HInterID, "Sc_MouldStockBillSub");
                //for (var i = 0; i < ds.Tables[0].Rows.Count; i++)
                //{
                //    swhere = swhere + ds.Tables[0].Rows[i]["HMaterID"].ToString() + ",";
                //}
                //swhere = swhere.Substring(0, swhere.Length - 1);
                bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                if (IsDete)
                {
                    //删除成功修改器具档案位置
                    //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID  0,0,'{swhere}' ");
                    string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
                    oCn.RunProc(sql);
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;