Exemple #1
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     using (PackageBusiness Business = new PackageBusiness()) {
         m_Packages = Business.GetPackages();
     }
 }
 public ActionResult AddBeneficiary(BeneficiaryViewModel model)
 {
     if (ModelState.IsValid)
     {
         var objRB = new RegisterBusiness();
         ViewBag.List = objRB.getBeneficiariesByClientID(HttpContext.User.Identity.Name);
         var pb = new PackageBusiness();
         for (int x = 0; x < pb.GetAll().Count; x++)
         {
             //find the Applicant's package
             if (pb.GetAll()[x].PackageId == pb.GetById(objRB.getApplicant(HttpContext.User.Identity.Name).packageID).PackageId)
             {
                 //if we haven't reached the maximum number the package can cover, add the beneficiary
                 if (objRB.getBeneficiariesByClientID(HttpContext.User.Identity.Name).Count < pb.GetById(objRB.getApplicant(HttpContext.User.Identity.Name).packageID).maxBeneficiary)
                 {
                     objRB.addBeneficiary(model, HttpContext.User.Identity.Name);
                     TempData["Error"] = RegisterBusiness.feedback;
                     break;
                 }
                 else //otherwise return an alert to the user
                 {
                     TempData["Error"] = pb.GetAll()[x].Name + " package can cover up to " + pb.GetAll()[x].maxBeneficiary + " beneficiaries";
                 }
             }
         }
         return(RedirectToAction("ReloadBen"));
     }
     return(View(model));
 }
Exemple #3
0
        public ActionResult AddPackageBenefits(List <BenefitView> model)
        {
            var pb = new PackageBusiness();

            pb.AddPackageBenefit(model, Convert.ToInt16(Session["packID"]));
            return(RedirectToAction("GetAll"));
        }
Exemple #4
0
    private List <Package> GetPackageItems(String RegisterNo, int PackageID)
    {
        //0 检查科室 1 检验科室 2 功能科室
        String[]                      Names = new String[] { "抽血及其它化验项目", "医生检查项目", "功能检查项目" };
        List <Package>                List  = new List <Package>();
        List <DepartmentEntity>       Departments;
        List <PackageGroupViewEntity> Groups;

        using (PackageBusiness Business = new PackageBusiness()) {
            Groups = Business.GetPackageGroups(PackageID);
        }
        using (DepartmentBusiness Depart = new DepartmentBusiness()) {
            Departments = Depart.GetDepartments();
        }
        var q = from a in Groups
                join b in Departments on a.DeptID equals b.DeptID
                group b by b.DeptKind into g
                select new Package {
            RegisterNo  = RegisterNo,
            GroupID     = Convert.ToInt32(g.Key),
            PackageName = Names[Convert.ToInt32(g.Key)] + g.Count() + "项"
        };

        return(q.ToList());
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        PackageBusiness        Package = new PackageBusiness();
        RepeaterItemCollection Items   = ItemGroupRepeater.Items;
        CheckBox           chkSelected;
        Literal            lblGroupID;
        PackageGroupEntity PackageGroup;

        foreach (RepeaterItem Item in Items)
        {
            chkSelected     = (CheckBox)Item.FindControl("chkSelected");
            lblGroupID      = (Literal)Item.FindControl("lblGroupID");
            PackageGroup    = new PackageGroupEntity();
            PackageGroup.ID = new PackageGroupPK {
                PackageID = PackageID,
                GroupID   = Convert.ToInt32(lblGroupID.Text)
            };
            if (chkSelected.Checked)
            {
                Package.SavePackageGroup(PackageGroup);
            }
            if (!chkSelected.Checked)
            {
                Package.DeletePackageGroup(PackageGroup);
            }
        }
        decimal PackageCharge = Package.GetPackagePrice(PackageID);

        hValue.Value = PackageCharge + "";
        Package.UpdatePackagePrice(PackageID, PackageCharge);
        ShowMessage("套餐组合项保存成功!");
    }
        private void SaveCheckedGroups(String RegisterNo, int PackageID, List <int> ItemGroups)
        {
            //自定义套餐保存体检组合项
            if ((ItemGroups != null) && (ItemGroups.Count > 0))
            {
                SaveCheckedGroups(RegisterNo, ItemGroups);
                return;
            }
            GroupResultDataAccess GroupDataAccess = new GroupResultDataAccess();

            using (PackageBusiness Package = new PackageBusiness()) {
                List <PackageGroupViewEntity> Groups = Package.GetPackageGroups(PackageID);
                foreach (PackageGroupViewEntity Group in Groups)
                {
                    GroupResultEntity GroupResult = new GroupResultEntity {
                        ID = new GroupResultPK {
                            GroupID    = Group.ID.GroupID,
                            RegisterNo = RegisterNo
                        },
                        DeptID    = Group.DeptID,
                        IsOver    = false,
                        PackageID = PackageID
                    };
                    GroupDataAccess.SaveGroupResult(GroupResult);
                    SaveCheckItems(RegisterNo, Group.ID.GroupID);
                }
            }
        }
 public ActionResult applyToAddBeneficiary(BeneficiaryViewModel model, string reason)
 {
     if (ModelState.IsValid)
     {
         var pb       = new PackageBusiness();
         var profileB = new ProfileBusiness();
         for (int x = 0; x < pb.GetAll().Count; x++)
         {
             //find the Policy Holder's package
             if (pb.GetAll()[x].PackageId == pb.GetByName(profileB.getPolicyDetails(HttpContext.User.Identity.Name).packageName).PackageId)
             {
                 //if we haven't reached the maximum number the package can cover, add the beneficiary
                 if (profileB.getBeneficiaries(HttpContext.User.Identity.Name).Count < pb.GetByName(profileB.getPolicyDetails(HttpContext.User.Identity.Name).packageName).maxBeneficiary)
                 {
                     TempData["Error"] = profileB.applyToAddBen(HttpContext.User.Identity.Name, model, reason);
                     break;
                 }
                 else //otherwise return an alert to the user
                 {
                     TempData["Error"] = pb.GetAll()[x].Name + " package can cover up to " + pb.GetAll()[x].maxBeneficiary + " beneficiaries";
                 }
             }
         }
         return(RedirectToAction("attachDocuments"));
     }
     return(View(model));
 }
