| File was renamed from WebAPI/Controllers/Éú²ú¹ÜÀí/Sc_MESBeginWorkBillController.cs | 
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | DBUtility.ClsPub.CurUserName = UserName; | 
|---|
|  |  |  | //ç¼è¾æé | 
|---|
|  |  |  | if (!DBUtility.ClsPub.Security_Log("MES_MESBeginWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) | 
|---|
|  |  |  | if (!DBUtility.ClsPub.Security_Log_second("MES_MESBeginWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //审核æé | 
|---|
|  |  |  | if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName)) | 
|---|
|  |  |  | if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, true, CurUserName)) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | 
|---|
|  |  |  | string refSav = sArray[2].ToString(); | 
|---|
|  |  |  | DBUtility.ClsPub.CurUserName = UserName; | 
|---|
|  |  |  | //ä¿åæé | 
|---|
|  |  |  | if (!DBUtility.ClsPub.Security_Log("MES_MESBeginWorkBill_Edit", 1, true, DBUtility.ClsPub.CurUserName)) | 
|---|
|  |  |  | if (!DBUtility.ClsPub.Security_Log_second("MES_MESBeginWorkBill_Edit", 1, true, DBUtility.ClsPub.CurUserName)) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | oCN.BeginTran(); | 
|---|
|  |  |  | //æ¥è¯¢äº§éæ±æ¥ä¸´æ¶è¡¨æ°é | 
|---|
|  |  |  | ds = oCN.RunProcReturn("select isnull(HQty,0) HQty,isnull(HWasterQty,0) HWasterQty,isnull(HBadQty,0) HBadQty  from Sc_ICMOBillWorkQtyStatus_Tmp where HInterID='" + HInterID + "' and HICMOInterID='" + HICMOInterID + "' and HICMOEntryID='" + HICMOEntryID + "'", "Sc_ICMOBillWorkQtyStatus_Tmp"); | 
|---|
|  |  |  | double HQty =double.Parse(ds.Tables[0].Rows[0]["HQty"].ToString()); | 
|---|
|  |  |  | double HWasterQty = double.Parse(ds.Tables[0].Rows[0]["HWasterQty"].ToString()); | 
|---|
|  |  |  | double HBadQty = double.Parse(ds.Tables[0].Rows[0]["HBadQty"].ToString()); | 
|---|
|  |  |  | double sumqty = HQty + HBadQty + HWasterQty;  //æ±æ¥æ°é+ä¸è¯+æ¥åº | 
|---|
|  |  |  | //æ´æ°äº§éè£
é临æ¶è¡¨å·²æ±æ¥æ°é | 
|---|
|  |  |  | string sql1 = string.Format(@"update Sc_ICMOBillStatus_Tmp  set  HICMOStatus='1',HFinishFlag='0', HRelationInterID=0,HSplitRelationQty=HSplitRelationQty-" + sumqty + ",HDateFinishQty=HDateFinishQty-"+ sumqty + "   where  HICMOInterID='"+ HICMOInterID + "' and HICMOEntryID='"+ HICMOEntryID + "'"); | 
|---|
|  |  |  | oCN.RunProc(sql1); | 
|---|
|  |  |  | //æ´æ°åæ¢ç¶æå¼ | 
|---|
|  |  |  | string sql = string.Format(@"delete Sc_ICMOBillWorkQtyStatus_Tmp  where HInterID='" + HInterID + "'"); | 
|---|
|  |  |  | oCN.RunProc(sql); | 
|---|
|  |  |  | //æ´æ°äº§éè£
é临æ¶è¡¨å·²æ±æ¥æ°é | 
|---|
|  |  |  | string sql1 = string.Format(@"update Sc_ICMOBillStatus_Tmp  set HRelationInterID=0,HSplitRelationQty=0 where HInterID='" + HInterID + "' and HICMOInterID='"+ HICMOInterID + "' and HICMOEntryID='"+ HICMOEntryID + "'"); | 
|---|
|  |  |  | oCN.RunProc(sql); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | oCN.Commit(); | 
|---|
|  |  |  | objJsonResult.code = "1"; | 
|---|
|  |  |  | objJsonResult.count = 1; | 
|---|
|  |  |  | 
|---|
|  |  |  | ListModels oListModels = new ListModels(); | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //ç³»ç»åæ° çæçäº§æ±æ¥åå夿æ¯å¦é¦æ£ | 
|---|
|  |  |  | //string sReturn = ""; | 
|---|
|  |  |  | //if (oSystemParameter.ShowBill(ref sReturn) == true) | 
|---|
|  |  |  | //{ | 
|---|
|  |  |  | //    if (oSystemParameter.omodel.Sc_ICMOReportBill_FirstCheckOut == "Y") //ç³»ç»åæ°   å¿
é¡»é¦ä»¶æ£éªéè¿æè½ä¿ååæ® | 
|---|
|  |  |  | //    { | 
|---|
|  |  |  | //        //ç³»ç»åæ°å®¡æ ¸,åæ ¹æ®ç产订åå·ï¼å
³è馿£æ£éªå䏿ºåå·æ¥æ¾æ£éªåæ°æ®ï¼å¤æåæ®ç¶ææ¯å¦åæ ¼ | 
|---|
|  |  |  | //        ds = oCN.RunProcReturn("select *   from QC_FirstPieceCheckBillMain where HICMOInterID='" + HICMOInterID + "' and HICMOEntryID='" + HICMOEntryID + "'", "QC_FirstPieceCheckBillMain"); | 
|---|
|  |  |  | //        if (ds.Tables[0].Rows.Count > 0) //æé¦æ£æ£éªå | 
|---|
|  |  |  | //        { | 
|---|
|  |  |  | //            int rows = ds.Tables[0].AsEnumerable().Where(item => item["HLastResult"].ToString().Equals("True")).Count(); //夿å½åæ°æ®(䏿¡æå¤æ¡)䏿ç»å¤å®æ¯å¦æåæ ¼ | 
|---|
|  |  |  | //            if (rows <= 0) | 
|---|
|  |  |  | //            { | 
|---|
|  |  |  | //                objJsonResult.code = "0"; | 
|---|
|  |  |  | //                objJsonResult.count = 0; | 
|---|
|  |  |  | //                objJsonResult.Message = "å½åå·¥å馿£æ£éªå¤å®ä¸åæ ¼,æ æ³çææ±æ¥åï¼"; | 
|---|
|  |  |  | //                objJsonResult.data = null; | 
|---|
|  |  |  | //                return objJsonResult; | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | //    } | 
|---|
|  |  |  | //} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | string sHSourceType = HSourceBillType; | 
|---|
|  |  |  | string  BillType = "3711";  //åæ®ç±»å (çäº§æ±æ¥å) | 
|---|
|  |  |  | //å¾å°mainid | 
|---|