Exemplo n.º 1
0
        public List <TitleViewModel> TitleSeal(List <Title> t)
        {
            List <TitleViewModel>   tvml = new List <TitleViewModel>();
            PersonalBusinessLayer   pbl  = new PersonalBusinessLayer();
            ContentionBusinessLayer cbl  = new ContentionBusinessLayer();

            List <ReplyNum> rn = cbl.GetReplyNum();

            foreach (Title item in t)
            {
                TitleViewModel tvm = new TitleViewModel();
                tvm.UName   = pbl.GetUserInfo(item.UserID).UName;
                tvm.TName   = item.TName;
                tvm.TitleID = item.TitleID;
                tvm.TDate   = item.TDate;
                foreach (ReplyNum r in rn)
                {
                    if (r.TitleID == item.TitleID)
                    {
                        tvm.Reply = r.ReplyNumber;
                        break;
                    }
                }
                tvml.Add(tvm);
            }
            return(tvml);
        }
Exemplo n.º 2
0
        public List <ContentionViewModel> ContentionSeal(List <Contention> c)
        {
            List <ContentionViewModel> clvm = new List <ContentionViewModel>();
            ContentionBusinessLayer    cbl  = new ContentionBusinessLayer();
            PersonalBusinessLayer      pbl  = new PersonalBusinessLayer();

            foreach (Contention item in c)
            {
                ContentionViewModel cvm = new ContentionViewModel();
                cvm.TitleID      = item.TitleID;
                cvm.ContentionID = item.ContentionID;
                cvm.UName        = pbl.GetUserInfo(item.UserID).UName;
                cvm.Contentions  = item.Contentions;
                cvm.CDate        = item.CDate.ToString();
                clvm.Add(cvm);
            }
            return(clvm);
        }
Exemplo n.º 3
0
        public List <DiaryViewModel> DLVMSealed(List <Diary> diarys)
        {
            List <DiaryViewModel>   dvml = new List <DiaryViewModel>();
            AdministerBusinessLayer abl  = new AdministerBusinessLayer();
            PersonalBusinessLayer   pbl  = new PersonalBusinessLayer();

            foreach (Diary item in diarys)
            {
                DiaryViewModel dvm = new DiaryViewModel();
                dvm.Aname      = abl.GetAname(item.AdminID);
                dvm.ApplyState = item.ApplyState;
                dvm.DiaryDate  = item.DiaryDate;
                dvm.DiaryID    = item.DiaryID;
                dvm.UName      = pbl.GetUserInfo(abl.SearchApply(item.ApplyID).UserID).UName;
                dvml.Add(dvm);
            }
            return(dvml);
        }
Exemplo n.º 4
0
        public List <OperateViewModel> OLVMSealed(List <Operate> operates)
        {
            List <OperateViewModel> ovml = new List <OperateViewModel>();
            AdministerBusinessLayer abl  = new AdministerBusinessLayer();
            PersonalBusinessLayer   pbl  = new PersonalBusinessLayer();

            foreach (Operate item in operates)
            {
                OperateViewModel ovm = new OperateViewModel();
                ovm.Aname        = abl.GetAname(item.AdminID);
                ovm.OperateDate  = item.OperateDate;
                ovm.OperateID    = item.OperateID;
                ovm.OperateState = item.OperateState;
                ovm.UName        = pbl.GetUserInfo(item.UserID).UName;

                ovml.Add(ovm);
            }
            return(ovml);
        }
Exemplo n.º 5
0
        public List <AdminApplyViewModel> AAVMSealed(List <Apply> la)
        {
            List <AdminApplyViewModel> aavml = new List <AdminApplyViewModel>();
            PersonalBusinessLayer      pbl   = new PersonalBusinessLayer();
            AdministerBusinessLayer    abl   = new AdministerBusinessLayer();

            foreach (Apply a in la)
            {
                AdminApplyViewModel aavm = new AdminApplyViewModel();
                aavm.ApplyID       = a.ApplyID;
                aavm.UserID        = a.UserID;
                aavm.UName         = pbl.GetUserInfo(a.UserID).UName;
                aavm.ApplyDate     = a.ApplyDate.ToString();
                aavm.PostingAmount = abl.GetPostingAmount(a.UserID);
                aavm.Reason        = a.Reason;

                aavml.Add(aavm);
            }

            return(aavml);
        }