Exemple #8
0
 public ActionResult AddPackage(PackageView model)
 {
     if (ModelState.IsValid)
     {
         prepo.AddPackage(model);
         var pb = new PackageBusiness();
         return(RedirectToAction("AddPackageBenefits", new { packID = pb.GetByName(model.Name).PackageId }));
     }
     return(View(model));
 }
Exemple #9
0
    public override void DataBind()
    {
        int    RecordCount   = 0;
        int    SelectedIndex = drpCategory.SelectedIndex;
        String SearchKey     = txtName.Text.Trim();
        int    DeptID        = Convert.ToInt32(Request.Params["DeptID"]);

        if (SelectedIndex == 0)
        {
            //团体体检或体检收费

            List <DepartmentGroupViewEntity> DataSource;
            //检索团体体检是否设置了套餐
            using (DepartmentGroupBusiness DeptGroup = new DepartmentGroupBusiness()) {
                DataSource = DeptGroup.GetDepartmentGroups(DeptID);
            }
            //团体客户有体检套餐设置
            if (DataSource.Count > 0)
            {
                PackageRepeater.DataSource = DataSource;
                Pager.RecordCount          = DataSource.Count;
            }
            //团体客户未设置体检套餐
            if (DataSource.Count <= 0)
            {
                using (PackageBusiness Package = new PackageBusiness()) {
                    PackageRepeater.DataSource = Package.GetPackages(Pager.CurrentPageIndex,
                                                                     Pager.PageSize, SearchKey, PackageSex, out RecordCount);;
                    Pager.RecordCount = RecordCount;
                }
            }

            Pager.Visible  = true;
            Pager1.Visible = false;
            Panel.Visible  = false;
        }
        if (SelectedIndex == 1)
        {
            using (ItemGroupBusiness ItemGroup = new ItemGroupBusiness()) {
                ItemGroupRepeater.DataSource = ItemGroup.GetItemGroups(Pager1.CurrentPageIndex, Pager1.PageSize,
                                                                       SearchKey, ItemGroupSex, out RecordCount);
                Pager1.RecordCount = RecordCount;
            }
            Pager.Visible  = false;
            Pager1.Visible = true;
            Panel.Visible  = true;
        }
        base.DataBind();
    }
 public BaseAPIController() : base()
 {
     lgBus        = new LoginBusiness(this.GetContext());
     newsBus      = new NewsBusiness(this.GetContext());
     notiBus      = new NotifyBusiness(this.GetContext());
     giftBus      = new GiftBusiness(this.GetContext());
     rqBus        = new RequestBusiness(this.GetContext());
     cusBus       = new CustomerBusiness(this.GetContext());
     mBus         = new MessageBusiness(this.GetContext());
     apiBus       = new RequestAPIBusiness(this.GetContext());
     pBus         = new PointBusiness(this.GetContext());
     statisticBus = new StatisticBusiness(this.GetContext());
     shopBus      = new ShopBusiness(this.GetContext());
     itemBus      = new ItemBusiness(this.GetContext());
     orderBus     = new OrderBusiness(this.GetContext());
     packBus      = new PackageBusiness(this.GetContext());
     vnPay        = new VNPay(this.GetContext());
 }
