public MessageModel InsertSingleEntity(TIDModel model) { Func <IEntityContext, string> operation = delegate(IEntityContext context) { context.TID.Add(model); context.SaveChanges(); return(string.Empty); }; return(base.DbOperation(operation)); }
public void DeleteRow(TIDModel model) { var result = MessageBox.Show("是否删除", "提示", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { //var model = (TIDModel)dg.SelectedItem; var message = tidService.DeleteSingleTid(model.TID); if (message.Status == MessageStatus.Success) { LoadData(string.Empty); } } }
public MessageModel UpdateSingleEntity(TIDModel model) { Func <IEntityContext, string> operation = delegate(IEntityContext context) { var data = context.TID.FirstOrDefault(m => m.TID == model.TID); if (data == null) { return("当前数据不存在或被更新,请刷新后再次操作!"); } data.IsUse = model.IsUse; context.SaveChanges(); return(string.Empty); }; return(base.DbOperation(operation)); }
public void EditRow(TIDModel model) { var vm = IoC.Get <ChipEditViewModel>(); vm.Model = model; vm.Mode = Models.EditMode.UPDATE; var result = IoC.Get <IWindowManager>().ShowDialog(vm, null, new Dictionary <string, object> { { "Title", "编辑" }, { "ResizeMode", System.Windows.ResizeMode.NoResize }, { "Width", 450 }, { "Height", 600 } }); if (result ?? false) { LoadData(string.Empty); } }
// GET: api/Default/5 /// <summary> /// 皮影 /// </summary> /// <param name="Epc"></param> /// <param name="OrCode"></param> /// <returns></returns> public string Get(string Epc, string OrCode) { if (!string.IsNullOrEmpty(Epc)) { if (Epc.Length > 8) { return("3"); } TidService tidService = new TidService(); TIDModel tidModel = tidService.GetTidChipCode(Epc); if (tidModel == null) { return("2"); } } IShadowBaseService shadowBaseService = new ShadowBaseService(); ShadowBaseModel model = shadowBaseService.GetShawInfoByEPCOrORCode(Epc, OrCode); if (model == null) { return("1"); } return(JsonConvert.SerializeObject(new { ProductName = model.ProductName, ProductType = model.ProductType == null ? string.Empty : model.ProductType.ProductTypeEN, CompanyName = model.Company.CompanyName, AreaCode = model.Company.AreaCode, Address = model.Company.Address, Leader = model.Company.Leader, Logo = model.Company.Logo, Location = model.Company.Location, Code = model.Company.Code, ZipCode = model.Company.ZipCode, TaxCard = model.Company.TaxCard, Fax = model.Company.Fax, Mobile = model.Company.Mobile, Email = model.Company.Email, Info = model.Company.Info, Demand = model.Company.Demand, Price = model.Price, ProductCode = model.ProductCode, ShadowEPC = model.ShadowEPC, ORCode = model.ORCode, ChipCode = model.ChipCode, ProcessBatch = model.ProcessBatch, Method = model.Method, ProcessTime = model.ProcessTime, Temp = model.Temp, Dry = model.Dry, DryTime = model.DryTime, RawBatch = model.RawBatch, Flow = model.Flow, Reamrk = model.Remark, ShadowProcess = model.ShadowProcess == null?null: model.ShadowProcess.Select(m => new { m.ProcessBase.ProcessCode, m.ProcessBase.ProcessName }) })); }
/// <summary> /// 编辑单条Tid /// </summary> /// <param name="model">地块信息实体</param> /// <returns></returns> public MessageModel UpdateSingleTid(TIDModel model) { return(tidAccess.UpdateSingleEntity(model)); }
/// <summary> /// 新增单条Tid /// </summary> /// <param name="model">地块信息实体</param> /// <returns></returns> public MessageModel InsertSingleTid(TIDModel model) { return(tidAccess.InsertSingleEntity(model)); }