New file |
| | |
| | | using DBUtility; |
| | | using Model; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Web; |
| | | using System.Web.Http; |
| | | using System.Windows.Forms; |
| | | using WebAPI.Models; |
| | | using static WebAPI.Controllers.Pay_SingleBalBillController; |
| | | using static WebAPI.Controllers.Pay_GroupBalBillController; |
| | | |
| | | namespace WebAPI.Controllers.å·¥èµç®¡ç.å·¥èµè®¡ç® |
| | | { |
| | | public class Pay_SalaryCulateController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus;//åæ®ç¶æï¼æ°å¢ï¼ä¿®æ¹ï¼æµè§ï¼æ´æ°åä»·ï¼åæ´ï¼ |
| | | private json objJsonResult = new json(); |
| | | public DataSet ds = new DataSet(); |
| | | public SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | public DAL.ClsSc_ICMOBill BillOld = new DAL.ClsSc_ICMOBill(); |
| | | string user_LongShan = ""; |
| | | string HName_LongShan = ""; |
| | | |
| | | #region å·¥èµè®¡ç®-æ°æ®æ¥è¯¢ |
| | | /// <summary> |
| | | /// è¿å项ç®é¶æ®µå表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Pay_SalaryCalculate/list")] |
| | | [HttpGet] |
| | | public object getSalaryCalculateData(string HBeginDate, string HEndDate, int HOperatorType,string HBillType,string user) |
| | | { |
| | | try |
| | | { |
| | | string sql = "exec h_p_Pay_SalaryCalculate_getData " + HOperatorType + ",'" + HBeginDate + "','" + HEndDate + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Pay_SalaryCalculate_getData"); |
| | | |
| | | if (HOperatorType == 1) |
| | | { |
| | | oCN.BeginTran(); |
| | | objJsonResult = getSalaryCalculateData_SingleBalBill(HBeginDate, HEndDate, HOperatorType, HBillType, user); |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å·¥èµè®¡ç®å®æï¼ï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | }else if(HOperatorType == 2) |
| | | { |
| | | oCN.BeginTran(); |
| | | objJsonResult = getSalaryCalculateData_GroupBalBill(HBeginDate, HEndDate, HOperatorType, HBillType, user); |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å·¥èµè®¡ç®å®æï¼ï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | 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 å·¥èµè®¡ç®-个人工èµç»ç®å |
| | | #region å·¥èµè®¡ç®-æ¹é计ç®-个人工èµç»ç®å |
| | | public json getSalaryCalculateData_SingleBalBill(string HBeginDate, string HEndDate, int HOperatorType, string HBillType, string user) |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦æç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log("Pay_SingleBalBill_Edit", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ°å¢æé!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //è·åå·¥åºåºç«æ±æ¥åæ°æ® |
| | | string sql = "exec h_p_Pay_SalaryCalculate_getData " + HOperatorType + ",'" + HBeginDate + "','" + HEndDate + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Pay_SalaryCalculate_getData"); |
| | | DataTable data = ds.Tables[0]; |
| | | //æ´çå·¥åºåºç«æ±æ¥åæ°æ®ï¼å¹¶åå«çæä¸ªäººå·¥èµç»ç®å |
| | | if (data.Rows.Count > 0) |
| | | { |
| | | int HEmpIDBar = -100; //å½å个人工èµç»ç®å-èåIDæ è®° |
| | | Pay_SingleBalBillMain mainTable = new Pay_SingleBalBillMain(); |
| | | List<Pay_SingleBalBillController.Pay_SingleBalBillSub> subTable = new List<Pay_SingleBalBillController.Pay_SingleBalBillSub>(); |
| | | for(int i = 0; i < data.Rows.Count; i++) |
| | | { |
| | | int HEmpID = data.Rows[i]["HEmpID"] == null ? 0 : (int)data.Rows[i]["HEmpID"]; |
| | | if (HEmpIDBar != HEmpID) |
| | | { |
| | | if (subTable.Count > 0) |
| | | { |
| | | //æ°å¢åæ® |
| | | objJsonResult = AddBillMain_Pay_SingleBalBillMain(mainTable, user,subTable); |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //æ¸
空表头信æ¯åå表信æ¯ï¼å è½½æ°åæ®çæ°æ® |
| | | mainTable = new Pay_SingleBalBillMain(); |
| | | subTable.Clear(); |
| | | } |
| | | //çæåæ®åï¼æ´æ°å½å个人工èµç»ç®å-èåIDæ è®° |
| | | HEmpIDBar = HEmpID; |
| | | //å¡«å
è¡¨å¤´ä¿¡æ¯ |
| | | mainTable.HInterID = (int)DBUtility.ClsPub.CreateBillID(HBillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | mainTable.HBillNo = DBUtility.ClsPub.CreateBillCode(HBillType, ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | mainTable.HDate = DateTime.Now.ToString("yyyy-MM-dd"); |
| | | mainTable.HInnerBillNo = mainTable.HBillNo; |
| | | mainTable.HDeptID = data.Rows[i]["HDeptID"] == null ? 0 : (int)data.Rows[i]["HDeptID"]; |
| | | mainTable.HGroupID = data.Rows[i]["HGroupID"] == null ? 0 :(int)data.Rows[i]["HGroupID"]; |
| | | mainTable.HEmpID = data.Rows[i]["HEmpID"] == null ? 0 : (int)data.Rows[i]["HEmpID"]; |
| | | mainTable.HPayTypeID = 0; |
| | | mainTable.HSourceBillID = 0; |
| | | mainTable.HSourceBillNo = ""; |
| | | mainTable.HSourceBillType = ""; |
| | | mainTable.HExplanation = ""; |
| | | mainTable.HRemark = ""; |
| | | mainTable.HMaker = user; |
| | | mainTable.HMakerDate = DateTime.Now.ToString("yyyy-MM-dd"); |
| | | } |
| | | //å¡«å
å¹¶æ·»å å表记å½ä¿¡æ¯ |
| | | Pay_SingleBalBillController.Pay_SingleBalBillSub oSub = new Pay_SingleBalBillController.Pay_SingleBalBillSub(); |
| | | oSub.HMaterID = data.Rows[i]["HMaterID"] == null ? 0 : (int)data.Rows[i]["HMaterID"]; |
| | | oSub.HProcID = data.Rows[i]["HProcID"] == null ? 0 : (int)data.Rows[i]["HProcID"]; |
| | | oSub.HEmpID = data.Rows[i]["HEmpID"] == null ? 0 : (int)data.Rows[i]["HEmpID"]; |
| | | oSub.HTimes = data.Rows[i]["HTimes"] == null ? 0 : double.Parse(data.Rows[i]["HTimes"].ToString()); |
| | | oSub.HQty = data.Rows[i]["HQty"] == null ? 0 : double.Parse(data.Rows[i]["HQty"].ToString()); |
| | | oSub.HPrice = data.Rows[i]["HPrice"] == null ? 0 : double.Parse(data.Rows[i]["HPrice"].ToString()); |
| | | oSub.HPriceRate = 1; |
| | | oSub.HSubsidyQty = 0; |
| | | oSub.HSubsidyMoney = 0; |
| | | oSub.HSubsidyTotal = 0; |
| | | oSub.HDeuctTotal = 0; |
| | | oSub.HPackQty = 0; |
| | | oSub.HPackPrice = 0; |
| | | oSub.HPackMoney = 0; |
| | | oSub.HPackMaterID = 0; |
| | | oSub.HMoney = data.Rows[i]["HMoney"] == null ? 0 : double.Parse(data.Rows[i]["HMoney"].ToString()); |
| | | oSub.HRemark = ""; |
| | | oSub.HICMOInterID = data.Rows[i]["HICMOInterID"] == null ? 0 : (int)data.Rows[i]["HICMOInterID"]; |
| | | oSub.HICMOBillNo = data.Rows[i]["HICMOBillNo"] == null ? "" : data.Rows[i]["HICMOBillNo"].ToString(); |
| | | oSub.HProcReportInterID = 0; |
| | | oSub.HProcReportEntryID = 0; |
| | | oSub.HProcReportBillNo = ""; |
| | | oSub.HProcPlanInterID = data.Rows[i]["HProcPlanInterID"] == null ? 0 : (int)data.Rows[i]["HProcPlanInterID"]; |
| | | oSub.HProcPlanEntryID = data.Rows[i]["HProcPlanEntryID"] == null ? 0 : (int)data.Rows[i]["HProcPlanEntryID"]; |
| | | oSub.HProcPlanBillNo = data.Rows[i]["HProcPlanBillNo"] == null ? "" : data.Rows[i]["HProcPlanBillNo"].ToString(); |
| | | oSub.HSourceInterID = 0; //data.Rows[i]["HSourceInterID"] == null ? 0 : (int)data.Rows[i]["HSourceInterID"]; |
| | | oSub.HSourceEntryID = 0; //data.Rows[i]["HSourceEntryID "] == null ? 0 : (int)data.Rows[i]["HSourceEntryID "]; |
| | | oSub.HSourceBillNo = ""; //data.Rows[i]["HSourceBillNo"] == null ? "" : data.Rows[i]["HSourceBillNo"].ToString(); |
| | | oSub.HSourceBillType = ""; |
| | | oSub.HRelationQty = 0; |
| | | oSub.HRelationMoney = 0; |
| | | oSub.HCloseMan = ""; |
| | | oSub.HEntryCloseDate = ""; |
| | | subTable.Add(oSub); |
| | | } |
| | | //çææå䏿¡è®°å½ï¼æå䏿¡è®°å½å ä¸ºæ æ³åä¸data.Rows[data.Rows.Count]["HEmpID"]æ¯è¾ï¼æä»¥ä¸ä¼æ·»å ï¼éè¦æåå¦å¤æ·»å |
| | | objJsonResult = AddBillMain_Pay_SingleBalBillMain(mainTable, user, subTable); |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "çæå¤±è´¥ï¼æå®æ¶é´æ®µå
æ æ°æ®ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | #region å·¥èµè®¡ç®-å·¥èµç»ç®å(个人) 主表 |
| | | public json AddBillMain_Pay_SingleBalBillMain(Pay_SingleBalBillMain oMain,string user,List<Pay_SingleBalBillController.Pay_SingleBalBillSub> subTable) |
| | | { |
| | | int OperationType = 1;//æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ 2 å¤å¶ |
| | | string HComputerName = SystemInformation.ComputerName; //设å¤åç§° |
| | | try |
| | | { |
| | | List<Pay_SingleBalBillMain> mainList = new List<Pay_SingleBalBillMain>(); |
| | | mainList.Add(oMain); |
| | | |
| | | int HYear = int.Parse(mainList[0].HDate.Split('-')[0]); |
| | | int HPeriod = int.Parse(mainList[0].HDate.Split('-')[1]); |
| | | string HBillType = "2205"; |
| | | string HBillSubType = ""; |
| | | int HBillStatus = 1; |
| | | |
| | | int HInterID = mainList[0].HInterID; |
| | | string HBillNo = mainList[0].HBillNo; |
| | | string HDate = mainList[0].HDate; |
| | | string HInnerBillNo = mainList[0].HInnerBillNo; |
| | | int HGroupID = mainList[0].HGroupID; |
| | | int HDeptID = mainList[0].HDeptID; |
| | | int HEmpID = mainList[0].HEmpID; |
| | | int HPayType = mainList[0].HPayTypeID; |
| | | int HMainSourceInterID = mainList[0].HSourceBillID; |
| | | string HMainSourceBillNo = mainList[0].HSourceBillNo; |
| | | string HMainSourceBillType = mainList[0].HSourceBillType; |
| | | string HExplanation = mainList[0].HExplanation; |
| | | string HRemark = mainList[0].HRemark; |
| | | |
| | | //å¶åãä¿®æ¹ |
| | | string HMaker = mainList[0].HMaker; |
| | | string HMakerDate = mainList[0].HMakerDate; |
| | | |
| | | ds = oCN.RunProcReturn("select * from Pay_SingleBalBillMain where HInterID = " + HInterID + " and HBillNo = '" + HBillNo + "'", "Pay_SingleBalBillMain"); |
| | | |
| | | if (OperationType == 1 && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | { |
| | | string sql = "insert into Pay_SingleBalBillMain" + |
| | | "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HBillStatus,HGroupID,HDeptID,HEmpID,HPayType,HExplanation,HInnerBillNo,HRemark,HMaker,HMakeDate,HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HAutoCreate) " + |
| | | "values(" + |
| | | "" + HYear + |
| | | "," + HPeriod + |
| | | ",'" + HBillType + |
| | | "','" + HBillSubType + |
| | | "'," + HInterID + |
| | | ",'" + HDate + |
| | | "','" + HBillNo + |
| | | "'," + HBillStatus + |
| | | "," + HGroupID + |
| | | "," + HDeptID + |
| | | "," + HEmpID + |
| | | "," + HPayType + |
| | | ",'" + HExplanation + |
| | | "','" + HInnerBillNo + |
| | | "','" + HRemark + |
| | | "','" + HMaker + |
| | | "','" + HMakerDate + |
| | | "'," + HMainSourceInterID + |
| | | ",'" + HMainSourceBillNo + |
| | | "','" + HMainSourceBillType + |
| | | "'," + 1 + |
| | | ")"; |
| | | |
| | | //主表 |
| | | oCN.RunProc(sql); |
| | | 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); |
| | | } |
| | | |
| | | //ä¿åå表 |
| | | objJsonResult = AddBillSub_Pay_SingleBalBillMain(subTable, HInterID, HBillNo, OperationType); |
| | | |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | #region å·¥èµè®¡ç®-å·¥èµç»ç®å(个人) å表 |
| | | public json AddBillSub_Pay_SingleBalBillMain(List<Pay_SingleBalBillController.Pay_SingleBalBillSub> DetailColl, long HInterID, string HBillNo, int OperationType) |
| | | { |
| | | try |
| | | { |
| | | int i = 0; //ä½ä¸ºå表å
ç |
| | | foreach (Pay_SingleBalBillController.Pay_SingleBalBillSub oSub in DetailColl) |
| | | { |
| | | i++; //åä¸ä¸ªä¸»è¡¨ä¸çå表çå
ç èªå¢ |
| | | |
| | | int HEntryID = i; |
| | | |
| | | int HMaterID = oSub.HMaterID; |
| | | int HProcID = oSub.HProcID; |
| | | int HEmpID = oSub.HEmpID; |
| | | |
| | | |
| | | double HTimes = oSub.HTimes; |
| | | double HQty = oSub.HQty; |
| | | double HPrice = oSub.HPrice; |
| | | double HPriceRate = oSub.HPriceRate; |
| | | double HSubsidyQty = oSub.HSubsidyQty; |
| | | double HSubsidyMoney = oSub.HSubsidyMoney; |
| | | double HSubsidyTotal = oSub.HSubsidyTotal; |
| | | double HDeuctTotal = oSub.HDeuctTotal; |
| | | double HPackQty = oSub.HPackQty; |
| | | double HPackPrice = oSub.HPackPrice; |
| | | double HPackMoney = oSub.HPackMoney; |
| | | int HPackMaterID = oSub.HPackMaterID; |
| | | double HMoney = oSub.HMoney; |
| | | |
| | | int HICMOInterID = oSub.HICMOInterID; |
| | | string HICMOBillNo = oSub.HICMOBillNo; |
| | | int HProcReportInterID = oSub.HProcReportInterID; |
| | | int HProcReportEntryID = oSub.HProcReportEntryID; |
| | | string HProcReportBillNo = oSub.HProcReportBillNo; |
| | | int HProcPlanInterID = oSub.HProcPlanInterID; |
| | | int HProcPlanEntryID = oSub.HProcPlanEntryID; |
| | | string HProcPlanBillNo = oSub.HProcPlanBillNo; |
| | | |
| | | string HRemark = oSub.HRemark; |
| | | |
| | | int HSourceInterID = oSub.HSourceInterID; |
| | | int HSourceEntryID = oSub.HSourceEntryID; |
| | | string HSourceBillNo = oSub.HSourceBillNo; |
| | | string HSourceBillType = oSub.HSourceBillType; |
| | | double HRelationQty = oSub.HRelationQty; |
| | | double HRelationMoney = oSub.HRelationMoney; |
| | | string HCloseMan = oSub.HCloseMan; |
| | | string HEntryCloseDate = oSub.HEntryCloseDate; |
| | | |
| | | string sql = "insert into Pay_SingleBalBillSub" + |
| | | "(HInterID,HEntryID,HMaterID,HProcID,HEmpID,HTimes,HQty,HPrice,HPriceRate,HSubsidyQty,HSubsidyMoney,HSubsidyTotal,HDeuctTotal" + |
| | | ",HPackQty,HPackPrice,HPackMoney,HPackMaterID,HMoney,HICMOInterID,HICMOBillNo,HProcReportInterID,HProcReportEntryID,HProcReportBillNo" + |
| | | ",HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HCloseMan,HEntryCloseDate) " + |
| | | "values(" + |
| | | "" + HInterID + |
| | | "," + HEntryID + |
| | | "," + HMaterID + |
| | | "," + HProcID + |
| | | "," + HEmpID + |
| | | "," + HTimes + |
| | | "," + HQty + |
| | | "," + HPrice + |
| | | "," + HPriceRate + |
| | | "," + HSubsidyQty + |
| | | "," + HSubsidyMoney + |
| | | "," + HSubsidyTotal + |
| | | "," + HDeuctTotal + |
| | | "," + HPackQty + |
| | | "," + HPackPrice + |
| | | "," + HPackMoney + |
| | | "," + HPackMaterID + |
| | | "," + HMoney + |
| | | "," + HICMOInterID + |
| | | ",'" + HICMOBillNo + |
| | | "'," + HProcReportInterID + |
| | | "," + HProcReportEntryID + |
| | | ",'" + HProcReportBillNo + |
| | | "'," + HProcPlanInterID + |
| | | "," + HProcPlanEntryID + |
| | | ",'" + HProcPlanBillNo + |
| | | "','" + HRemark + |
| | | "'," + HSourceInterID + |
| | | "," + HSourceEntryID + |
| | | ",'" + HSourceBillNo + |
| | | "','" + HSourceBillType + |
| | | "'," + HRelationQty + |
| | | "," + HRelationMoney + |
| | | ",'" + HCloseMan + |
| | | "','" + HEntryCloseDate + |
| | | "')"; |
| | | |
| | | oCN.RunProc(sql); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | }catch(Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region å·¥èµè®¡ç®-éä½å·¥èµç»ç®å |
| | | #region å·¥èµè®¡ç®-æ¹é计ç®-éä½å·¥èµç»ç®å |
| | | public json getSalaryCalculateData_GroupBalBill(string HBeginDate, string HEndDate, int HOperatorType, string HBillType, string user) |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦æç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log("Pay_GroupBalBill_Edit", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ°å¢æé!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //è·åå·¥åºåºç«æ±æ¥åæ°æ® |
| | | string sql = "exec h_p_Pay_SalaryCalculate_getData " + HOperatorType + ",'" + HBeginDate + "','" + HEndDate + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Pay_SalaryCalculate_getData"); |
| | | DataTable data = ds.Tables[0]; |
| | | //æ¥è¯¢å表2æéåé |
| | | DataSet ds1; |
| | | string sql1; |
| | | //æ´çå·¥åºåºç«æ±æ¥åæ°æ®ï¼å¹¶åå«çæä¸ªäººå·¥èµç»ç®å |
| | | if (data.Rows.Count > 0) |
| | | { |
| | | int HDeptIDBar = -100; |
| | | int HGroupIDBar = -100; |
| | | |
| | | Pay_GroupBalBillMain mainTable = new Pay_GroupBalBillMain(); |
| | | List<Pay_GroupBalBillController.Pay_GroupBalBillSub> subTable = new List<Pay_GroupBalBillController.Pay_GroupBalBillSub>(); |
| | | List<Pay_GroupBalBillController.Pay_GroupBalBillEmp> subEmpTable = new List<Pay_GroupBalBillController.Pay_GroupBalBillEmp>(); |
| | | for (int i = 0; i < data.Rows.Count; i++) |
| | | { |
| | | int HDeptID = data.Rows[i]["HDeptID"] == null ? 0 : (int)data.Rows[i]["HDeptID"]; |
| | | int HGroupID = data.Rows[i]["HGroupID"] == null ? 0 : (int)data.Rows[i]["HGroupID"]; |
| | | if (HDeptIDBar != HDeptID || HGroupIDBar != HGroupID) |
| | | { |
| | | if (subTable.Count > 0) |
| | | { |
| | | //è·åå表2æ°æ® |
| | | sql1 = "select * from h_v_Gy_Employee_ForWeb where HDeptID ='" + HDeptIDBar + "' and HGroupID = '" + HGroupIDBar + "'"; |
| | | ds1 = oCN.RunProcReturn(sql1, "h_v_Gy_Employee_ForWeb"); |
| | | if (ds1.Tables[0].Rows.Count > 0) |
| | | { |
| | | for(int j = 0; j < ds1.Tables[0].Rows.Count; j++) |
| | | { |
| | | Pay_GroupBalBillController.Pay_GroupBalBillEmp oSubEmp = new Pay_GroupBalBillController.Pay_GroupBalBillEmp(); |
| | | oSubEmp.HEmpID = ds1.Tables[0].Rows[j]["HItemID"] == null ? 0 : int.Parse(ds1.Tables[0].Rows[j]["HItemID"].ToString()); |
| | | oSubEmp.HEmpRate = ds1.Tables[0].Rows[j]["HEmpRate"] == null ? 0 : double.Parse(ds1.Tables[0].Rows[j]["HEmpRate"].ToString()); |
| | | oSubEmp.HBaseTimes = 0; |
| | | oSubEmp.HMoney = 0; |
| | | oSubEmp.HOtherSubsidy = 0; |
| | | oSubEmp.HOtherDeduct = 0; |
| | | oSubEmp.HYF = 0; |
| | | oSubEmp.HIsPay = false; |
| | | oSubEmp.HAvgFlag = false; |
| | | oSubEmp.HRemark = ""; |
| | | subEmpTable.Add(oSubEmp); |
| | | } |
| | | } |
| | | |
| | | //æ°å¢åæ® |
| | | objJsonResult = AddBillMain_Pay_GroupBalBill(mainTable, user, subTable, subEmpTable); |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //æ¸
空表头信æ¯åå表信æ¯ï¼å è½½æ°åæ®çæ°æ® |
| | | mainTable = new Pay_GroupBalBillMain(); |
| | | subTable.Clear(); |
| | | subEmpTable.Clear(); |
| | | } |
| | | //çæåæ®åï¼æ´æ°å½åéä½å·¥èµç»ç®å-é¨é¨IDï¼çç»ID |
| | | HDeptIDBar = HDeptID; |
| | | HGroupIDBar = HGroupID; |
| | | |
| | | //å¡«å
è¡¨å¤´ä¿¡æ¯ |
| | | mainTable.HInterID = (int)DBUtility.ClsPub.CreateBillID(HBillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | mainTable.HBillNo = DBUtility.ClsPub.CreateBillCode(HBillType, ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | mainTable.HDate = DateTime.Now.ToString("yyyy-MM-dd"); |
| | | mainTable.HInnerBillNo = mainTable.HBillNo; |
| | | mainTable.HDeptID = data.Rows[i]["HDeptID"] == null ? 0 : (int)data.Rows[i]["HDeptID"]; |
| | | mainTable.HGroupID = data.Rows[i]["HGroupID"] == null ? 0 : (int)data.Rows[i]["HGroupID"]; |
| | | mainTable.HSumMoney = 0; |
| | | mainTable.HOtherSubsidy = 0; |
| | | mainTable.HPayMoney = 0; |
| | | mainTable.HOtherDeduct = 0; |
| | | mainTable.HSourceBillID = 0; |
| | | mainTable.HSourceBillNo = ""; |
| | | mainTable.HSourceBillType = ""; |
| | | mainTable.HExplanation = ""; |
| | | mainTable.HRemark = ""; |
| | | mainTable.HMaker = user; |
| | | mainTable.HMakerDate = DateTime.Now.ToString("yyyy-MM-dd"); |
| | | } |
| | | |
| | | //å¡«å
å¹¶æ·»å å表记å½ä¿¡æ¯ |
| | | Pay_GroupBalBillController.Pay_GroupBalBillSub oSub = new Pay_GroupBalBillController.Pay_GroupBalBillSub(); |
| | | |
| | | oSub.HMaterID = data.Rows[i]["HMaterID"] == null ? 0 : (int)data.Rows[i]["HMaterID"]; |
| | | oSub.HUnitID = data.Rows[i]["HUnitID"] == null ? 0 : (int)data.Rows[i]["HUnitID"]; |
| | | oSub.HProcID = data.Rows[i]["HProcID"] == null ? 0 : (int)data.Rows[i]["HProcID"]; |
| | | oSub.HSourceID = data.Rows[i]["HSourceID"] == null ? 0 : (int)data.Rows[i]["HSourceID"]; |
| | | oSub.HTimes = data.Rows[i]["HTimes"] == null ? 0 : double.Parse(data.Rows[i]["HTimes"].ToString()); |
| | | oSub.HQty = data.Rows[i]["HQty"] == null ? 0 : double.Parse(data.Rows[i]["HQty"].ToString()); |
| | | oSub.HPrice = data.Rows[i]["HPrice"] == null ? 0 : double.Parse(data.Rows[i]["HPrice"].ToString()); |
| | | oSub.HMoney = data.Rows[i]["HMoney"] == null ? 0 : double.Parse(data.Rows[i]["HMoney"].ToString()); |
| | | oSub.HRemark = ""; |
| | | oSub.HICMOInterID = 0; // data.Rows[i]["HICMOInterID"] == null ? 0 : (int)data.Rows[i]["HICMOInterID"]; |
| | | oSub.HICMOBillNo = ""; // data.Rows[i]["HICMOBillNo"] == null ? "" : data.Rows[i]["HICMOBillNo"].ToString(); |
| | | oSub.HProcReportInterID = 0; |
| | | oSub.HProcReportEntryID = 0; |
| | | oSub.HProcReportBillNo = ""; |
| | | oSub.HProcPlanInterID = 0; // data.Rows[i]["HProcPlanInterID"] == null ? 0 : (int)data.Rows[i]["HProcPlanInterID"]; |
| | | oSub.HProcPlanEntryID = 0; // data.Rows[i]["HProcPlanEntryID"] == null ? 0 : (int)data.Rows[i]["HProcPlanEntryID"]; |
| | | oSub.HProcPlanBillNo = ""; // data.Rows[i]["HProcPlanBillNo"] == null ? "" : data.Rows[i]["HProcPlanBillNo"].ToString(); |
| | | oSub.HSourceInterID = data.Rows[i]["HSourceInterID"] == null ? 0 : (int)data.Rows[i]["HSourceInterID"]; |
| | | oSub.HSourceEntryID = data.Rows[i]["HSourceEntryID"] == null ? 0 : (int)data.Rows[i]["HSourceEntryID"]; |
| | | oSub.HSourceBillNo = data.Rows[i]["HSourceBillNo"] == null ? "" : data.Rows[i]["HSourceBillNo"].ToString(); |
| | | oSub.HSourceBillType = data.Rows[i]["HSourceBillType"] == null ? "" : data.Rows[i]["HSourceBillType"].ToString(); |
| | | oSub.HRelationQty = data.Rows[i]["HQty"] == null ? 0 : double.Parse(data.Rows[i]["HQty"].ToString()); |
| | | oSub.HRelationMoney = data.Rows[i]["HMoney"] == null ? 0 : double.Parse(data.Rows[i]["HMoney"].ToString()); |
| | | subTable.Add(oSub); |
| | | } |
| | | |
| | | //çææå䏿¡è®°å½ï¼æå䏿¡è®°å½å ä¸ºæ æ³åä¸data.Rows[data.Rows.Count]["HEmpID"]æ¯è¾ï¼æä»¥ä¸ä¼æ·»å ï¼éè¦æåå¦å¤æ·»å |
| | | sql1 = "select * from h_v_Gy_Employee_ForWeb where HDeptID ='" + HDeptIDBar + "' and HGroupID = '" + HGroupIDBar + "'"; |
| | | ds1 = oCN.RunProcReturn(sql1, "h_v_Gy_Employee_ForWeb"); |
| | | if (ds1.Tables[0].Rows.Count > 0) |
| | | { |
| | | for (int j = 0; j < ds1.Tables[0].Rows.Count; j++) |
| | | { |
| | | Pay_GroupBalBillController.Pay_GroupBalBillEmp oSubEmp = new Pay_GroupBalBillController.Pay_GroupBalBillEmp(); |
| | | oSubEmp.HEmpID = ds1.Tables[0].Rows[j]["HItemID"] == null ? 0 : int.Parse(ds1.Tables[0].Rows[j]["HItemID"].ToString()); |
| | | oSubEmp.HEmpRate = ds1.Tables[0].Rows[j]["HEmpRate"] == null ? 0 : double.Parse(ds1.Tables[0].Rows[j]["HEmpRate"].ToString()); |
| | | oSubEmp.HBaseTimes = 0; |
| | | oSubEmp.HMoney = 0; |
| | | oSubEmp.HOtherSubsidy = 0; |
| | | oSubEmp.HOtherDeduct = 0; |
| | | oSubEmp.HYF = 0; |
| | | oSubEmp.HIsPay = false; |
| | | oSubEmp.HAvgFlag = false; |
| | | oSubEmp.HRemark = ""; |
| | | subEmpTable.Add(oSubEmp); |
| | | } |
| | | } |
| | | |
| | | objJsonResult = AddBillMain_Pay_GroupBalBill(mainTable, user, subTable,subEmpTable); |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "çæå¤±è´¥ï¼æå®æ¶é´æ®µå
æ æ°æ®ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | #region å·¥èµè®¡ç®-å·¥èµç»ç®å(éä½) 主表 |
| | | public json AddBillMain_Pay_GroupBalBill(Pay_GroupBalBillMain oMain, string user, List<Pay_GroupBalBillController.Pay_GroupBalBillSub> subTable, List<Pay_GroupBalBillController.Pay_GroupBalBillEmp> subEmpTable) |
| | | { |
| | | int OperationType = 1;//æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ 2 å¤å¶ |
| | | |
| | | string HComputerName = SystemInformation.ComputerName; //设å¤åç§° |
| | | |
| | | try |
| | | { |
| | | List<Pay_GroupBalBillMain> mainList = new List<Pay_GroupBalBillMain>(); |
| | | mainList.Add(oMain); |
| | | |
| | | |
| | | int HYear = int.Parse(mainList[0].HDate.Split('-')[0]); |
| | | int HPeriod = int.Parse(mainList[0].HDate.Split('-')[1]); |
| | | string HBillType = "2201"; |
| | | string HBillSubType = ""; |
| | | int HBillStatus = 1; |
| | | |
| | | int HInterID = mainList[0].HInterID; |
| | | string HBillNo = mainList[0].HBillNo; |
| | | string HDate = mainList[0].HDate; |
| | | string HInnerBillNo = mainList[0].HInnerBillNo; |
| | | int HGroupID = mainList[0].HGroupID; |
| | | string HGroupName = mainList[0].HGroupName; |
| | | double HSumMoney = mainList[0].HSumMoney; |
| | | double HOtherSubsidy = mainList[0].HOtherSubsidy; |
| | | int HDeptID = mainList[0].HDeptID; |
| | | string HDeptName = mainList[0].HDeptName; |
| | | double HPayMoney = mainList[0].HPayMoney; |
| | | double HOtherDeduct = mainList[0].HOtherDeduct; |
| | | string HSourceBillType = mainList[0].HSourceBillType; |
| | | int HSourceBillID = mainList[0].HSourceBillID; |
| | | string HSourceBillNo = mainList[0].HSourceBillNo; |
| | | string HExplanation = mainList[0].HExplanation; |
| | | string HRemark = mainList[0].HRemark; |
| | | string HMaker = mainList[0].HMaker; |
| | | string HMakerDate = mainList[0].HMakerDate; |
| | | string HUpdater = mainList[0].HUpdater; |
| | | string HUpdaterDate = mainList[0].HUpdaterDate; |
| | | string HChecker = mainList[0].HChecker; |
| | | string HCheckerDate = mainList[0].HCheckerDate; |
| | | string HCloseMan = mainList[0].HCloseMan; |
| | | string HCloseManDate = mainList[0].HCloseManDate; |
| | | string HDeleteMan = mainList[0].HDeleteMan; |
| | | string HDeleteManDate = mainList[0].HDeleteManDate; |
| | | string HBacker = mainList[0].HBacker; |
| | | string HBackerDate = mainList[0].HBackerDate; |
| | | string HBackRemark = mainList[0].HBackRemark; |
| | | |
| | | ds = oCN.RunProcReturn("select * from Pay_GroupBalBillMain where HInterID = " + HInterID + " and HBillNo = '" + HBillNo + "'", "Pay_GroupBalBillMain"); |
| | | |
| | | if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | { |
| | | string sql = "insert into Pay_GroupBalBillMain" + |
| | | "(HYear,HPeriod,HBillType,HBillSubType,HBillStatus,HInterID,HBillNo,HDate,HInnerBillNo,HGroupID,HSumMoney,HOtherSubsidy,HDeptID" + |
| | | ",HPayMoney,HOtherDeduct,HMainSourceBillType,HMainSourceInterID,HMainSourceBillNo,HExplanation,HRemark,HMaker,HMakeDate) " + |
| | | "values(" + |
| | | "" + HYear + |
| | | "," + HPeriod + |
| | | ",'" + HBillType + |
| | | "','" + HBillSubType + |
| | | "','" + HBillStatus + |
| | | "'," + HInterID + |
| | | ",'" + HBillNo + |
| | | "','" + HDate + |
| | | "','" + HInnerBillNo + |
| | | "'," + HGroupID + |
| | | ",'" + HSumMoney + |
| | | "','" + HOtherSubsidy + |
| | | "'," + HDeptID + |
| | | "," + HPayMoney + |
| | | "," + HOtherDeduct + |
| | | ",'" + HSourceBillType + |
| | | "'," + HSourceBillID + |
| | | ",'" + HSourceBillNo + |
| | | "','" + HExplanation + |
| | | "','" + HRemark + |
| | | "','" + HMaker + |
| | | "','" + HMakerDate + |
| | | "')"; |
| | | |
| | | //主表 |
| | | oCN.RunProc(sql); |
| | | 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); |
| | | } |
| | | |
| | | |
| | | //ä¿åå表 |
| | | objJsonResult = AddBillSub1_Pay_GroupBalBill(subTable, HInterID, HBillNo, OperationType); |
| | | objJsonResult = AddBillSub2_Pay_GroupBalBill(subEmpTable, HInterID, HBillNo, OperationType); |
| | | |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | #region æ·»å å·¥èµç»ç®å(éä½) å表1 |
| | | public json AddBillSub1_Pay_GroupBalBill(List<Pay_GroupBalBillController.Pay_GroupBalBillSub> DetailColl, long HInterID, string HBillNo, int OperationType) |
| | | { |
| | | try |
| | | { |
| | | int i = 0; //ä½ä¸ºå表å
ç |
| | | foreach (Pay_GroupBalBillController.Pay_GroupBalBillSub oSub in DetailColl) |
| | | { |
| | | i++; //åä¸ä¸ªä¸»è¡¨ä¸çå表çå
ç èªå¢ |
| | | |
| | | int HEntryID = i; |
| | | |
| | | int HMaterID = oSub.HMaterID; |
| | | int HUnitID = oSub.HUnitID; |
| | | int HProcID = oSub.HProcID; |
| | | int HSourceID = oSub.HSourceID; |
| | | double HTimes = oSub.HTimes; |
| | | double HQty = oSub.HQty; |
| | | double HPrice = oSub.HPrice; |
| | | double HMoney = oSub.HMoney; |
| | | string HRemark = oSub.HRemark; |
| | | int HICMOInterID = oSub.HICMOInterID; |
| | | string HICMOBillNo = oSub.HICMOBillNo; |
| | | int HProcReportInterID = oSub.HProcReportInterID; |
| | | int HProcReportEntryID = oSub.HProcReportEntryID; |
| | | string HProcReportBillNo = oSub.HProcReportBillNo; |
| | | int HProcPlanInterID = oSub.HProcPlanInterID; |
| | | int HProcPlanEntryID = oSub.HProcPlanEntryID; |
| | | string HProcPlanBillNo = oSub.HProcPlanBillNo; |
| | | int HSourceInterID = oSub.HSourceInterID; |
| | | int HSourceEntryID = oSub.HSourceEntryID; |
| | | string HSourceBillNo = oSub.HSourceBillNo; |
| | | string HSourceBillType = oSub.HSourceBillType; |
| | | double HRelationQty = oSub.HRelationQty; |
| | | double HRelationMoney = oSub.HRelationMoney; |
| | | |
| | | |
| | | |
| | | string sql = "insert into Pay_GroupBalBillSub" + |
| | | "(HInterID,HEntryID,HMaterID,HUnitID,HProcID,HSourceID,HTimes,HQty,HPrice,HMoney,HRemark,HICMOInterID,HICMOBillNo,HProcReportInterID" + |
| | | ",HProcReportEntryID,HProcReportBillNo,HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HSourceInterID,HSourceEntryID,HSourceBillNo" + |
| | | ",HSourceBillType,HRelationQty,HRelationMoney) " + |
| | | "values(" + |
| | | "" + HInterID + |
| | | "," + HEntryID + |
| | | "," + HMaterID + |
| | | "," + HUnitID + |
| | | "," + HProcID + |
| | | "," + HSourceID + |
| | | "," + HTimes + |
| | | "," + HQty + |
| | | "," + HPrice + |
| | | "," + HMoney + |
| | | ",'" + HRemark + |
| | | "'," + HICMOInterID + |
| | | ",'" + HICMOBillNo + |
| | | "'," + HProcReportInterID + |
| | | "," + HProcReportEntryID + |
| | | ",'" + HProcReportBillNo + |
| | | "'," + HProcPlanInterID + |
| | | "," + HProcPlanEntryID + |
| | | ",'" + HProcPlanBillNo + |
| | | "'," + HSourceInterID + |
| | | "," + HSourceEntryID + |
| | | ",'" + HSourceBillNo + |
| | | "','" + HSourceBillType + |
| | | "'," + HRelationQty + |
| | | "," + HRelationMoney + |
| | | ")"; |
| | | |
| | | oCN.RunProc(sql); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | }catch(Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | #endregion |
| | | #region æ·»å å·¥èµç»ç®å(éä½) å表2 |
| | | public json AddBillSub2_Pay_GroupBalBill(List<Pay_GroupBalBillController.Pay_GroupBalBillEmp> DetailColl, long HInterID, string HBillNo, int OperationType) |
| | | { |
| | | try |
| | | { |
| | | int i = 0; //ä½ä¸ºå表å
ç |
| | | foreach (Pay_GroupBalBillEmp oSub in DetailColl) |
| | | { |
| | | i++; //åä¸ä¸ªä¸»è¡¨ä¸çå表çå
ç èªå¢ |
| | | |
| | | int HEntryID = i; |
| | | |
| | | int HEmpID = oSub.HEmpID; |
| | | string HEmpNumber = oSub.HEmpNumber; |
| | | string HEmpName = oSub.HEmpName; |
| | | double HEmpRate = oSub.HEmpRate; |
| | | double HBaseTimes = oSub.HBaseTimes; |
| | | double HMoney = oSub.HMoney; |
| | | double HOtherSubsidy = oSub.HOtherSubsidy; |
| | | double HOtherDeduct = oSub.HOtherDeduct; |
| | | double HYF = oSub.HYF; |
| | | int HIsPay = oSub.HIsPay ? 1 : 0; |
| | | int HAvgFlag = oSub.HAvgFlag ? 1 : 0; |
| | | string HRemark = oSub.HRemark; |
| | | |
| | | |
| | | |
| | | string sql = "insert into Pay_GroupBalBillEmp" + |
| | | "(HInterID,HEntryID,HEmpID,HEmpRate,HBaseTimes,HMoney,HOtherSubsidy,HOtherDeduct,HYF,HIsPay,HAvgFlag,HRemark) " + |
| | | "values(" + |
| | | "" + HInterID + |
| | | "," + HEntryID + |
| | | "," + HEmpID + |
| | | "," + HEmpRate + |
| | | "," + HBaseTimes + |
| | | "," + HMoney + |
| | | "," + HOtherSubsidy + |
| | | "," + HOtherDeduct + |
| | | "," + HYF + |
| | | "," + HIsPay + |
| | | "," + HAvgFlag + |
| | | ",'" + HRemark + |
| | | "')"; |
| | | |
| | | oCN.RunProc(sql); |
| | | } |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | }catch(Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | #endregion |
| | | } |
| | | } |