| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else if (oSystemParameter.omodel.WMS_CampanyName == "添康科技") |
| | | { |
| | | DataSet dss; |
| | | dss = oCN.RunProcReturn("select COUNT(*) as number from Sc_ProcessExchangeBillMain where HRoutingBillID = " + HInterID, "Gy_RoutingBillMain"); |
| | | //判断是否可编辑 |
| | | if (dss.Tables[0].Rows[0]["number"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "此单据已经被引用,不允许修改!"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | if (OperationType == 2) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingBillList where 单据号='" + HBillNo + "'", "h_v_Gy_RoutingBillList"); |
| | |
| | | |
| | | |
| | | //=========================保存后控制 添加审批流 |
| | | DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_RoutingBill_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "',1 ", "h_p_Gy_RoutingBill_AfterSaveCtrl"); |
| | | if (ds2 == null) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存后控制判断失败!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | //DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_RoutingBill_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "',1 ", "h_p_Gy_RoutingBill_AfterSaveCtrl"); |
| | | //if (ds2 == null) |
| | | //{ |
| | | // oCN.RollBack(); |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "保存后控制判断失败!"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //} |
| | | //if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | //{ |
| | | // oCN.RollBack(); |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //============================ |
| | | |
| | | LogService.Write("用户:" + user + ",日期:" + DateTime.Now + ",新增工艺路线单据:" + HBillNo); |
| | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "此单据状态未在创建,不允许修改!"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | dss = oCN.RunProcReturn("select COUNT(*) as number from Sc_ProcessExchangeBillMain where HRoutingBillID = " + HInterID, "Gy_RoutingBillMain"); |
| | | //判断是否可编辑 |
| | | if (dss.Tables[0].Rows[0]["number"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "此单据已经被引用,不允许修改!"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | |
| | | oCN.RunProc("delete from Gy_RoutingBillSub where HInterID='" + HInterID + "'"); |
| | | |
| | | //=========================保存后控制 添加审批流 |
| | | DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_RoutingBill_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "',2 ", "h_p_Gy_RoutingBill_AfterSaveCtrl"); |
| | | if (ds2 == null) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存后控制判断失败!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | //DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_RoutingBill_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "',2 ", "h_p_Gy_RoutingBill_AfterSaveCtrl"); |
| | | //if (ds2 == null) |
| | | //{ |
| | | // oCN.RollBack(); |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "保存后控制判断失败!"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //} |
| | | //if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | //{ |
| | | // oCN.RollBack(); |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //============================ |
| | | |
| | | LogService.Write("用户:" + user + ",日期:" + DateTime.Now + ",修改工艺路线单据:" + HBillNo); |
| | |
| | | } |
| | | |
| | | ////保存后控制========================================= 添加审批流 |
| | | //ds = oCN.RunProcReturn("exec h_p_Gy_RoutingBill_AfterSaveCtrl " + HInterID, "h_p_Gy_RoutingBill_AfterSaveCtrl"); |
| | | ds = oCN.RunProcReturn("exec h_p_Gy_RoutingBill_AfterSaveCtrl " + HInterID + ",'',"+ OperationType, "h_p_Gy_RoutingBill_AfterSaveCtrl"); |
| | | |
| | | //if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "保存后判断失败!"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存后判断失败!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ////========================================================= |
| | | } |
| | | |
| | |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select a.*,m.HProcPriceType,m.HBeginDate,m.HEndDate,s.HQCProc,s.HQCFst,s.HQCPatrol,s.HMaterToSourceCtrl from h_v_Gy_RoutingBillList as a,Gy_RoutingBillMain as m,Gy_RoutingBillSub as s where m.HInterID = hmainid and s.HInterID = hmainid and s.HEntryID = hsubid and hmainid =" + HInterID, "h_v_Gy_RoutingBillList"); |
| | | ds = oCN.RunProcReturn("select a.*,m.HProcPriceType,m.HBeginDate,m.HEndDate,s.HQCProc,s.HQCFst,s.HQCPatrol,s.HMaterToSourceCtrl from h_v_Gy_RoutingBill_Edit as a,Gy_RoutingBillMain as m,Gy_RoutingBillSub as s where m.HInterID = hmainid and s.HInterID = hmainid and s.HEntryID = hsubid and hmainid =" + HInterID, "h_v_Gy_RoutingBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |