器具档案 增加 子表 和网格; Gy_MouldFileSub_SubMater 用来显示 这个 器具的 的 子配件(或子器具); (子表 非必录,允许为空)
| | |
| | | { |
| | | base.MvarItemKeySub = "Gy_MouldFileSub"; |
| | | base.MvarItemKeySub2 = "Gy_MouldFileSub2"; |
| | | base.MvarItemKeySub3 = ""; |
| | | base.MvarItemKeySub3 = "Gy_MouldFileSub_SubMater"; |
| | | base.MvarItemKeySub4 = ""; |
| | | base.MvarItemKey="Gy_MouldFileMain"; |
| | | base.MvarReportTitle="模å
·æ¡£æ¡"; |
| | |
| | | ",HUpDateDate=getdate()" + |
| | | //======================================== |
| | | ",HDeptID='" + omodel.HDeptID.ToString() + |
| | | "',HEmpID='" + omodel.HEmpID.ToString() + |
| | | "',HPostID='" + omodel.HPostID.ToString() + |
| | | "',HCheckEmpID='" + omodel.HCheckEmpID.ToString() + |
| | | "',HManagerEmpID ='" + omodel.HManagerEmpID.ToString() + |
| | | "',HInnerBillNo='" + omodel.HInnerBillNo + |
| | | "',HMaterID='" + omodel.HMaterID.ToString() + |
| | | "',HProcID='" + omodel.HProcID.ToString() + |
| | | "',HOrgID='" + omodel.HOrgID.ToString() + "'" + |
| | |
| | | return objJsonResult; |
| | | } |
| | | //ä¿å主表 |
| | | objJsonResult = AddBillMain(msg2); |
| | | objJsonResult = AddBillMain(msg1); |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | oCN.RollBack(); |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | public json AddBillMain(string msg2) |
| | | public json AddBillMain(string msg1) |
| | | { |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString();//模åæé |
| | | string msg4 = sArray[2].ToString();//å½å人 |
| | | string msg5 = sArray[3].ToString();//åè¡¨æ°æ® |
| | | try |
| | | { |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | |
| | | ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID + |
| | | ",'"+ HMouldClass + "'," + HNowWHID + "," + HNowSPID + ") "); |
| | | |
| | | |
| | | //å表 |
| | | oCN.RunProc("Insert into Gy_MouldFileSub " + |
| | | " (HInterID,HEntryID,HRemark" + |
| | |
| | | " values('" + HInterID + "',0,''" + |
| | | ",0,0,'','',0,0 " + |
| | | ") "); |
| | | |
| | | objJsonResult = AddBillSub(msg5,HInterID, HBillNo); |
| | | |
| | | if (objJsonResult.code == "0") |
| | | { |
| | |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString();//模åæé |
| | | string msg4 = sArray[2].ToString();//å½å人 |
| | | string msg5 = sArray[3].ToString();//åè¡¨æ°æ® |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log(msg3, 1, false, msg4)) |
| | |
| | | //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å°ä¸çº§ ä¸ºéæ«çº§ |
| | | // oCN.RunProc("Update Gy_Department set HEndflag=0 where HItemID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // |
| | | |
| | | oCN.RunProc("delete from Gy_MouldFileSub_SubMater where HInterID='" + HInterID + "'"); |
| | | |
| | | objJsonResult = AddBillSub(msg5, HInterID, HBillNo); |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | } |
| | | |
| | | public json AddBillSub(string msg5, long HInterID, string HBillNo) |
| | | { |
| | | List<Gy_MouldFileSub_SubMater> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_MouldFileSub_SubMater>>(msg5); |
| | | int i = 0; //ä½ä¸ºå表å
ç |
| | | foreach (Gy_MouldFileSub_SubMater oSub in DetailColl) |
| | | { |
| | | i++; //åä¸ä¸ªä¸»è¡¨ä¸çå表çå
ç èªå¢ |
| | | |
| | | int HEntryID = i; |
| | | string HRemark = oSub.HRemark; |
| | | int HMouldFileID = oSub.HMouldFileID; |
| | | DateTime HUnionDate = oSub.HUnionDate; |
| | | |
| | | string sql = "insert into Gy_MouldFileSub_SubMater" + |
| | | "(HInterID,HBillNo_bak,HEntryID,HRemark,HMouldFileID,HUnionDate) " + |
| | | "values(" + |
| | | "" + HInterID + |
| | | ",'" + HBillNo + |
| | | "'," + HEntryID + |
| | | ",'" + HRemark + |
| | | "','" + HMouldFileID + |
| | | "','" + HUnionDate + |
| | | "')"; |
| | | |
| | | oCN.RunProc(sql); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 磨å
·æ¡£æ¡ä¿®æ¹æé®æ¹æ³-计ç®ä¸æ¬¡ä¿å
»/æ ¡æ£æ¥æ-è·åæ¡£æ¡æè¿ä¸æ¬¡çä¿å
»è®°å½ |
| | |
| | | //è®°å½æ¥å¿ |
| | | LogService.Write("ç¨æ·:" + user + ",æ¥æ:" + DateTime.Now + ",ä¿®æ¹å·¥ä½ä»»å¡:" + HBillNo); |
| | | oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "ä¿®æ¹å·¥ä½ä»»å¡ï¼" + HBillNo + "','LMES-å·¥ä½ä»»å¡æ¨¡å','" + DBUtility.ClsPub.IPAddress + "','ä¿®æ¹åæ®'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | }else if (OperationType == 4 && ds.Tables[0].Rows.Count == 0) //䏿¨ |
| | | } |
| | | else if (OperationType == 4 && ds.Tables[0].Rows.Count == 0) //䏿¨ |
| | | { |
| | | string sql = "insert into PM_WorkTaskBillMain" + |
| | | "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HBillNo,HProjectID,HProNumber,HProjectStageID,HName,HDate,HTaskNote,HPlanTimes" + |
| | |
| | | //è®°å½æ¥å¿ |
| | | LogService.Write("ç¨æ·:" + user + ",æ¥æ:" + DateTime.Now + ",ä¿®æ¹é¡¹ç®é¶æ®µæ¸
å:" + HBillNo); |
| | | oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "ä¿®æ¹é¡¹ç®é¶æ®µæ¸
åï¼" + HBillNo + "','LMES-项ç®é¶æ®µæ¸
忍¡å','" + DBUtility.ClsPub.IPAddress + "','ä¿®æ¹åæ®'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | }else if(OperationType == 4 && ds.Tables[0].Rows.Count == 0) //䏿¨ |
| | | } |
| | | else if(OperationType == 4 && ds.Tables[0].Rows.Count == 0) //䏿¨ |
| | | { |
| | | string sql = "insert into PM_WorkTaskReportBillMain" + |
| | | "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HBillStatus,HRemark,HMaker,HMakeDate,HOrgID,HReportEmpID,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillType,HMainSourceBillNo) " + |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | | namespace WebAPI.Models |
| | | { |
| | | public class Gy_MouldFileSub_SubMater |
| | | { |
| | | public long HInterID { get; set; }// |
| | | public long HEntryID { get; set; }// |
| | | public string HCloseMan { get; set; }// |
| | | public DateTime HEntryCloseDate { get; set; }// |
| | | public string HCloseType { get; set; }// |
| | | public string HRemark { get; set; }// |
| | | public long HSourceInterID { get; set; }// |
| | | public long HSourceEntryID { get; set; }// |
| | | |
| | | public string HSourceBillNo { get; set; }// |
| | | public string HSourceBillType { get; set; }// |
| | | public double HRelationQty { get; set; }// |
| | | |
| | | public double HRelationMoney { get; set; }// |
| | | public int HItemSubID { get; set; } |
| | | public int HMouldFileID { get; set; } |
| | | public DateTime HUnionDate { get; set; } |
| | | |
| | | } |
| | | } |
| | |
| | | <Compile Include="Models\ClsGy_SupMaterial.cs" /> |
| | | <Compile Include="Models\ClsSc_AssemblyBillMain.cs" /> |
| | | <Compile Include="Models\ClsSc_AssemblyBillSub.cs" /> |
| | | <Compile Include="Models\Gy_MouldFileSub_SubMater.cs" /> |
| | | <Compile Include="Models\åºç¡èµæ\Gy_ColorClass.cs" /> |
| | | <Compile Include="Models\Employee.cs" /> |
| | | <Compile Include="Models\Gy_UserCustomer.cs" /> |