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); }
protected override Policy CreateEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext) { User user = TSWEBContext.Current.CurUser; Policy policy = new Policy(user); return(policy); }
protected override void SaveEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext, Thing entity) { if (entity.WHUnit.ID == -1) { entity.WHUnit = null; } this.thingService.Save(entity); }
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); }
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)); } }
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); }
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); }
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)))); } }
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); }
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); }
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)); }
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)); } }
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)); } }
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)); }
protected override Thing CreateEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext) { return(new Thing()); }
protected override void SaveEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext, Model entity) { this.modelService.Save(entity); }
protected override void SaveEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext, Policy entity) { User user = TSWEBContext.Current.CurUser; this.policyService.Save(user, entity); }
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."); }
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."); }
protected override EaseErp.IC.Domain.WHUnit CreateEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext) { return(new EaseErp.IC.Domain.WHUnit()); }
protected override void SaveEntity(TSLibStruts.ActionContext actionContext, HttpContext httpContext, EaseErp.IC.Domain.WHUnit entity) { this.whunitService.Save(entity); }