| | |
| | | <Compile Include="ClsPM_WorkPlanMonthBillMain.cs" /> |
| | | <Compile Include="æºå\InterFaceæºå\Cls_S_IF_ICMOBillList_CusBarCodeBill.cs" /> |
| | | <Compile Include="æºå\InterFaceæºå\Cls_S_IF_ICMOReportBillList_CusBarCodeBill.cs" /> |
| | | <Compile Include="ç产管ç\å®¢æ·æ ç¾\ClsSc_CustomerTagInfo.cs" /> |
| | | <Compile Include="ç产管ç\æäº§è§£éç³è¯·å\ClsJIT_UnLockRequestBill.cs" /> |
| | | <Compile Include="ç产管ç\æäº§éå®ç³è¯·å\ClsJIT_LockRequestBill.cs" /> |
| | | <Compile Include="ç³»ç»å
¬ç¨\ClsXt_DefineBillMainSet.cs" /> |
| | |
| | | public string HOldNumber; |
| | | public Model.ClsGy_EquipStatus_Model oModel = new Model.ClsGy_EquipStatus_Model(); |
| | | //æ°å¢ |
| | | public override bool AddNew() |
| | | public override bool AddNew(ref string sReturn) |
| | | { |
| | | |
| | | try |
| | | { |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Gy_EquipStatus_BeforeSaveCtrl '" + oModel.HNumber + "','" + oModel.HName + "'," + oModel.HUSEORGID + ",1,0 ", "h_p_Gy_EquipStatus_BeforeSaveCtrl"); |
| | | if (ds == null) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | return false; |
| | | } |
| | | //========================================================= |
| | | |
| | | oCn.BeginTran(); |
| | | oCn.RunProc($@"insert into Gy_EquipStatus(HNumber,HName ,HShortNumber ,HParentID ,HLevel |
| | | ,HEndFlag ,HStopflag ,HRemark ,HHelpCode ,HUseFlag |
| | |
| | | } |
| | | |
| | | //ä¿®æ¹ |
| | | public override bool ModifyByID(Int64 sItemID) |
| | | public override bool ModifyByID(Int64 sItemID, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Gy_EquipStatus_BeforeSaveCtrl '" + oModel.HNumber + "','" + oModel.HName + "'," + oModel.HUSEORGID + ",3," + sItemID, "h_p_Gy_EquipStatus_BeforeSaveCtrl"); |
| | | if (ds == null) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | return false; |
| | | } |
| | | //========================================================= |
| | | |
| | | oCn.BeginTran(); |
| | | oCn.RunProc("Update " + MvarItemKey + " set " + |
| | | " HNumber='" + oModel.HNumber + "'" + |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Data; |
| | | |
| | | namespace DAL |
| | | { |
| | | public class ClsSc_CustomerTagInfo : DBUtility.ClsXt_BaseBill |
| | | { |
| | | public Model.ClsSc_CustomerTagInfoMain omodel = new Model.ClsSc_CustomerTagInfoMain(); |
| | | public List<Model.ClsSc_CustomerTagInfoSub> DetailColl = new List<Model.ClsSc_CustomerTagInfoSub>(); |
| | | |
| | | public ClsSc_CustomerTagInfo() |
| | | { |
| | | base.MvarItemKeySub = "Sc_CustomerTagInfoSub"; |
| | | base.MvarItemKeySub2 = ""; |
| | | base.MvarItemKeySub3 = ""; |
| | | base.MvarItemKeySub4 = ""; |
| | | base.MvarItemKey = "Sc_CustomerTagInfoMain"; |
| | | base.MvarReportTitle = "å®¢æ·æ ç¾ä¿¡æ¯"; |
| | | base.BillType = "10003"; |
| | | base.HBillSubType = "10003"; |
| | | |
| | | } |
| | | |
| | | #region åºå®ä»£ç |
| | | |
| | | ~ClsSc_CustomerTagInfo() |
| | | { |
| | | DetailColl = null; |
| | | } |
| | | |
| | | #endregion èªå®ä¹æ¹æ³ |
| | | |
| | | //å é¤å
³è |
| | | public override void DeleteRelation(ref string sReturn, Int64 lngBillKey) |
| | | { |
| | | try |
| | | { |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | //æ°å¢å
³è |
| | | public override void AddNewRelation(ref string sReturn, Int64 lngBillKey) |
| | | { |
| | | try |
| | | { |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | //ä¿®æ¹åæ® |
| | | public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_CustomerTagInfo_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_CustomerTagInfo_BeforeSaveCtrl"); |
| | | if (ds == null) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | return false; |
| | | } |
| | | //========================================================= |
| | | |
| | | |
| | | // |
| | | oCn.BeginTran(); |
| | | |
| | | string mainSql = "update Sc_CustomerTagInfoMain set " + |
| | | "HDate = '" + omodel.HDate + "'" + |
| | | ",HRemark = '" + omodel.HRemark + "'" + |
| | | ",HUpDater = '" + omodel.HUpDater + "'" + |
| | | ",HUpDateDate = " + "getdate()" + "" + |
| | | " where HInterID = " + lngBillKey; |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCn.RunProc(mainSql); |
| | | //å é¤å
³è |
| | | DeleteRelation(ref sReturn, lngBillKey); |
| | | //å é¤å表 |
| | | DeleteBillSub(lngBillKey); |
| | | //æå
¥å表 |
| | | omodel.HInterID = lngBillKey; |
| | | foreach (Model.ClsSc_CustomerTagInfoSub oSub in DetailColl) |
| | | { |
| | | string subSql = "Insert into Sc_CustomerTagInfoSub" + |
| | | " (HInterID,HEntryID,HRemark,HBillNo_bak,HMaterID,HCustID,HEPE,HPU,HSKU" + |
| | | ",HSIZE1,HSIZE2,HLBS,HOZ,HUPC,HSKU2,HFABRIC,HSN,HSize,HCustMaterNumber,HCustMaterName,HCustMaterModel" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" + |
| | | ") values(" + |
| | | "" + omodel.HInterID.ToString() + |
| | | "," + oSub.HEntryID + |
| | | ",'" + oSub.HRemark + "'" + |
| | | ",'" + oSub.HBillNo_bak + "'" + |
| | | "," + oSub.HMaterID + |
| | | "," + oSub.HCustID + |
| | | ",'" + oSub.HEPE + "'" + |
| | | ",'" + oSub.HPU + "'" + |
| | | ",'" + oSub.HSKU + "'" + |
| | | ",'" + oSub.HSIZE1 + "'" + |
| | | ",'" + oSub.HSIZE2 + "'" + |
| | | ",'" + oSub.HLBS + "'" + |
| | | ",'" + oSub.HOZ + "'" + |
| | | ",'" + oSub.HUPC + "'" + |
| | | ",'" + oSub.HSKU2 + "'" + |
| | | ",'" + oSub.HFABRIC + "'" + |
| | | ",'" + oSub.HSN + "'" + |
| | | ",'" + oSub.HSize + "'" + |
| | | ",'" + oSub.HCustMaterNumber + "'" + |
| | | ",'" + oSub.HCustMaterName + "'" + |
| | | ",'" + oSub.HCustMaterModel + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "" + |
| | | "," + oSub.HSourceEntryID.ToString() + "" + |
| | | ",'" + oSub.HSourceBillNo + "'" + |
| | | ",'" + oSub.HSourceBillType + "'" + |
| | | ") "; |
| | | |
| | | oCn.RunProc(subSql); |
| | | } |
| | | //æ´æ°è®¢åå
³èæ°é |
| | | AddNewRelation(ref sReturn, omodel.HInterID); |
| | | //æ§å¶å
³èæ°é |
| | | |
| | | //=========================ä¿ååæ§å¶ |
| | | DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_CustomerTagInfo_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_CustomerTagInfo_AfterSaveCtrl"); |
| | | if (ds2 == null) |
| | | { |
| | | sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //============================ |
| | | |
| | | |
| | | // |
| | | sReturn = "ä¿®æ¹åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | | //æ°å¢åæ® |
| | | public override bool AddBill(ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | //å¾å°mainid |
| | | //omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | if (IsExistBillNo(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HBillNo, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew, omodel.HInterID)) |
| | | { |
| | | omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | } |
| | | if (IsExistMainID(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HInterID, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew)) |
| | | { |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_CustomerTagInfo_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_CustomerTagInfo_BeforeSaveCtrl"); |
| | | if (ds == null) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | return false; |
| | | } |
| | | //========================================================= |
| | | |
| | | // |
| | | oCn.BeginTran(); |
| | | //主表 |
| | | string mainSql = "Insert Into Sc_CustomerTagInfoMain" + |
| | | "(HInterID,HBillNo,HDate,HYear,HPeriod,HRemark,HMaker,HMakeDate,HBillStatus" + |
| | | ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType" + |
| | | ") " + |
| | | "values(" + |
| | | "" + omodel.HInterID.ToString() + "" + |
| | | ",'" + omodel.HBillNo + "'" + |
| | | ",'" + omodel.HDate + "'" + |
| | | "," + omodel.HYear.ToString() + "" + |
| | | "," + omodel.HPeriod.ToString() + "" + |
| | | ",'" + omodel.HRemark + "'" + |
| | | ",'" + omodel.HMaker + "'" + |
| | | "," + "getdate()" + "" + |
| | | "," + "1" + "" + |
| | | "," + omodel.HMainSourceInterID + "" + |
| | | "," + omodel.HMainSourceEntryID + "" + |
| | | ",'" + omodel.HMainSourceBillNo + "'" + |
| | | ",'" + omodel.HMainSourceBillType + "'" + |
| | | ") "; |
| | | |
| | | oCn.RunProc(mainSql); |
| | | |
| | | |
| | | //æå
¥å表 |
| | | foreach (Model.ClsSc_CustomerTagInfoSub oSub in DetailColl) |
| | | { |
| | | string subSql = "Insert into Sc_CustomerTagInfoSub" + |
| | | " (HInterID,HEntryID,HRemark,HBillNo_bak,HMaterID,HCustID,HEPE,HPU,HSKU" + |
| | | ",HSIZE1,HSIZE2,HLBS,HOZ,HUPC,HSKU2,HFABRIC,HSN,HSize,HCustMaterNumber,HCustMaterName,HCustMaterModel" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" + |
| | | ") values(" + |
| | | "" + omodel.HInterID.ToString() + |
| | | "," + oSub.HEntryID + |
| | | ",'" + oSub.HRemark + "'" + |
| | | ",'" + oSub.HBillNo_bak + "'" + |
| | | "," + oSub.HMaterID + |
| | | "," + oSub.HCustID + |
| | | ",'" + oSub.HEPE + "'" + |
| | | ",'" + oSub.HPU + "'" + |
| | | ",'" + oSub.HSKU + "'" + |
| | | ",'" + oSub.HSIZE1 + "'" + |
| | | ",'" + oSub.HSIZE2 + "'" + |
| | | ",'" + oSub.HLBS + "'" + |
| | | ",'" + oSub.HOZ + "'" + |
| | | ",'" + oSub.HUPC + "'" + |
| | | ",'" + oSub.HSKU2 + "'" + |
| | | ",'" + oSub.HFABRIC + "'" + |
| | | ",'" + oSub.HSN + "'" + |
| | | ",'" + oSub.HSize + "'" + |
| | | ",'" + oSub.HCustMaterNumber + "'" + |
| | | ",'" + oSub.HCustMaterName + "'" + |
| | | ",'" + oSub.HCustMaterModel + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "" + |
| | | "," + oSub.HSourceEntryID.ToString() + "" + |
| | | ",'" + oSub.HSourceBillNo + "'" + |
| | | ",'" + oSub.HSourceBillType + "'" + |
| | | ") "; |
| | | |
| | | oCn.RunProc(subSql); |
| | | } |
| | | //æ´æ°è®¢åå
³èæ°é |
| | | AddNewRelation(ref sReturn, omodel.HInterID); |
| | | //æ§å¶å
³èæ°é |
| | | |
| | | // |
| | | //=========================ä¿ååæ§å¶ |
| | | DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_CustomerTagInfo_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_CustomerTagInfo_AfterSaveCtrl"); |
| | | if (ds2 == null) |
| | | { |
| | | sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //============================ |
| | | |
| | | |
| | | sReturn = "æ°å¢åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | | //æ¾ç¤ºåæ® |
| | | public override bool ShowBill(Int64 lngBillKey, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | //æ¥è¯¢ä¸»è¡¨ |
| | | DataSet Ds ; |
| | | Ds = oCn.RunProcReturn("Select * from Sc_CustomerTagInfoMain Where HInterID=" + lngBillKey.ToString(), "Sc_CustomerTagInfoMain"); |
| | | if(Ds.Tables[0].Rows.Count==0) |
| | | { |
| | | sReturn = "åæ®æªæ¾å°ï¼"; |
| | | return false; |
| | | } |
| | | //åºå®èµå¼=========================================== |
| | | omodel.HMainSourceBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMainSourceBillType"]); |
| | | omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); |
| | | omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); |
| | | omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); |
| | | omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); |
| | | omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); |
| | | omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); |
| | | omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); |
| | | omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); |
| | | omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); |
| | | omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); |
| | | omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); |
| | | omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); |
| | | omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); |
| | | omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); |
| | | omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); |
| | | omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); |
| | | omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); |
| | | omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); |
| | | omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); |
| | | omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); |
| | | omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); |
| | | //======================================================== |
| | | |
| | | //å¾ªç¯ |
| | | DataSet DsSub ; |
| | | DsSub = oCn.RunProcReturn("Select * from Sc_CustomerTagInfoSub Where HInterID=" + lngBillKey.ToString(), "Sc_CustomerTagInfoSub"); |
| | | DetailColl.Clear();//æ¸
空 |
| | | for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) |
| | | { |
| | | Model.ClsSc_CustomerTagInfoSub oSub = new Model.ClsSc_CustomerTagInfoSub(); |
| | | // åºå®èµå¼=============================================== |
| | | oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); |
| | | oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); |
| | | oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); |
| | | oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); |
| | | oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); |
| | | oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); |
| | | oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); |
| | | oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); |
| | | oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); |
| | | oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); |
| | | oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); |
| | | oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); |
| | | //=================================================== |
| | | oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]); |
| | | |
| | | DetailColl.Add(oSub); |
| | | } |
| | | sReturn = "æ¾ç¤ºåæ®æåï¼"; |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | throw (e); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | return true; |
| | | } |
| | | |
| | | //æ°å¢åºç¡èµæ |
| | | public virtual bool AddNew(ref string sReturn) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | //ä¿®æ¹ |
| | | public virtual bool ModifyByID(Int64 sItemID) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | //ä¿®æ¹(è¿åå¼å¸¸ä¿¡æ¯) |
| | | public virtual bool ModifyByID(Int64 sItemID, ref string sReturn) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | #region åºå®ä»£ç |
| | | //æ¯å¦åå¨åé¡¹ç® |
| | | public bool HavChildCodes(Int64 sItemID) |
| | |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_EnvironmentTestItem_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_TechnologyParameterType_Model .cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_RestDay_Model.cs" /> |
| | | <Compile Include="ç产管ç\å®¢æ·æ ç¾\ClsSc_CustomerTagInfoMain.cs" /> |
| | | <Compile Include="ç产管ç\å®¢æ·æ ç¾\ClsSc_CustomerTagInfoSub.cs" /> |
| | | <Compile Include="ç产管ç\æäº§è§£éç³è¯·å\ClsJIT_UnLockRequestBillMain.cs" /> |
| | | <Compile Include="ç产管ç\æäº§è§£éç³è¯·å\ClsJIT_UnLockRequestBillSub.cs" /> |
| | | <Compile Include="ç产管ç\æäº§éå®ç³è¯·å\ClsJIT_LockRequestBillMain.cs" /> |
| | |
| | | { |
| | | public class ClsGy_EquipStatus_Model : DBUtility.ClsGy_Base_Model |
| | | { |
| | | public DateTime HMakeTime { get; set; } |
| | | public DateTime HCheckTime { get; set; } |
| | | public DateTime HModifyTime { get; set; } |
| | | public DateTime HStopTime { get; set; } |
| | | public string HMakeEmp { get; set; } |
| | | public string HCheckEmp { get; set; } |
| | | public string HModifyEmp { get; set; } |
| | | public string HStopEmp { get; set; } |
| | | public int HUSEORGID { get; set; } |
| | | public int HCREATEORGID { get; set; } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsSc_CustomerTagInfoMain : DBUtility.ClsXt_BaseBillMain |
| | | { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsSc_CustomerTagInfoSub : DBUtility.ClsXt_BaseBillSub |
| | | { |
| | | public Int64 HMaterID ; |
| | | public Int64 HCustID ; |
| | | public string HEPE ; |
| | | public string HPU ; |
| | | public string HSKU ; |
| | | public string HSIZE1 ; |
| | | public string HSIZE2 ; |
| | | public string HLBS ; |
| | | public string HOZ ; |
| | | public string HUPC ; |
| | | public string HSKU2 ; |
| | | public string HFABRIC ; |
| | | public string HSN ; |
| | | public string HSize ; |
| | | public string HCustMaterNumber ; |
| | | public string HCustMaterName ; |
| | | public string HCustMaterModel ; |
| | | } |
| | | } |
| | |
| | | } |
| | | if (HBarCodeType == "å¯ä¸æ¡ç ") |
| | | { |
| | | //æ¡ç ç¼å· = æ¡ç åç¼ + æµæ°´å· |
| | | TM = sTMNumber + LSH2; |
| | | |
| | | //æ¡ç åç¼ = ç»ç»ä»£ç + ç©æä»£ç + å¹´ + æ + æ¥ |
| | | sTMNumber = HOrgNumber + sMaterID + sYear + sPeriod + sDay; |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | Int32 HModelLen = grdMain.Rows[j].Cells[HMaterModelCol].Value.ToString().Length; |
| | | string HModelLeft = HModelLen >= 4 ? grdMain.Rows[j].Cells[HMaterModelCol].Value.ToString() : ""; |
| | | //æ¡ç ç¼å· = å·¥å代ç ï¼1ï¼ + å¹´ + 车é´ä»£ç ï¼060113ï¼ + æ + åå· + æ¥ + æµæ°´å· |
| | | TM = 1 + sYear + 060113 + sPeriod + HModelLeft + sDay + LSH; |
| | | } |
| | | |
| | | HEntryID = j + 1; |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var ds = oCN.RunProcReturn("select * from Gy_BadReason where HNumber='" + HNumber + "' and HUSEORGID='" + HOrgID + "'", "Gy_BadReason"); |
| | | var ds = oCN.RunProcReturn("select * from Gy_BadReason with(nolock) where HNumber='" + HNumber + "' and HUSEORGID='" + HOrgID + "'", "Gy_BadReason"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (IsAudit == 0) //å®¡æ ¸å¤æ |
| | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | ClsXt_SystemParameter oClsXt_SystemParameter = new ClsXt_SystemParameter(); |
| | | |
| | | /// <summary> |
| | | /// è¿åæ
éç±»å«å表 |
| | |
| | | |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | string sql1 = "exec h_p_Gy_ConkType_BeforeSaveCtrl " + HMakeEmp + ",'" + 1 + "'"; |
| | | string sql1 = "exec h_p_Gy_ConkType_BeforeSaveCtrl '" + HNumber + "','" + HName + "'," + HUSEORGID + ",1,0"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Gy_ConkType_BeforeSaveCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿å失败!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.Message = "ä¿å失败!åå :" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | |
| | | oCN.BeginTran(); |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | string sql1 = "exec h_p_Gy_ConkType_BeforeSaveCtrl " + HMakeEmp + ",'" + 2 + "'"; |
| | | string sql1 = "exec h_p_Gy_ConkType_BeforeSaveCtrl '" + HNumber + "','" + HName + "'," + HUSEORGID + ",3," + HItemID; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Gy_ConkType_BeforeSaveCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿å失败!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.Message = "ä¿å失败!åå :" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | |
| | | |
| | | oCN.Commit(); |
| | | } |
| | | objJsonResult.code = "0"; |
| | | |
| | | //èªå¨å®¡æ ¸åè½ |
| | | if (HItemID == 0) |
| | | { |
| | | ds = oCN.RunProcReturn("select HItemID,HNumber,HName from Gy_ConkType with(nolock) where HNumber='" + HNumber + "' and HUSEORGID = " + HUSEORGID, "Gy_ConkType"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼èªå¨å®¡æ ¸å¤±è´¥æ¾ä¸å°å¯¹åºåæ®"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else if (ds.Tables[0].Rows.Count > 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ç¸å使ç¨ç»ç»ä¸ï¼åºç°" + ds.Tables[0].Rows.Count + "个ç¸åç代ç ï¼" + ds.Tables[0].Rows[0]["HNumber"]; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | string sAutoCheck = oClsXt_SystemParameter.GetSingleSystemParameter("Gy_ConkType_AutoCheck", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | objJsonResult.Verify = "N"; |
| | | if (sAutoCheck == "Y") |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæå"; |
| | | objJsonResult.data = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | objJsonResult.Verify = "Y"; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | objJsonResult.data = 1; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_ConkTypeList where HitemID=" + HInterID, "h_v_Gy_ConkTypeList"); |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_ConkType_Edit where HitemID=" + HInterID, "h_v_Gy_ConkType_Edit"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | [Route("DeltetGy_ConkType")] |
| | | [HttpGet] |
| | | public object DeltetGy_ConkType(string HItemID, string user) |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "" || ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å½åå¤äºä¸è½å é¤ç¶æï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | //å é¤åæ§å¶========================================= |
| | | string sql1 = "exec h_p_Gy_ConkType_BeforeDelCtrl " + HItemID + ",'" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Gy_ConkType_BeforeDelCtrl"); |
| | |
| | | { |
| | | sWhere = " Where 1=1 "; |
| | | //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); |
| | | if (HNumber != "") |
| | | if (HNumber != "" && HNumber != null && HNumber != "undefined") |
| | | { |
| | | sWhere = sWhere + " and ( HNumber = '" + HNumber + "') "; |
| | | } |
| | |
| | | using WebAPI.Controllers.SCGL.æ¥è®¡å管ç; |
| | | using System.IO; |
| | | using SyntacticSugar.constant; |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace WebAPI.Controllers.SBGL |
| | | { |
| | | public class Gy_EquipTypeController : ApiController |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //if (!DBUtility.ClsPub.Security_Log("Gy_EquipTypeList", 1, false, user)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | ds = oCN.RunProcReturn("select HItemID,HParentID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag,HMakeEmp,HMakeTime,HCheckEmp,HCheckTime,HModifyEmp,HModifyTime,HCloseEmp,HCloseTime from Gy_EquipFileType where 1=1 " + sWhere+ " order by HItemID ", "Gy_EquipFileType"); |
| | | |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_EquipFileTypeList where 1=1 " + sWhere+ " order by HItemID ", "h_v_Gy_EquipFileTypeList"); |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg4 = sArray[1].ToString(); |
| | | string msg4 = sArray[2].ToString(); |
| | | string HUseOrgID = sArray[3].ToString(); |
| | | |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_EquipType_Edit", 1, false, msg4)) |
| | | { |
| | |
| | | bool HStopflag = list[0].HStopflag; |
| | | string HUseFlag = list[0].HUseFlag; |
| | | bool HEndFlag = list[0].HEndFlag; |
| | | long HUSEORGID = list[0].HUSEORGID; |
| | | long HCREATEORGID = list[0].HCREATEORGID; |
| | | |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | ds = oCN.RunProcReturn("Exec h_p_Gy_EquipType_BeforeSaveCtrl '" + HNumber.ToString() + "','" + HName + "'," + HUSEORGID + ",1,0", " h_p_Gy_EquipType_BeforeSaveCtrl "); |
| | | if (ds == null) |
| | | { |
| | | 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; |
| | | } |
| | | //========================================================= |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Insert into Gy_EquipFileType " + |
| | | " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HMakeEmp) " + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HMakeEmp,HUSEORGID,HCREATEORGID) " + |
| | | " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID + |
| | | "," + HLevel + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "',getdate(),'" + msg4 + "')", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | "," + HLevel + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "',getdate(),'" + msg4 + "'," + HUSEORGID + "," + HCREATEORGID + ")", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCN.RunProc("Update Gy_EquipFileType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ°å¢æåï¼"; |
| | |
| | | string HRemark = list[0].HRemark; |
| | | bool HStopflag = list[0].HStopflag; |
| | | string HUseFlag = list[0].HUseFlag; |
| | | long HUSEORGID = list[0].HUSEORGID; |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | ds = oCN.RunProcReturn("Exec h_p_Gy_EquipType_BeforeSaveCtrl '" + HNumber.ToString() + "','" + HName + "'," + HUSEORGID + ",3," + HItemID, " h_p_Gy_EquipType_BeforeSaveCtrl "); |
| | | if (ds == null) |
| | | { |
| | | 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; |
| | | } |
| | | //========================================================= |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | |
| | | ",HModifyTime=getdate()" + |
| | | ",HModifyEmp='" + msg4 + "'" + |
| | | ",HStopflag='" + HStopflag + "'" + |
| | | ",HUSEORGID=" + HUSEORGID + |
| | | ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from Gy_EquipFileType where HItemID=" + HInterID, "Gy_EquipFileType"); |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_EquipFileTypeEdit with(nolock) where HItemID=" + HInterID, "h_v_Gy_EquipFileTypeEdit"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //å®¡æ ¸åæ§å¶========================================= |
| | | ds = oCN.RunProcReturn("Exec h_p_Gy_EquipType_BeforeAuditCtrl " + HInterID + ",'" + Type + "'", " h_p_Gy_EquipType_BeforeAuditCtrl "); |
| | | if (ds == null) |
| | | { |
| | | 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; |
| | | } |
| | | //========================================================= |
| | | |
| | | ClsPub.CurUserName = user; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | |
| | | using Newtonsoft.Json; |
| | | using DBUtility; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | public DAL.ClsGy_EquipStatus_Ctl BillOld = new DAL.ClsGy_EquipStatus_Ctl(); |
| | | |
| | | #region 设å¤ç¶æ å表 |
| | | [Route("Gy_EquipStatus/Gy_EquipStatusList")] |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 设å¤ç¶æ ç¼è¾å表 |
| | | [Route("Gy_EquipStatus/Gy_EquipStatusEdit")] |
| | | [HttpGet] |
| | | public object Gy_EquipStatusEdit(string sWhere, string user, string Organization) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | string sql1 = string.Format(@"select * from h_v_Gy_EquipStatus_Edit where 使ç¨ç»ç»='" + Organization + "'"); |
| | | |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_EquipStatus_Edit"); |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | 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("Gy_EquipStatus/Gy_EquipStatusEdit")] |
| | | [HttpPost] |
| | |
| | | string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg1 = sArray[0].ToString(); |
| | | string msg2 = sArray[1].ToString(); |
| | | string OperationType = sArray[2].ToString(); |
| | | //string msg_HUSEORGID = sArray[2].ToString(); |
| | | Int64 HItemID = 0; |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | ClsXt_SystemParameter oClsXt_SystemParameter = new ClsXt_SystemParameter(); |
| | | |
| | | ListModels oListModels = new ListModels(); |
| | | |
| | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä»£ç ä¸è½ä¸ºç©ºï¼"; |
| | | objJsonResult.data = 1; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oItem.HName.Trim() == "") |
| | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼åç§°ä¸è½ä¸ºç©ºï¼"; |
| | | objJsonResult.data = 1; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //æ¥è¯¢æ°æ®ä¸æ¯å¦åå¨éå¤ä»£ç |
| | | ds = oCN.RunProcReturn("select * from Gy_EquipStatus where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_EquipStatus"); |
| | | ds = oCN.RunProcReturn("select * from Gy_EquipStatus with(nolock) where HNumber='" + oItem.HNumber.Trim() + "'", "Gy_EquipStatus"); |
| | | if (oItem.HItemID == 0) |
| | | { |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ç代ç 为空ï¼"; |
| | | objJsonResult.data = 1; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //oItem.HUSEORGID = Convert.ToInt32(msg_HUSEORGID); //ç»ç»id |
| | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | bool bResult; |
| | | if (oBill.oModel.HItemID == 0) |
| | | if (Convert.ToInt32(OperationType) == 1 || Convert.ToInt32(OperationType) == 2) |
| | | { |
| | | bResult = oBill.AddNew(); |
| | | bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | else |
| | | { |
| | | bResult = oBill.ModifyByID(oBill.oModel.HItemID); |
| | | bResult = oBill.ModifyByID(oBill.oModel.HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | if (bResult) |
| | | { |
| | | //èªå¨å®¡æ ¸åè½ |
| | | if (oBill.oModel.HItemID == 0) |
| | | { |
| | | ds = oCN.RunProcReturn("select HItemID,HNumber,HName from Gy_EquipStatus with(nolock) where HNumber='" + oBill.oModel.HNumber.Trim() + "' and HUSEORGID = " + oBill.oModel.HUSEORGID, "Gy_EquipStatus"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼èªå¨å®¡æ ¸å¤±è´¥æ¾ä¸å°å¯¹åºåæ®"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else if (ds.Tables[0].Rows.Count > 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ç¸å使ç¨ç»ç»ä¸ï¼åºç°" + ds.Tables[0].Rows.Count + "个ç¸åç代ç ï¼" + ds.Tables[0].Rows[0]["HNumber"]; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | string sAutoCheck = oClsXt_SystemParameter.GetSingleSystemParameter("Gy_EquipStatus_AutoCheck", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | objJsonResult.Verify = "N"; |
| | | if (sAutoCheck == "Y") |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæå"; |
| | | objJsonResult.data = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | objJsonResult.Verify = "Y"; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | objJsonResult.data = 1; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = 1; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | ds = oCN.RunProcReturn("select * from Gy_EquipStatus where HItemID=" + HItemID, "Gy_EquipStatus"); |
| | | |
| | | ds = oCN.RunProcReturn("select * from Gy_EquipStatus with(nolock) where HItemID=" + HItemID, "Gy_EquipStatus"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | else |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "" || ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å½åå¤äºä¸è½å é¤ç¶æï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]); |
| | | if (HStopflag) |
| | | { |
| | | oCN.RollBack();//åæ»äºå¡ |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ°æ®å·²ç¦ç¨æ æ³å é¤ï¼"; |
| | |
| | | } |
| | | |
| | | oCN.RunProc("delete from Gy_EquipStatus where HItemID=" + HItemID); |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "* æ°æ®å 餿åï¼"; |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 设å¤ç¶æå®¡æ ¸/åå®¡æ ¸åè½ |
| | | [Route("Gy_EquipStatus/CheckGy_EquipStatus")] |
| | | [HttpGet] |
| | | public object CheckGy_EquipStatus(string HInterID, int Type, string user) |
| | | { |
| | | try |
| | | { |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //å®¡æ ¸åæ§å¶========================================= |
| | | ds = oCN.RunProcReturn("Exec h_p_Gy_EquipStatus_BeforeAuditCtrl " + HInterID + ",'" + Type + "'", " h_p_Gy_EquipStatus_BeforeAuditCtrl "); |
| | | if (ds == null) |
| | | { |
| | | 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; |
| | | } |
| | | //========================================================= |
| | | |
| | | DBUtility.ClsPub.CurUserName = user; |
| | | |
| | | //Type 1 å®¡æ ¸ 2 åå®¡æ ¸ |
| | | if (Type == 1) |
| | | { |
| | | if (!BillOld.AuditByID2(int.Parse(HInterID), ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (BillOld.DeAuditByID2(int.Parse(HInterID), ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ§è¡æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 设å¤ç¶æç¦ç¨ãåç¦ç¨ |
| | | [Route("Gy_EquipStatus/StopGy_EquipStatus")] |
| | | [HttpGet] |
| | | public object StopGy_EquipStatus(int HInterID, int IsStop, string CurUserName) |
| | | { |
| | | try |
| | | { |
| | | var ds = oCN.RunProcReturn("select * from Gy_EquipStatus with(nolock) where HItemID=" + HInterID, "Gy_EquipStatus"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (IsStop == 0) //ç¦ç¨å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ç¦ç¨!ä¸è½å次ç¦ç¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsStop == 1) //åç¦ç¨å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªç¦ç¨!ä¸éè¦åç¦ç¨!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | if (IsStop == 0) //ç¦ç¨å¤æ |
| | | { |
| | | oCN.RunProc("update Gy_EquipStatus set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ç¦ç¨æå"; |
| | | objJsonResult.data = null; |
| | | } |
| | | if (IsStop == 1) //åç¦ç¨å¤æ |
| | | { |
| | | oCN.RunProc("update Gy_EquipStatus set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åç¦ç¨æå"; |
| | | objJsonResult.data = null; |
| | | } |
| | | oCN.Commit(); |
| | | |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç¦ç¨å¤±è´¥æè
åç¦ç¨å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | |
| | | foreach (Models.Gy_MateNumRelation_Sec oItem in lsmain) |
| | | { |
| | | //éæ°åå
¥å
³èæ°æ® |
| | | oCN.RunProc("insert into Gy_MateNumRelation_Sec (HCusID,HMaterID,HCusRelationNumber,HCusRelationName,HMaker,HMakeDate) " + |
| | | "values ('" + msg3 + "','" + oItem.HMaterID + "','" + oItem.HCusRelationNumber + "','" + oItem.HCusRelationName + "','" + msg4 + "',getdate() " + |
| | | oCN.RunProc("insert into Gy_MateNumRelation_Sec (HCusID,HMaterID,HCusRelationNumber,HCusRelationName,HMaker,HMakeDate,HCusRelationModel,HTemplateID) " + |
| | | "values ('" + msg3 + "','" + oItem.HMaterID + "','" + oItem.HCusRelationNumber + "','" + oItem.HCusRelationName + "','" + msg4 + "',getdate(),' " + oItem.HCusRelationModel + "'," + oItem.HTemplateID + |
| | | ")"); |
| | | } |
| | | oCN.Commit(); |
New file |
| | |
| | | using DBUtility; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web; |
| | | using System.Web.Http; |
| | | using WebAPI.Controllers.SCGL.æ¥è®¡å管ç; |
| | | using WebAPI.Models; |
| | | |
| | | namespace WebAPI.Controllers.ç产管ç.å®¢æ·æ ç¾ |
| | | { |
| | | public class Sc_CustomerTagController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | public DAL.ClsSc_CustomerTagInfo BillOld = new DAL.ClsSc_CustomerTagInfo(); |
| | | |
| | | #region å®¢æ·æ ç¾ä¿¡æ¯ æ¥è¯¢-å页 |
| | | [Route("Sc_CustomerTagInfo/PageList")] |
| | | [HttpGet] |
| | | public object PageList(string sWhere, string user, string Organization, int page, int size) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); //å®ä¹å£°æåé ï¼æéè¿ new List<object>()å建ç å®ä¾ï¼èµå¼ç»åé |
| | | //夿æ¯å¦ææ¥è¯¢æé |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_CustomerTagInfo_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéæ¥è¯¢!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_CustomerTagInfoList " + page + "," + size + ",'" + Organization + "'," + "''", "h_p_Sc_CustomerTagInfoList"); |
| | | } |
| | | else |
| | | { |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_CustomerTagInfoList " + page + "," + size + ",'" + Organization + "','" + sWhere + "'", "h_p_Sc_CustomerTagInfoList"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | 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_CustomerTagInfo/EditCX")] |
| | | [HttpGet] |
| | | public object EditCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_CustomerTagInfoEdit where hmainid=" + HInterID, "h_v_Sc_CustomerTagInfoEdit"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | 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_CustomerTagInfo/SaveCustomerTagInfo")] |
| | | [HttpPost] |
| | | public object SaveCustomerTagInfo([FromBody] JObject msg) |
| | | { |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string user = sArray[2].ToString(); |
| | | string OperationType = sArray[3].ToString(); |
| | | |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | | { |
| | | //夿æé |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_CustomerTagInfo_Edit", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæé"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | DAL.ClsSc_CustomerTagInfo oBill = new DAL.ClsSc_CustomerTagInfo(); |
| | | List<Model.ClsSc_CustomerTagInfoMain> lsmain = new List<Model.ClsSc_CustomerTagInfoMain>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getCustomerTagInfoMainByJson(msg2); |
| | | foreach (Model.ClsSc_CustomerTagInfoMain oItem in lsmain) |
| | | { |
| | | oItem.HMaker = user; |
| | | oItem.HUpDater = user; |
| | | |
| | | if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿åå¤±è´¥ï¼æ²¡æåæ®æ¥æï¼æ æ³ä¿åï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | oBill.omodel = oItem; |
| | | } |
| | | //è¡¨ä½æ°æ® |
| | | //æ },{æ¥æåæ°ç» //廿ãåã |
| | | msg3 = msg3.Substring(1, msg3.Length - 2); |
| | | msg3 = msg3.Replace("\\", ""); |
| | | msg3 = msg3.Replace("\n", ""); //\n |
| | | List<Model.ClsSc_CustomerTagInfoSub> ls = new List<Model.ClsSc_CustomerTagInfoSub>(); |
| | | ls = oListModels.getCustomerTagInfoSubByJson(msg3); |
| | | int i = 0; |
| | | foreach (Model.ClsSc_CustomerTagInfoSub oItemSub in ls) |
| | | { |
| | | i++; |
| | | oItemSub.HEntryID = i; |
| | | oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | oItemSub.HCloseType = false; |
| | | oItemSub.HCloseMan = ""; |
| | | oBill.DetailColl.Add(oItemSub); |
| | | } |
| | | |
| | | //è¿è¡ ä¼è®¡æé´ ç»è´¦ çå¤æåæ§å¶ |
| | | string s = ""; |
| | | int sYear = 0; |
| | | int sPeriod = 0; |
| | | DateTime HDate = DateTime.Now; |
| | | if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) |
| | | { |
| | | objJsonResult.Message = s; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | bool bResult; |
| | | if (Convert.ToInt32(OperationType) == 1) //æ°å¢ä¿å |
| | | { |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | else if (Convert.ToInt32(OperationType) == 4) //䏿¨ä¿å |
| | | { |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | else //ç¼è¾ä¿å |
| | | { |
| | | if (BillOld.ShowBill(lsmain[0].HInterID, ref s) == false) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤åæ®æè¯¯ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | //夿æ¯å¦å¯ç¼è¾ |
| | | if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤åæ®å·²ç»è¢«å®¡æ ¸ï¼ä¸å
许修æ¹ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (BillOld.omodel.HBillStatus > 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤åæ®å¤äºä¸å¯ç¼è¾ç¶æï¼ä¸å
许修æ¹ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld, ref s)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = s + "ï¼ä¸å
许修æ¹"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | |
| | | if (bResult) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å®¢æ·æ ç¾ä¿¡æ¯ æä»¶ä¸ä¼ |
| | | [Route("Sc_CustomerTagInfo/Sc_CustomerTagInfo_Excel")] |
| | | [HttpPost] |
| | | public object Sc_CustomerTagInfo_Excel() |
| | | { |
| | | try |
| | | { |
| | | //è·åæä»¶åç§° |
| | | var file = HttpContext.Current.Request.Files[0]; |
| | | //è·åæä»¶ç©çè·¯å¾ |
| | | string ExcelPath = HttpContext.Current.Server.MapPath("~/" + file.FileName); |
| | | //ä¿åæä»¶ |
| | | file.SaveAs(ExcelPath); |
| | | |
| | | NpoiHelper np = new NpoiHelper(); |
| | | DataSet ExcelDs = np.ReadExcel(ExcelPath, 1, 1, "0"); |
| | | |
| | | //å 餿件 |
| | | File.Delete(ExcelPath); |
| | | |
| | | //å建临æ¶è¡¨ |
| | | DataTable tb2 = new DataTable("dt2"); |
| | | |
| | | //æ·»å åå |
| | | for (int i = 0; i < ExcelDs.Tables[0].Columns.Count; i++) |
| | | { |
| | | tb2.Columns.Add(ExcelDs.Tables[0].Rows[0][i].ToString()); |
| | | } |
| | | |
| | | //模æ¿ç¼ºå°å ä½éè¦ä»æ°æ®åºä¸æ¥è¯¢åºæ¥æ¾ç¤ºå¨é¡µé¢çåæ®µ |
| | | tb2.Columns.Add("HMaterID", typeof(Int32));//ç©æID |
| | | tb2.Columns.Add("HCustID", typeof(Int32));//客æ·ID |
| | | |
| | | //æ·»å æ°æ® |
| | | for (int i = 1; i < ExcelDs.Tables[0].Rows.Count; i++) |
| | | { |
| | | DataRow row = tb2.NewRow(); |
| | | for (int j = 0; j < ExcelDs.Tables[0].Columns.Count; j++) |
| | | { |
| | | row[j] = ExcelDs.Tables[0].Rows[i][j].ToString(); |
| | | } |
| | | //å¦æè¡¨æ ¼ç¬¬iè¡ç第ä¸å为空ï¼åå¤æä¸ºè¿ä¸è¡çæ°æ®ä¸ºç©ºï¼è·³åºå¾ªç¯å¹¶ä¸ä¸ææ°æ®åå
¥ tb2 |
| | | if (ExcelDs.Tables[0].Rows[i][0].ToString() == "") |
| | | { |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | tb2.Rows.Add(row); |
| | | } |
| | | } |
| | | |
| | | var error = ""; |
| | | |
| | | //æ¥è¯¢å·¥åºå·¥ä»·æ²¡æçå |
| | | if (!tb2.Columns.Contains("ç©æä»£ç ")) |
| | | error += "æ²¡ææ¾å°ãç©æä»£ç ãçæ é¢,"; |
| | | |
| | | if (!tb2.Columns.Contains("ç©æåç§°")) |
| | | error += "æ²¡ææ¾å°ãç©æåç§°ãçæ é¢,"; |
| | | |
| | | if (!tb2.Columns.Contains("客æ·ä»£ç ")) |
| | | error += "æ²¡ææ¾å°ã客æ·ä»£ç ãçæ é¢,"; |
| | | |
| | | if (!tb2.Columns.Contains("客æ·åç§°")) |
| | | error += "æ²¡ææ¾å°ã客æ·åç§°ãçæ é¢,"; |
| | | |
| | | if (!tb2.Columns.Contains("EPE%")) |
| | | error += "æ²¡ææ¾å°ãEPE%ãçæ é¢,"; |
| | | |
| | | if (!tb2.Columns.Contains("PU%")) |
| | | error += "æ²¡ææ¾å°ãPU%ãçæ é¢,"; |
| | | |
| | | if (!tb2.Columns.Contains("SKU")) |
| | | error += "æ²¡ææ¾å°ãSKUãçæ é¢,"; |
| | | |
| | | if (!tb2.Columns.Contains("SIZE1")) |
| | | error += "æ²¡ææ¾å°ãSIZE1ãçæ é¢,"; |
| | | |
| | | if (!tb2.Columns.Contains("SIZE2")) |
| | | error += "æ²¡ææ¾å°ãSIZE2ãçæ é¢,"; |
| | | |
| | | if (!tb2.Columns.Contains("LBS")) |
| | | error += "æ²¡ææ¾å°ãLBSãçæ é¢,"; |
| | | |
| | | if (!tb2.Columns.Contains("OZ")) |
| | | error += "æ²¡ææ¾å°ãOZãçæ é¢,"; |
| | | |
| | | if (!tb2.Columns.Contains("UPC A")) |
| | | error += "æ²¡ææ¾å°ãUPC Aãçæ é¢,"; |
| | | |
| | | if (!tb2.Columns.Contains("SKU2")) |
| | | error += "æ²¡ææ¾å°ãSKU2ãçæ é¢,"; |
| | | |
| | | if (!tb2.Columns.Contains("FABRIC")) |
| | | error += "æ²¡ææ¾å°ãFABRICãçæ é¢,"; |
| | | |
| | | if (!tb2.Columns.Contains("SNå·")) |
| | | error += "æ²¡ææ¾å°ãSNå·ãçæ é¢,"; |
| | | |
| | | if (!tb2.Columns.Contains("尺寸")) |
| | | error += "æ²¡ææ¾å°ã尺寸ãçæ é¢,"; |
| | | |
| | | if (!tb2.Columns.Contains("å®¢æ·æå®ä»£ç ")) |
| | | error += "æ²¡ææ¾å°ãå®¢æ·æå®ä»£ç ãçæ é¢,"; |
| | | |
| | | if (!tb2.Columns.Contains("å®¢æ·æå®åç§°")) |
| | | error += "æ²¡ææ¾å°ãå®¢æ·æå®åç§°ãçæ é¢,"; |
| | | |
| | | if (!tb2.Columns.Contains("å®¢æ·æå®è§æ ¼")) |
| | | error += "æ²¡ææ¾å°ãå®¢æ·æå®è§æ ¼ãçæ é¢,"; |
| | | |
| | | |
| | | if (error.Length > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"Excel模æ¿åå¨é误,{error}\r\n"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | for (int i = 0; i <= tb2.Rows.Count - 1; i++) |
| | | { |
| | | string HMaterNumber = ""; |
| | | string HMaterName = ""; |
| | | string HCustNumber = ""; |
| | | string HCustName = ""; |
| | | string HEPE = ""; |
| | | string HPU = ""; |
| | | string HSKU = ""; |
| | | string HSIZE1 = ""; |
| | | string HSIZE2 = ""; |
| | | string HLBS = ""; |
| | | string HOZ = ""; |
| | | string HUPC = ""; |
| | | string HSKU2 = ""; |
| | | string HFABRIC = ""; |
| | | string HSN = ""; |
| | | string HSize = ""; |
| | | string HCustMaterNumber = ""; |
| | | string HCustMaterName = ""; |
| | | string HCustMaterModel = ""; |
| | | |
| | | |
| | | HMaterNumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["ç©æä»£ç "].ToString()); |
| | | HMaterName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["ç©æåç§°"].ToString()); |
| | | HCustNumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["客æ·ä»£ç "].ToString()); |
| | | HCustName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["客æ·åç§°"].ToString()); |
| | | HEPE = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["EPE%"].ToString()); |
| | | HPU = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["PU%"].ToString()); |
| | | HSKU = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["SKU"].ToString()); |
| | | HSIZE1 = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["SIZE1"].ToString()); |
| | | HSIZE2 = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["SIZE2"].ToString()); |
| | | HLBS = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["LBS"].ToString()); |
| | | HOZ = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["OZ"].ToString()); |
| | | HUPC = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["UPC A"].ToString()); |
| | | HSKU2 = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["SKU2"].ToString()); |
| | | HFABRIC = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["FABRIC"].ToString()); |
| | | HSN = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["SNå·"].ToString()); |
| | | HSize = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["尺寸"].ToString()); |
| | | HCustMaterNumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["å®¢æ·æå®ä»£ç "].ToString()); |
| | | HCustMaterName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["å®¢æ·æå®åç§°"].ToString()); |
| | | HCustMaterModel = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["å®¢æ·æå®è§æ ¼"].ToString()); |
| | | |
| | | |
| | | //æ£æ¥è¡¨æ ¼æ°æ® |
| | | int index = i + 1; |
| | | |
| | | if (HMaterNumber != "" && HMaterName != "") |
| | | { |
| | | //æ¥è¯¢ç©æ |
| | | ds = oCN.RunProcReturn("select HItemID,HNumber,HName,HModel from Gy_Material with(nolock) where HNumber='" + HMaterNumber + "' and HName='" + HMaterName + "'", "Gy_Material"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + index + "è¡,ç©æä¸åå¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | tb2.Rows[i]["HMaterID"] = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | } |
| | | |
| | | //æ¥è¯¢å®¢æ· |
| | | ds = oCN.RunProcReturn("select HItemID,HNumber,HName from Gy_Customer with(nolock) where HNumber='" + HCustNumber + "'", "Gy_Process"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + index + "è¡,客æ·ä¸åå¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | tb2.Rows[i]["HCustID"] = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + index + "è¡,ç©æä¿¡æ¯ä¸å
¨ï¼ç©æä»£ç ï¼ç©æåç§°ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = error; |
| | | objJsonResult.data = tb2; |
| | | 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_CustomerTagInfo/Sc_CustomerTagInfo_btnSave")] |
| | | [HttpPost] |
| | | public object Sc_CustomerTagInfo_btnSave([FromBody] JObject sMainSub) |
| | | { |
| | | var _value = sMainSub["sMainSub"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { "&å" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string user = sArray[1].ToString(); |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_CustomerTagInfo_Edit", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | List<object> Excel = Newtonsoft.Json.JsonConvert.DeserializeObject<List<object>>(msg2); |
| | | List<Dictionary<string, string>> list = new List<Dictionary<string, string>>(); |
| | | |
| | | foreach (JObject item in Excel) |
| | | { |
| | | Dictionary<string, string> dic = new Dictionary<string, string>(); |
| | | foreach (var itm in item.Properties()) |
| | | { |
| | | dic.Add(itm.Name, itm.Value.ToString()); |
| | | } |
| | | list.Add(dic); |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | long HInterID = DBUtility.ClsPub.CreateBillID("10003", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | string HBillNo = DBUtility.ClsPub.CreateBillCode("10003", ref DBUtility.ClsPub.sExeReturnInfo,true); |
| | | |
| | | string mainSql = "Insert Into Sc_CustomerTagInfoMain" + |
| | | "(HInterID,HBillNo,HDate,HYear,HPeriod,HRemark,HMaker,HMakeDate,HBillStatus" + |
| | | ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType" + |
| | | ") " + |
| | | "values(" + |
| | | "" + HInterID + |
| | | ",'" + HBillNo + "'" + |
| | | ",getdate()" + |
| | | ",Year(getdate())" + |
| | | ",Month(getdate())" + |
| | | "," + "''" + |
| | | ",'" + "Excel" + "'" + |
| | | "," + "getdate()" + "" + |
| | | "," + "1" + "" + |
| | | "," + 0 + "" + |
| | | "," + 0 + "" + |
| | | ",'" + "''" + "'" + |
| | | ",'" + "''" + "'" + |
| | | ") "; |
| | | |
| | | oCN.RunProc(mainSql); |
| | | |
| | | int i = 1; |
| | | foreach (Dictionary<string, string> item in list) |
| | | { |
| | | string HMaterNumber = item["ç©æä»£ç "]; |
| | | string HMaterName = item["ç©æåç§°"]; |
| | | string HCustNumber = item["客æ·ä»£ç "]; |
| | | string HCustName = item["客æ·åç§°"]; |
| | | string HEPE = item["EPE%"]; |
| | | string HPU = item["PU%"]; |
| | | string HSKU = item["SKU"]; |
| | | string HSIZE1 = item["SIZE1"]; |
| | | string HSIZE2 = item["SIZE2"]; |
| | | string HLBS = item["LBS"]; |
| | | string HOZ = item["OZ"]; |
| | | string HUPC = item["UPC A"]; |
| | | string HSKU2 = item["SKU2"]; |
| | | string HFABRIC = item["FABRIC"]; |
| | | string HSN = item["SNå·"]; |
| | | string HSize = item["尺寸"]; |
| | | string HCustMaterNumber = item["å®¢æ·æå®ä»£ç "]; |
| | | string HCustMaterName = item["å®¢æ·æå®åç§°"]; |
| | | string HCustMaterModel = item["å®¢æ·æå®è§æ ¼"]; |
| | | Int32 HMaterID = Convert.ToInt32(item["HMaterID"]); |
| | | Int32 HCustID = Convert.ToInt32(item["HCustID"]); |
| | | |
| | | |
| | | ds = oCN.RunProcReturn("select HMaterID,HCustID from Sc_CustomerTagInfoSub with(nolock) where HMaterID=" + HMaterID + " and HCustID = " + HCustID, "Sc_CustomerTagInfoSub"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | string sql = "insert into Sc_CustomerTagInfoSub(HInterID,HEntryID,HRemark,HBillNo_bak,HMaterID,HCustID,HEPE,HPU,HSKU,HSIZE1,HSIZE2,HLBS,HOZ,HUPC,HSKU2" + |
| | | ",HFABRIC,HSN,HSize,HCustMaterNumber,HCustMaterName,HCustMaterModel,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType)" + |
| | | $"values('{HInterID}', '{i}','{""}', '{HBillNo}', '{HMaterID}', '{HCustID}', '{HEPE}','{HPU}','{HSKU}','{HSIZE1}','{HSIZE2}','{HLBS}','{HOZ}','{HUPC}','{HSKU2}','{HFABRIC}','{HSN}','{HSize}','{HCustMaterNumber}','{HCustMaterName}','{HCustMaterModel}',{0},{0},'{""}','{""}')"; |
| | | oCN.RunProc(sql); |
| | | |
| | | i++; |
| | | } |
| | | else |
| | | { |
| | | oCN.RunProc("update Sc_CustomerTagInfoSub set HEPE='" + HEPE + "',HPU='" + HPU + "',HSKU='" + HSKU + "',HSIZE1='" + HSIZE1 + "',HSIZE2='" + HSIZE2 + "',HLBS='" + HLBS + "',HOZ='" + HOZ + "',HUPC='" + HUPC + "',HSKU2='" + HSKU2 + "',HFABRIC='" + HFABRIC + "',HSN='" + HSN + "',HSize='" + HSize + "',HCustMaterNumber='" + HCustMaterNumber + "',HCustMaterName='" + HCustMaterName + "',HCustMaterModel='" + HCustMaterModel + "' where HMaterID=" + HMaterID + " and HCustID=" + HCustID); |
| | | } |
| | | |
| | | i++; |
| | | } |
| | | |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "导å
¥æå!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | LogService.Write(e); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å®¢æ·æ ç¾æ¡£æ¡çæ |
| | | [Route("Sc_CustomerTagBarCode/Save")] |
| | | [HttpGet] |
| | | public object BarCodeSave(string HICMOInterID, string HICMOEntryID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | if (HICMOInterID == null || HICMOInterID.Equals("") || HICMOEntryID == null || HICMOEntryID.Equals("")) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "订åä¿¡æ¯ä¸å
¨ï¼HICMOInterIDï¼" + HICMOInterID + ",HICMOEntryID:" + HICMOEntryID; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_CustomerTagBarCode_AutoSave " + HICMOInterID + "," + HICMOEntryID, "h_p_Sc_CustomerTagBarCode_AutoSave"); |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | 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 |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å®¢æ·æ ç¾ååºåå |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsSc_CustomerTagInfoMain> getCustomerTagInfoMainByJson(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsSc_CustomerTagInfoMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_CustomerTagInfoMain>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å®¢æ·æ ç¾ååºååå表 |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsSc_CustomerTagInfoSub> getCustomerTagInfoSubByJson(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsSc_CustomerTagInfoSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_CustomerTagInfoSub>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éè´§éç¥åååºåå |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | |
| | | |
| | | public bool HUsed { get; set; } //ä½¿ç¨æ è®° |
| | | |
| | | public string HCusRelationModel { get; set; } //客æ·ç©æè§æ ¼ |
| | | public long HTemplateID { get; set; } //æå°æ¨¡æ¿ID |
| | | |
| | | } |
| | | } |
| | |
| | | <Compile Include="Controllers\æ°æ®åæ¥\éé忥\DD_DataSynchronizationController.cs" /> |
| | | <Compile Include="Controllers\æ¡ç 管ç\MouldController.cs" /> |
| | | <Compile Include="Controllers\æ¡ç 管ç\WEBSController.cs" /> |
| | | <Compile Include="Controllers\ç产管ç\å®¢æ·æ ç¾\Sc_CustomerTagController.cs" /> |
| | | <Compile Include="Controllers\ç产管ç\æ¥å·¥å°å·¥åº\Sc_MaterToSourceStepBillController.cs" /> |
| | | <Compile Include="Controllers\ç产管ç\æ¥å·¥å°å·¥åº\Sc_MESBeginStepWorkBillController.cs" /> |
| | | <Compile Include="Controllers\ç产管ç\æ¥å·¥å°å·¥åº\Sc_MESEndStepWorkBillController.cs" /> |