protected int Update(BarcodePrintRepository rep, Entry2Model model, string viewTitle) { UserInfo sysUser = CacheInit.GetUserInfo(HttpContext); DataUpdate dbUpdate = new DataUpdate(); try { dbUpdate.BeginTransaction(); rep.DbUpdate = dbUpdate; rep.Update(model, sysUser, viewTitle); dbUpdate.Commit(); return(1); } catch (Exception ex) { dbUpdate.Rollback(); model.Message = ex.Message; model.HasError = "true"; return(0); } finally { dbUpdate.Close(); } }
[WebMethod] // 删除指定模板 public int fun10(int _class, string _LabelId) { AppInit.Init(); DataUpdate dbUpdate = new DataUpdate(); BarcodePrintRepository rep = new BarcodePrintRepository(); try { dbUpdate.BeginTransaction(); rep.DbUpdate = dbUpdate; string labelType = ""; if (_class == 0) { labelType = "Z"; } else { labelType = "C"; } rep.DeleteStyle(labelType, _LabelId, "Print Tools Update"); dbUpdate.Commit(); return(1); } catch (Exception) { dbUpdate.Rollback(); return(0); } finally { dbUpdate.Close(); } }
[WebMethod] // 取得所有模板数据.LabelId, LabelName, LabelContent, IsDefault public int fun7(int _class, out DataTable _table) { AppInit.Init(); BarcodePrintRepository repository = new BarcodePrintRepository(); if (_class == 0) { _table = repository.GetLabelStyleByPrintTools("Z"); } else { _table = repository.GetLabelStyleByPrintTools("C"); } return(1); }
public int fun5(int _class, out string _labelStyle) { AppInit.Init(); BarcodePrintRepository repository = new BarcodePrintRepository(); if (_class == 0) { _labelStyle = repository.GetLabelStyleByType("Z"); } else { _labelStyle = repository.GetLabelStyleByType("C"); } return(1); }
public virtual JsonResult DropList(string formMode, string filterExpression) { ClearClientPageCache(Response); BarcodePrintRepository rep = new BarcodePrintRepository(); DataTable source = rep.GetDropListSource(); filterExpression = DFT.HandleExpress(filterExpression); if (formMode == "new2") { filterExpression = "labelType='A'"; } else if (formMode == "storeSite") { filterExpression = "labelType='S'"; } List <DropListSource> dropList = rep.DropList(source, filterExpression); return(DropListJson(dropList)); }
public ActionResult Entry2(Entry2Model model) { model.EntryGridLayout = EntryGridLayout(); model.SelectUrl = Url.Action("Select", "AssetsManage", new { Area = "AssetsBusiness", pageId = model.PageId }); model.StoreSiteGridLayout = StoreSiteGridLayout(); BarcodePrintRepository Repository = new BarcodePrintRepository(); Update(Repository, model, model.ViewTitle); if (model.LabelType == "A") { model.FormMode = "new2"; } else if (model.LabelType == "S") { model.FormMode = "storeSite"; } SetThisEntryModel(model); return(View("Entry3", model)); }
public ActionResult LoadDefaultLabelStyle(string pageId, string formMode) { BarcodePrintRepository Repository = new BarcodePrintRepository(); return(Content(Repository.GetDefaultLabelStyle(formMode), "text/html")); }
public ActionResult LoadLabelStyle(string pageId, string barcodeStyleId) { BarcodePrintRepository Repository = new BarcodePrintRepository(); return(Content(Repository.GetLabelStyle(barcodeStyleId), "text/html")); }