protected override void InitNewDmo(ProductInStore_Temp dmo) { base.InitNewDmo(dmo); var profile = DomainUserProfileUtil.Load <B3ButcheryUserProfile>(); dmo.InStoreDate = DateTime.Today.AddDays(profile.ProductInStoreDaysBrake ?? 0); }
public static BaseInfoDto GetUserProfileAccountUnit() { var profile = DomainUserProfileUtil.Load <B3ButcheryUserProfile>(); if (profile.AccountingUnit_ID == null) { throw new Exception("板块个性设置没有设置会计单位"); } var dto = new BaseInfoDto(); dto.ID = profile.AccountingUnit_ID.Value; dto.Name = profile.AccountingUnit_Name; return(dto); }
public static long ButcherTouchScreenInsert(FrozenInStore dmo) { using (var session = Dmo.NewSession()) { var bl = BIFactory.Create <IFrozenInStoreBL>(session); var profile = DomainUserProfileUtil.Load <B3ButcheryUserProfile>(); dmo.AccountingUnit_ID = profile.AccountingUnit_ID; dmo.Store_ID = profile.FrozenInStore_Store_ID; SetEmployeeDepartment(dmo, session); SetProductPlan(dmo, session); //日期默认当天 dmo.Date = DateTime.Today; dmo.Domain_ID = DomainContext.Current.ID; bl.Insert(dmo); session.Commit(); return(dmo.ID); } }
public static long InertAndCheck(string json) { PackingRecipients jsonDom = JsonConvert.DeserializeObject <PackingRecipients>(json); long returnid; using (new SpecialDomainUserBLScope(jsonDom.CreateUser_Name)) { //判断是否有权限 if (!BLContext.User.IsInRole("B3Butchery.包装领用.新建")) { throw new Exception("没有新建权限"); } using (var session = Dmo.NewSession()) { var bl = BIFactory.Create <IPackingRecipientsBL>(session); // bl.InitNewDmo(jsonDom); var profile = DomainUserProfileUtil.Load <B3ButcheryUserProfile>(); if (profile.AccountingUnit_ID == null) { throw new Exception("板块个性设置没有设置会计单位"); } if (profile.PackingRecipients_Store_ID == null) { throw new Exception("板块个性设置没有设置包装领用默认仓库"); } jsonDom.AccountingUnit_ID = profile.AccountingUnit_ID; jsonDom.Domain_ID = DomainContext.Current.ID; jsonDom.Store_ID = profile.PackingRecipients_Store_ID; //插入单据 bl.Insert(jsonDom); //审核 bl.Check(jsonDom); returnid = jsonDom.ID; session.Commit(); } } return(returnid); }
public static B3ButcheryUserProfile GetUserProfile() { var profile = DomainUserProfileUtil.Load <B3ButcheryUserProfile>(); return(profile); }