示例#1
0
        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();
            }
        }
示例#2
0
        [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();
            }
        }
示例#3
0
        [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);
        }
示例#4
0
        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);
        }
示例#5
0
        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));
        }
示例#6
0
        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));
        }
示例#7
0
        public ActionResult LoadDefaultLabelStyle(string pageId, string formMode)
        {
            BarcodePrintRepository Repository = new BarcodePrintRepository();

            return(Content(Repository.GetDefaultLabelStyle(formMode), "text/html"));
        }
示例#8
0
        public ActionResult LoadLabelStyle(string pageId, string barcodeStyleId)
        {
            BarcodePrintRepository Repository = new BarcodePrintRepository();

            return(Content(Repository.GetLabelStyle(barcodeStyleId), "text/html"));
        }