public async Task <IActionResult> ADD_PAY([FromForm] IFormCollection fm) { var DT_CLIENTNAME1 = fm["DT_CLIENTNAME"].ToString(); var DT_CLIENTCODE1 = fm["DT_CLIENTCODE"].ToString(); var DT_MODEL1 = fm["DT_MODEL"].ToString(); var DT_NAME1 = fm["DT_NAME"].ToString(); var DT_DATE1 = fm["DT_DATE"].ToString(); var DT_REMARKS1 = fm["DT_REMARKS"].ToString(); var CRT_USER1 = fm["CRT_USER"].ToString(); switch (DT_MODEL1) { case "3001": //人员支出 DateTime dateTime1 = Convert.ToDateTime(DT_DATE1); int nb = Convert.ToInt32(DT_MODEL1); var DT_INDIRECTWORKTIME1 = fm["DT_INDIRECTWORKTIME"].ToString(); var DT_INDIRECTWAGE1 = fm["DT_INDIRECTWAGE"].ToString(); var DT_DIRECTHOUR1 = fm["DT_DIRECTHOUR"].ToString(); var DT_INDIRECTMOUTH1 = fm["DT_INDIRECTMOUTH"].ToString(); DA_PAYPERSON dA_ = new DA_PAYPERSON { DT_CLIENTNAME = DT_CLIENTNAME1, DT_DATE = dateTime1, DT_MODEL = nb, DT_NAME = DT_NAME1, DT_DIRECTHOUR = DT_DIRECTHOUR1, DT_INDIRECTMOUTH = DT_INDIRECTMOUTH1, DT_INDIRECTWAGE = DT_INDIRECTWAGE1, DT_INDIRECTWORKTIME = DT_INDIRECTWORKTIME1, DT_REMARKS = DT_REMARKS1, CRT_USER = CRT_USER1 }; _sqlRepository.AddDA_PAYPERSON(dA_); await _sqlRepository.SaveAsync(); break; case "3002": dateTime1 = Convert.ToDateTime(DT_DATE1); var DT_BOM2 = fm["DT_BOM2"].ToString(); var DT_PRICE2 = fm["DT_PRICE2"].ToString(); var DT_LOSS2 = fm["DT_LOSS2"].ToString(); DA_PAYLOSS dA_1 = new DA_PAYLOSS { DT_BOM = DT_BOM2, DT_CLIENTNAME = DT_CLIENTNAME1, DT_DATE = dateTime1, DT_LOSS = DT_LOSS2, DT_MODEL = 3002, DT_NAME = DT_NAME1, DT_PRICE = DT_PRICE2, DT_REMARKS = DT_REMARKS1, CRT_USER = CRT_USER1, DT_CLIENTCODE = DT_CLIENTCODE1, }; _sqlRepository.AddDA_PAYLOSS(dA_1); await _sqlRepository.SaveAsync(); break; case "3003": dateTime1 = Convert.ToDateTime(DT_DATE1); var DT_BOM3 = fm["DT_BOM3"].ToString(); var DT_PRICE3 = fm["DT_PRICE3"].ToString(); var DT_LOSS3 = fm["DT_LOSS3"].ToString(); DA_PAYLOSS dA_3 = new DA_PAYLOSS { DT_BOM = DT_BOM3, DT_CLIENTNAME = DT_CLIENTNAME1, DT_DATE = dateTime1, DT_LOSS = DT_LOSS3, DT_MODEL = 3003, DT_NAME = DT_NAME1, DT_PRICE = DT_PRICE3, DT_REMARKS = DT_REMARKS1, DT_CLIENTCODE = DT_CLIENTCODE1, CRT_USER = CRT_USER1 }; _sqlRepository.AddDA_PAYLOSS(dA_3); await _sqlRepository.SaveAsync(); break; case "3004": dateTime1 = Convert.ToDateTime(DT_DATE1); var DT_BOM4 = fm["DT_BOM4"].ToString(); var DT_PRICE4 = fm["DT_PRICE4"].ToString(); var DT_LOSS4 = fm["DT_LOSS4"].ToString(); DA_PAYLOSS dA_4 = new DA_PAYLOSS { DT_BOM = DT_BOM4, DT_CLIENTNAME = DT_CLIENTNAME1, DT_DATE = dateTime1, DT_LOSS = DT_LOSS4, DT_MODEL = 3004, DT_NAME = DT_NAME1, DT_PRICE = DT_PRICE4, DT_REMARKS = DT_REMARKS1, DT_CLIENTCODE = DT_CLIENTCODE1, CRT_USER = CRT_USER1 }; _sqlRepository.AddDA_PAYLOSS(dA_4); await _sqlRepository.SaveAsync(); break; case "3005": dateTime1 = Convert.ToDateTime(DT_DATE1); var DT_EXPEND5 = fm["DT_EXPEND5"].ToString(); DA_PAYMONTH dA_5 = new DA_PAYMONTH { DT_CLIENTNAME = DT_CLIENTNAME1, DT_REMARKS = DT_REMARKS1, DT_DATE = dateTime1, DT_EXPEND = DT_EXPEND5, DT_MODEL = 3005, DT_NAME = DT_NAME1, CRT_USER = CRT_USER1 }; _sqlRepository.AddDA_PAYMONTH(dA_5); await _sqlRepository.SaveAsync(); break; case "3006": dateTime1 = Convert.ToDateTime(DT_DATE1); var DT_EXPEND6 = fm["DT_EXPEND6"].ToString(); DA_PAYMONTH dA_6 = new DA_PAYMONTH { DT_CLIENTNAME = DT_CLIENTNAME1, DT_REMARKS = DT_REMARKS1, DT_DATE = dateTime1, DT_EXPEND = DT_EXPEND6, DT_MODEL = 3006, DT_NAME = DT_NAME1, CRT_USER = CRT_USER1 }; _sqlRepository.AddDA_PAYMONTH(dA_6); await _sqlRepository.SaveAsync(); break; case "3007": dateTime1 = Convert.ToDateTime(DT_DATE1); var DT_EXPEND7 = fm["DT_EXPEND7"].ToString(); DA_PAYMONTH dA_7 = new DA_PAYMONTH { DT_CLIENTNAME = DT_CLIENTNAME1, DT_REMARKS = DT_REMARKS1, DT_DATE = dateTime1, DT_EXPEND = DT_EXPEND7, DT_MODEL = 3007, DT_NAME = DT_NAME1, CRT_USER = CRT_USER1 }; _sqlRepository.AddDA_PAYMONTH(dA_7); await _sqlRepository.SaveAsync(); break; case "3008": dateTime1 = Convert.ToDateTime(DT_DATE1); var DT_EXPEND8 = fm["DT_EXPEND8"].ToString(); DA_PAYMONTH dA_8 = new DA_PAYMONTH { DT_CLIENTNAME = DT_CLIENTNAME1, DT_REMARKS = DT_REMARKS1, DT_DATE = dateTime1, DT_EXPEND = DT_EXPEND8, DT_MODEL = 3008, DT_NAME = DT_NAME1, CRT_USER = CRT_USER1 }; _sqlRepository.AddDA_PAYMONTH(dA_8); await _sqlRepository.SaveAsync(); break; default: break; } return(Ok("添加成功")); }