| | |
| | | ",HPeriod='" + omodel.HPeriod.ToString() + "'" + |
| | | //",HRemark='" + omodel.HRemark + "'" + |
| | | ",HUpDater='" + omodel.HMaker + "'" + |
| | | ",HExRate='" + omodel.HExRate + "'" + |
| | | ",HUpDateDate=getdate()" + |
| | | //======================================== |
| | | |
| | | ",HContractDate ='" + omodel.HContractDate.ToString() +"',"+ "HSupID = "+ omodel.HSupID.ToString()+","+ "HContractNumber='"+ omodel.HContractNumber.ToString()+"',"+ "HContractName='"+ omodel.HContractName.ToString() + "',"+ |
| | | ",HContractDate ='" + DateTime.Now.ToString() +"',"+ "HSupID = "+ omodel.HSupID.ToString()+","+ "HContractNumber='"+ omodel.HContractNumber.ToString()+"',"+ "HContractName='"+ omodel.HContractName.ToString() + "',"+ |
| | | "HAddress='"+ omodel.HAddress.ToString() + "',"+ "HSSID="+ omodel.HSSID.ToString() + "," + "HCurID=" + omodel.HCurID.ToString() + "," + "HEmpID=" + omodel.HEmpID.ToString() + "," + "HDeptID=" + omodel.HDeptID.ToString() + ""+ |
| | | // ",HExplanation ='" + omodel.HExplanation.ToString() +"'"+ ",HInnerBillNo ='" + omodel.HInnerBillNo.ToString() + "'"+ |
| | | |
| | |
| | | //主表 |
| | | string mainSql = "insert into Cg_ContractTransportBillMain" + |
| | | "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HRemark,HMaker,HMakeDate" + |
| | | ",HContractDate,HSupID,HContractNumber,HContractName,HAddress,HSSID,HCurID,HEmpID,HDeptID,HExplanation,HInnerBillNo) " + |
| | | ",HContractDate,HSupID,HContractNumber,HContractName,HAddress,HSSID,HCurID,HEmpID,HDeptID,HExplanation,HExRate,HInnerBillNo) " + |
| | | "values(" + |
| | | "" + (omodel.HYear.ToString() != "0" ? omodel.HYear.ToString() : DateTime.Now.Year.ToString()) + |
| | | "," + omodel.HPeriod.ToString() + |
| | |
| | | "','" + omodel.HEmpID + |
| | | "','" + omodel.HDeptID + |
| | | "','" + omodel.HExplanation + |
| | | "','" + omodel.HExRate + |
| | | "','" + omodel.HInnerBillNo + |
| | | "')"; |
| | | |
| | |
| | | public int HDeptID; |
| | | public string HExplanation; |
| | | public string HInnerBillNo; |
| | | public string HExRate; |
| | | } |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | string s = ""; |
| | | //æ¥çæé |
| | | if (!DBUtility.ClsPub.Security_Log("Cg_ContractTransportBill_Delete", 1, false, user)) |
| | | { |
| | |
| | | if (BillOld.ShowBill(Int64.Parse(HInterID), ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | //å é¤åæ§å¶========================================= |
| | | string sql1 = "exec h_p_Cg_ContractTransportBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; |
| | | string sql1 = "exec h_p_Cg_ContractTransportBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Cg_ContractTransportBill_BeforeDelCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | oCN.RunProc("delete from Cg_ContractTransportBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("delete from Cg_ContractTransportBillSub where HInterID= " + HInterID); |
| | | //å é¤åæ®ï¼å
å«å é¤åæ§å¶ãåå
¥æ¥å¿ï¼ |
| | | if (!BillOld.DeleteBill(BillOld.omodel.HInterID, BillOld.omodel.HBillNo, "h_p_Cg_ContractTransportBill_AfterDelCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | //å é¤åæ§å¶================================================================================== |
| | | string sql2 = "exec h_p_Cg_ContractTransportBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql2, "h_p_Cg_ContractTransportBill_AfterDelCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | s = "å é¤åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿åï¼"; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :" + s; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | s = ds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :" + s; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //============================================================================================== |
| | | |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿å"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.Commit(); |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.Message = "å 餿å"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | bool bResult; |
| | | if (refSav == "Add") |
| | | if (refSav == "Add"|| refSav=="1") |
| | | { |
| | | |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | else if (refSav == "Update") |
| | | else if (refSav == "Update" || refSav == "3") |
| | | { |
| | | bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |