//保存表单数据 public ActionResult SaveData(LocationChange LocationChange123, List <LocationChangeRecordView> LocationChangeRecordView) { //参数对象可以对应接受数据 LocationChange123.MakePerson = Session["UserName"].ToString(); //保存制单人 string result = LocationChangeService.SaveData(LocationChange123, LocationChangeRecordView); //保存数据 return(Content(result.ToString())); }
private void FileDialog_PathChanged(object sender, EventArgs e) { settings.MelodyLocation = fileDialog.FileName; LocationChange?.Invoke(sender, e); label.Text = fileDialog.SafeFileName; label.Location = new Point(10, 100); label.Size = new Size(200, 60); label.Show(); }
public void onLocationChange(string entrySection, string leaveSection) { LocationChange?.Invoke(this, new LocationChangeEventArgs(entrySection, leaveSection)); }
//获取表单数据 public ActionResult GetData() { string str = Request.Params["LocationChangeId"];//单号 //如果新单据 没有数据 if (string.IsNullOrEmpty(str)) { LocationChange locationlist = new LocationChange();//获取表单 List <Record> recordlist = new List <Record>(); var res = new { LocationChanges = locationlist, Records = recordlist }; return(Json(res));//返回一个新建的空对象 } else { //如果有数据 Guid LocationChangeId = new Guid(Request["LocationChangeId"]); //单据编号 LocationChange locationlist = LocationChangeService.LoadEntities(t => t.Id == LocationChangeId).FirstOrDefault(); //获取表单 List <Record> recordlist = RecordService.LoadEntities(a => a.MainTableId == LocationChangeId).ToList(); List <Record> recordlist2 = (from rec in recordlist where rec.InOrOut == 1 select rec).ToList(); List <Record> recordlist3 = (from rec in recordlist where rec.InOrOut == 0 select rec).ToList(); List <LocationChangeRecordView> locationviewlist = new List <LocationChangeRecordView>(); for (int i = 0; i < recordlist3.Count; i++)//把recordlist中的没两条合成locationviewlist中的一条放回前台 { for (int j = 0; j < recordlist2.Count; j++) { if (recordlist3[i].ItemCode == recordlist2[j].ItemCode && recordlist3[i].Count == recordlist2[j].Count && recordlist3[i].ItemBatch == recordlist2[j].ItemBatch && recordlist3[i].Weight == recordlist2[j].Weight) { LocationChangeRecordView _view = new LocationChangeRecordView(); var temp = recordlist3[i]; _view.Id = temp.Id; _view.Count = temp.Count; _view.CreateDate = temp.CreateDate; _view.Department = temp.Department; _view.DepartmentId = temp.DepartmentId; _view.ExamineDate = temp.ExamineDate; _view.ItemBatch = temp.ItemBatch; _view.ItemCode = temp.ItemCode; _view.ItemLine = temp.ItemLine; _view.ItemName = temp.ItemName; _view.ItemSpecifications = temp.ItemSpecifications; _view.ItemUnit = temp.ItemUnit; _view.MainTableId = temp.MainTableId; _view.Remark = temp.Remark; _view.State = temp.State; _view.UnitWeight = temp.UnitWeight; _view.Weight = temp.Weight; _view.LocationChangeAfter = temp.ItemLocation; _view.LocationChangeAfterId = temp.ItemLocationId; _view.WarehouseAfter = temp.Warehouse; _view.WarehouseAfterId = temp.WarehouseId; _view.LocationChangeBefore = recordlist2[j].ItemLocation; _view.LocationChangeBeforeId = recordlist2[j].ItemLocationId; _view.WarehouseBefore = recordlist2[j].Warehouse; _view.WarehouseBeforeId = recordlist2[j].WarehouseId; locationviewlist.Add(_view); recordlist2.RemoveAt(j); break; } } } var res = new { LocationChanges = locationlist, Records = locationviewlist }; return(Json(res)); } }
private void StandardMelodiesBox_SelectedIndexChanged(object sender, EventArgs e) { settings.MelodyLocation = String.Join(" ", standardMelodiesBox.Text.Split().Skip(1)); LocationChange?.Invoke(sender, e); }
private void PathBox_TextChanged(object sender, EventArgs e) { settings.MelodyLocation = pathBox.Text; LocationChange?.Invoke(sender, e); }