예제 #1
0
        public void SyncOper(IAMSCMUow amscmUow)
        {
            ynhnTransportManage.Models.AccountMembershipService MembershipService = new ynhnTransportManage.Models.AccountMembershipService();

            var ltbLogin = amscmUow.tbLogin.GetAll().ToList();

            foreach (DXInfo.Models.tbLogin tbLogin in ltbLogin)
            {
                DXInfo.Models.aspnet_Users user = uow.aspnet_Users.GetAll().Where(w => w.UserName == tbLogin.vcLoginID).FirstOrDefault();
                DXInfo.Models.Depts        dept = uow.Depts.GetAll().Where(w => w.DeptCode == tbLogin.vcDeptID).FirstOrDefault();
                if (user == null)
                {
                    if (dept != null)
                    {
                        MembershipCreateStatus createStatus = MembershipService.CreateUser(tbLogin.vcLoginID, tbLogin.vcPwd, tbLogin.vcOperName, dept.DeptId);
                    }
                }
                else
                {
                    DXInfo.Models.aspnet_Membership memberShip = uow.aspnet_Membership.GetAll().Where(w => w.UserId == user.UserId).FirstOrDefault();
                    if (memberShip == null)
                    {
                        if (dept != null)
                        {
                            MembershipCreateStatus createStatus = MembershipService.CreateUser(tbLogin.vcLoginID, tbLogin.vcPwd, tbLogin.vcOperName, dept.DeptId);
                        }
                    }
                }
            }
        }
예제 #2
0
        public void UpdateOper(string userName, string fullName, string deptCode)
        {
            ynhnTransportManage.Models.AccountMembershipService MembershipService = new ynhnTransportManage.Models.AccountMembershipService();

            DXInfo.Models.Depts dept = uow.Depts.GetAll().Where(w => w.DeptCode == deptCode).FirstOrDefault();
            if (dept != null)
            {
                MembershipService.UpdateUser(userName, fullName, dept.DeptId);
            }
        }
예제 #3
0
파일: Common.cs 프로젝트: zhenghua75/DXInfo
 public void InventoryDeptPrice(DXInfo.Models.Depts dept, List <DXInfo.Models.Inventory> lInv)
 {
     if (dept != null && dept.IsDeptPrice)
     {
         var invDeptPrices = uow.InventoryDeptPrice.GetAll().Where(w => w.DeptId == dept.DeptId).ToList();
         foreach (DXInfo.Models.Inventory inv in lInv)
         {
             var invDeptPrice = invDeptPrices.Find(f => f.InvId == inv.Id);
             if (invDeptPrice != null)
             {
                 if (invDeptPrice.SalePoint > 0)
                 {
                     inv.SalePoint = invDeptPrice.SalePoint;
                 }
                 if (invDeptPrice.SalePoint0 > 0)
                 {
                     inv.SalePoint0 = invDeptPrice.SalePoint0;
                 }
                 if (invDeptPrice.SalePoint1 > 0)
                 {
                     inv.SalePoint1 = invDeptPrice.SalePoint1;
                 }
                 if (invDeptPrice.SalePoint2 > 0)
                 {
                     inv.SalePoint2 = invDeptPrice.SalePoint2;
                 }
                 if (invDeptPrice.SalePrice > 0)
                 {
                     inv.SalePrice = invDeptPrice.SalePrice;
                 }
                 if (invDeptPrice.SalePrice0 > 0)
                 {
                     inv.SalePrice0 = invDeptPrice.SalePrice0;
                 }
                 if (invDeptPrice.SalePrice1 > 0)
                 {
                     inv.SalePrice1 = invDeptPrice.SalePrice1;
                 }
                 if (invDeptPrice.SalePrice2 > 0)
                 {
                     inv.SalePrice2 = invDeptPrice.SalePrice2;
                 }
             }
         }
     }
 }
예제 #4
0
파일: Common.cs 프로젝트: zhenghua75/DXInfo
 public void CardDonateInventoryExDeptPrice(DXInfo.Models.Depts dept, List <CardDonateInventoryEx> di1)
 {
     if (dept != null && dept.IsDeptPrice && di1.Count > 0)
     {
         foreach (CardDonateInventoryEx qry in di1)
         {
             var invDeptPrice = uow.InventoryDeptPrice.GetById(g => g.DeptId == dept.DeptId && g.InvId == qry.Id);
             if (invDeptPrice != null)
             {
                 if (invDeptPrice.SalePrice > 0)
                 {
                     qry.SalePrice = invDeptPrice.SalePrice;
                     qry.Amount    = qry.SalePrice;
                 }
             }
         }
     }
 }
예제 #5
0
파일: Common.cs 프로젝트: zhenghua75/DXInfo
        public bool GetLocalDept(out DXInfo.Models.Depts dept)
        {
            dept = new DXInfo.Models.Depts();
            var nc = uow.NameCode.GetAll().Where(w => w.Type == "LocalDept").FirstOrDefault();

            if (nc == null)
            {
                Helper.ShowErrorMsg("请首先设置本地门店");
                return(false);
            }
            if (string.IsNullOrEmpty(nc.Value))
            {
                Helper.ShowErrorMsg("本地门店信息错误");
                return(false);
            }
            dept = uow.Depts.GetById(g => g.DeptId == Guid.Parse(nc.Value));
            if (dept == null)
            {
                return(false);
            }
            return(true);
        }