Exemple #11
0
        //Get : AddPackageBenefit
        public ActionResult AddPackageBenefits(int?packID)
        {
            if (packID == null)
            {
                return(HttpNotFound());
            }
            var pb  = new PackageBusiness();
            var pbv = new Template.Model.ViewModels.PackageBenefitView();

            pbv.benefit               = new List <Template.Model.ViewModels.BenefitView>();
            pbv.benefit               = pb.GetAllBenefits();
            Session["packID"]         = packID;
            Session["Name"]           = pb.GetById((int)packID).Name;
            Session["PremiumAmount"]  = pb.GetById((int)packID).PremiumAmount;
            Session["maxBeneficiary"] = pb.GetById((int)packID).maxBeneficiary;

            List <BenefitView> benefit = new List <BenefitView>();

            benefit = pb.GetAllBenefits();
            return(View(benefit));
        }
    private void InitialItemGroup()
    {
        PackageBusiness Package             = new PackageBusiness();
        int             RecordCount         = 0;
        List <PackageGroupViewEntity> List  = Package.GetPackageGroups(1, 200, PackageID, out RecordCount);
        RepeaterItemCollection        Items = ItemGroupRepeater.Items;
        CheckBox chkSelected;
        Literal  lblGroupID;
        int      GroupID, Count;

        foreach (RepeaterItem Item in Items)
        {
            chkSelected = (CheckBox)Item.FindControl("chkSelected");
            lblGroupID  = (Literal)Item.FindControl("lblGroupID");
            GroupID     = Convert.ToInt32(lblGroupID.Text);
            Count       = List.Count(p => p.ID.PackageID == PackageID && p.ID.GroupID == GroupID);
            if (Count > 0)
            {
                chkSelected.Checked = true;
            }
        }
    }
Exemple #13
0
    private List <GroupItem> GetGroupItems(String RegisterNo, int PackageID)
    {
        List <DepartmentEntity>       Departments;
        List <PackageGroupViewEntity> Groups;

        using (PackageBusiness Business = new PackageBusiness()) {
            Groups = Business.GetPackageGroups(PackageID);
        }
        using (DepartmentBusiness Depart = new DepartmentBusiness()) {
            Departments = Depart.GetDepartments();
        }
        var q = from a in Groups
                join b in Departments on a.DeptID equals b.DeptID
                select new GroupItem {
            RegisterNo = RegisterNo,
            GroupID    = Convert.ToInt32(b.DeptKind),
            GroupName  = a.GroupName,
            Clinical   = a.Clinical,
            Notice     = a.Notice
        };

        return(q.ToList());
    }
        public ActionResult AddPackage()
        {
            var pb = new PackageBusiness();

            return(View(pb.GetPackagesWithBenefits()));
        }
 protected override void OnUnload(EventArgs e)
 {
     m_Package.Dispose();
     m_Package = null;
     base.OnUnload(e);
 }
 protected override void OnInit(EventArgs e)
 {
     m_Package = new PackageBusiness();
     base.OnInit(e);
 }