Esempio n. 1
0
 protected override EaseErp.IC.Domain.WareHouse CreateEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext)
 {
     EaseErp.IC.Domain.WareHouse wareHouse = new EaseErp.IC.Domain.WareHouse();
     wareHouse.SetAuthorInfo(TSWEBContext.Current.CurUser);
     wareHouse.FileDate = DateTime.Now;
     return(wareHouse);
 }
Esempio n. 2
0
        protected override Policy CreateEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext)
        {
            User   user   = TSWEBContext.Current.CurUser;
            Policy policy = new Policy(user);

            return(policy);
        }
Esempio n. 3
0
 protected override void SaveEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext, Thing entity)
 {
     if (entity.WHUnit.ID == -1)
     {
         entity.WHUnit = null;
     }
     this.thingService.Save(entity);
 }
Esempio n. 4
0
        protected override Model CreateEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext)
        {
            Model model = new Model();

            model.ID       = TSLibWeb.Constants.BLANK_LONG_VALUE;
            model.IsInner  = TSLibWeb.Constants.YESNO_NO;
            model.ParentID = TSLibWeb.Constants.BLANK_LONG_VALUE;
            model.Type     = ModelTypes.SubModel;
            return(model);
        }
Esempio n. 5
0
 protected override void Delete(TSLibStruts.ActionContext actionContext, HttpContext httpContext, string[] ids, string type)
 {
     if ("unid".Equals(type, StringComparison.OrdinalIgnoreCase))
     {
         this.thingService.Delete(ids);
     }
     else
     {
         this.thingService.Delete(StringUtils.StringArray2LongArray(ids));
     }
 }
Esempio n. 6
0
 protected override Thing LoadEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext, string idValue, string idName)
 {
     EaseErp.IC.Domain.Thing thing;
     if ("unid".Equals(idName, StringComparison.OrdinalIgnoreCase))
     {
         thing = this.thingService.Load(idValue);
     }
     else
     {
         thing = this.thingService.Load(Convert.ToInt32(idValue));
     }
     return(thing);
 }
Esempio n. 7
0
 protected override EaseErp.IC.Domain.WHUnit LoadEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext, string idValue, string idName)
 {
     EaseErp.IC.Domain.WHUnit unit;
     if ("unid".Equals(idName, StringComparison.OrdinalIgnoreCase))
     {
         unit = this.whunitService.Load(idValue);
     }
     else
     {
         unit = this.whunitService.Load(Convert.ToInt32(idValue));
     }
     return(unit);
 }
Esempio n. 8
0
        protected override TSLib.PageInfo GetPageInfo(TSLibStruts.ActionContext actionContext, HttpContext httpContext, int pageNo, int pageSize, string sortField, string sortDir)
        {
            string placeUnid = httpContext.Request.Params["placeUnid"];

            if (!string.IsNullOrEmpty(placeUnid) && placeUnid != "root" && placeUnid != "-1")
            {
                return(this.wareHouseService.GetPageByPlace(pageNo, pageSize, sortField, sortDir, null));
            }
            else
            {
                return(this.wareHouseService.GetPageByPlace(pageNo, pageSize, sortField, sortDir, this.placeService.Load(long.Parse(placeUnid))));
            }
        }
Esempio n. 9
0
        protected override Model LoadEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext, string idValue, string idName)
        {
            Model model;

            if ("unid".Equals(idName, StringComparison.OrdinalIgnoreCase))
            {
                model = this.modelService.Load(idValue);
            }
            else
            {
                model = this.modelService.Load(Convert.ToInt32(idValue));
            }
            return(model);
        }
Esempio n. 10
0
        protected override Policy LoadEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext, string idValue, string idName)
        {
            Policy policy;

            if ("unid".Equals(idName, StringComparison.OrdinalIgnoreCase))
            {
                policy = this.policyService.Load(idValue);
            }
            else
            {
                policy = this.policyService.Load(Convert.ToInt32(idValue));
            }
            return(policy);
        }
Esempio n. 11
0
        protected override TSLib.PageInfo GetPageInfo(TSLibStruts.ActionContext actionContext, HttpContext httpContext, int pageNo, int pageSize, string sortField, string sortDir)
        {
            string punid = RequestUtils.GetStringParameter(httpContext, "punid", "");
            string type  = RequestUtils.GetStringParameter(httpContext, "type", "");

            if (logger.IsDebugEnabled)
            {
                logger.Debug("punid = " + punid + " type = " + type);
            }
            pageNo   = 1;
            pageSize = int.MaxValue;
            if (string.IsNullOrEmpty(punid))
            {
                return(this.atmService.GetPage(pageNo, pageSize, sortField, sortDir));
            }
            return(this.atmService.GetPage(pageNo, pageSize, sortField, sortDir, punid, type));
        }
Esempio n. 12
0
 protected override void Delete(TSLibStruts.ActionContext actionContext, HttpContext httpContext, string[] ids, string type)
 {
     if (logger.IsDebugEnabled)
     {
         logger.Debug("type=" + type);
         logger.Debug("ids=" + StringUtils.Combine(ids, ","));
     }
     if ("unid".Equals(type, StringComparison.OrdinalIgnoreCase))
     {
         // 删除指定unid集的附件
         this.atmService.Delete(ids);
     }
     else
     {
         // 删除指定id集的附件
         this.atmService.Delete(StringUtils.StringArray2LongArray(ids));
     }
 }
Esempio n. 13
0
 protected override void Delete(TSLibStruts.ActionContext actionContext, HttpContext httpContext, string[] ids, string type)
 {
     if ("unid".Equals(type, StringComparison.OrdinalIgnoreCase))
     {
         // 删除指定unid集的
         foreach (string parentUnid in ids)
         {
             //删除关系表
             this.relationShipService.DeleteAllByParent(parentUnid,
                                                        EaseErp.IC.Domain.WareHouse.RELATIONSHIP_CODE);
         }
         this.wareHouseService.Delete(ids);
     }
     else
     {
         foreach (string parentid in ids)
         {
             this.relationShipService.DeleteAllByParent(this.wareHouseService.Load(Convert.ToInt64(parentid)).Unid,
                                                        EaseErp.IC.Domain.WareHouse.RELATIONSHIP_CODE);
         }
         // 删除指定id集的
         this.wareHouseService.Delete(StringUtils.StringArray2LongArray(ids));
     }
 }
Esempio n. 14
0
 protected override TSLib.PageInfo GetPageInfo(TSLibStruts.ActionContext actionContext, HttpContext httpContext, int pageNo, int pageSize, string sortField, string sortDir)
 {
     return(this.thingService.GetPage(pageNo, pageSize, sortField, sortDir));
 }
Esempio n. 15
0
 protected override Thing CreateEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext)
 {
     return(new Thing());
 }
Esempio n. 16
0
 protected override void SaveEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext, Model entity)
 {
     this.modelService.Save(entity);
 }
Esempio n. 17
0
        protected override void SaveEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext, Policy entity)
        {
            User user = TSWEBContext.Current.CurUser;

            this.policyService.Save(user, entity);
        }
Esempio n. 18
0
 protected override void SaveEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext, TSCommon.Core.ATM.Domain.ATM entity)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Esempio n. 19
0
 protected override TSCommon.Core.ATM.Domain.ATM LoadEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext, string idValue, string idName)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Esempio n. 20
0
 protected override EaseErp.IC.Domain.WHUnit CreateEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext)
 {
     return(new EaseErp.IC.Domain.WHUnit());
 }
Esempio n. 21
0
 protected override void SaveEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext, EaseErp.IC.Domain.WHUnit entity)
 {
     this.whunitService.Save(entity);
 }