/// <summary> /// 提交编辑 /// </summary> private bool SubmintEdit() { if (Dispatch != null) { Dispatch.CreateBy = CurrentUser.AccountName; Dispatch.FAccidentQty = Convert.ToInt32(txtFAccidentQty.Text.Trim()); Dispatch.FDate = txtFDate.SelectedDate; Dispatch.FDispatcher = ddlDispatcher.SelectedValue; Dispatch.FHeavyTruckQty = Convert.ToDecimal(txtFHeavyTruckQty.Text.Trim()); Dispatch.FIDepartureTime = Convert.ToInt32(txtFIDepartureTime.Text.Trim()); Dispatch.FIQty = Convert.ToDecimal(txtFIQty.Text.Trim()); Dispatch.FIRange = Convert.ToDecimal(txtFIRange.Text.Trim()); Dispatch.FLogistics = ddlLogistics.SelectedValue; Dispatch.FLogisticsName = ddlLogistics.SelectedText; Dispatch.FMemo = txtFMemo.Text.Trim(); Dispatch.FODepartureTime = Convert.ToInt32(txtFODepartureTime.Text.Trim()); Dispatch.FOQty = Convert.ToDecimal(txtFOQty.Text.Trim()); Dispatch.FORange = Convert.ToDecimal(txtFORange.Text.Trim()); Dispatch.FOtherQty = Convert.ToInt32(txtFOtherQty.Text.Trim()); Dispatch.FRepairQty = Convert.ToInt32(txtFRepairQty.Text.Trim()); Dispatch.FTransport = Convert.ToDecimal(txtFTransport.Text.Trim()); Dispatch.FTurnover = Convert.ToDecimal(txtFTurnover.Text.Trim()); Dispatch.FWorkQty = Convert.ToInt32(txtFWorkQty.Text.Trim()); Dispatch.FType = 52; DispatchService.SaveChanges(); return(true); } return(false); }
/// <summary> /// 提交添加 /// </summary> private bool SubmintAdd() { var dispatch = DispatchService.Where(p => p.KeyId == txtKeyId.Text.Trim() && // p.FCompanyId == CurrentUser.AccountComId).FirstOrDefault(); if (dispatch != null) { //dispatch.KeyId = txtKeyId.Text.Trim(); //dispatch.FCompanyId = CurrentUser.AccountComId; dispatch.CreateBy = CurrentUser.AccountName; dispatch.FAccidentQty = Convert.ToInt32(txtFAccidentQty.Text.Trim()); dispatch.FDate = txtFDate.SelectedDate; dispatch.FDispatcher = ddlDispatcher.SelectedValue; dispatch.FHeavyTruckQty = Convert.ToDecimal(txtFHeavyTruckQty.Text.Trim()); dispatch.FIDepartureTime = Convert.ToInt32(txtFIDepartureTime.Text.Trim()); dispatch.FIQty = Convert.ToDecimal(txtFIQty.Text.Trim()); dispatch.FIRange = Convert.ToDecimal(txtFIRange.Text.Trim()); dispatch.FLogistics = ddlLogistics.SelectedValue; dispatch.FLogisticsName = ddlLogistics.SelectedText; dispatch.FMemo = txtFMemo.Text.Trim(); dispatch.FODepartureTime = Convert.ToInt32(txtFODepartureTime.Text.Trim()); dispatch.FOQty = Convert.ToDecimal(txtFOQty.Text.Trim()); dispatch.FORange = Convert.ToDecimal(txtFORange.Text.Trim()); dispatch.FOtherQty = Convert.ToInt32(txtFOtherQty.Text.Trim()); dispatch.FRepairQty = Convert.ToInt32(txtFRepairQty.Text.Trim()); dispatch.FTransport = Convert.ToDecimal(txtFTransport.Text.Trim()); dispatch.FTurnover = Convert.ToDecimal(txtFTurnover.Text.Trim()); dispatch.FWorkQty = Convert.ToInt32(txtFWorkQty.Text.Trim()); dispatch.FDeleteFlag = 0; dispatch.FType = 52; DispatchService.SaveChanges(); if (txtKeyId.Text.Contains("TM")) { //单据号问题 string newKeyId = SequenceService.CreateSequence(Convert.ToDateTime(txtFDate.SelectedDate),// "DL", CurrentUser.AccountComId); var orderParms = new Dictionary <string, object>(); orderParms.Clear(); orderParms.Add("@oldKeyId", txtKeyId.Text); orderParms.Add("@newKeyId", newKeyId); orderParms.Add("@Bill", "52");//Convert.ToInt32(GasEnumBill.Dispatch) orderParms.Add("@companyId", CurrentUser.AccountComId); SqlService.ExecuteProcedureCommand("proc_num", orderParms); txtKeyId.Text = newKeyId; return(true); } } return(false); }