Exemplo n.º 1
0
        public JsonResult Del(int id)
        {
            var json = new JsonModel();

            var relationBLL = new RelationBLL();

            if (relationBLL.GetCount(i => i.ParentID == id) > 0)
            {
                json.Message = "抱歉,当前关系还有未删除的子级人员,不能直接删除!";
                return(Json(json));
            }

            if (relationBLL.Delete(new Relation()
            {
                ID = id
            }) > 0)
            {
                json.Status  = "success";
                json.Message = "删除成功!";
            }
            else
            {
                json.Message = "抱歉,删除失败,请稍后重试!";
            }

            return(Json(json));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 师门关系树状图数据获取方法
        /// </summary>
        /// <returns></returns>
        public JsonResult GetTreeData()
        {
            var json        = new JsonModel();
            var relationBLL = new RelationBLL();

            json.Status = "success";
            json.Data   = relationBLL.GetTreeJson();


            return(Json(json));
        }
Exemplo n.º 3
0
        /// <summary>
        /// 关系添加/编辑视图
        /// </summary>
        /// <returns></returns>
        public ActionResult Edit(int?id)
        {
            var relationBLL = new RelationBLL();

            var model = relationBLL.GetModel(i => i.ID == id) ?? new Relation();

            var parentName = "";

            if (id != null)
            {
                var parentRelation = relationBLL.GetModel(i => i.ID == model.ParentID);
                parentName = parentRelation != null ? parentRelation.Name : "无";
            }

            ViewBag.Data = new
            {
                ParentName = parentName
            }.ToExpando();

            return(View(model));
        }
Exemplo n.º 4
0
        public JsonResult Edit(Relation model)
        {
            var json        = new JsonModel();
            var relationBLL = new RelationBLL();

            if (model.ID > 0)
            {
                model.UpdateDate   = DateTime.Now;
                model.UpdateUserID = LoginUser.ID;

                if (relationBLL.Update(model, "ParentID", "Name", "Describe", "UpdateDate", "UpdateUserID") > 0)
                {
                    json.Status  = "success";
                    json.Message = "修改成功!";
                }
                else
                {
                    json.Message = "抱歉,修改失败,请稍后重试!";
                }
            }
            else
            {
                model.CreateDate   = DateTime.Now;
                model.CreateUserID = LoginUser.ID;

                if (relationBLL.Add(model) > 0)
                {
                    json.Status  = "success";
                    json.Message = "添加成功!";
                }
                else
                {
                    json.Message = "抱歉,添加失败,请稍后重试!";
                }
            }


            return(Json(json));
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                UsersBLL   oUsersBLL   = new UsersBLL();
                MachineBLL oMachineBLL = new MachineBLL();
                userId = MerchantFrontCookieBLL.GetMerchantFrontUserId();
                if (userId > 0)
                {
                    Machine oMachine = new Machine();
                    oMachine = oMachineBLL.GetModelByUserId(userId);
                    if (oMachine != null)
                    {
                        MachineID = oMachine.MachineID;
                    }
                }
                TransNo               = BWJSCommonHelper.SafeString(Request["transNo"], "");
                TransNo               = string.IsNullOrEmpty(TransNo) ? "" : TransNo.Trim();
                CaseCode              = BWJSCommonHelper.SafeString(Request["CaseCode"], "");
                CaseCode              = string.IsNullOrEmpty(CaseCode) ? "" : CaseCode.Trim();
                protectitemid         = BWJSCommonHelper.SafeString(Request["protectitemid"], "");
                protectitemid         = string.IsNullOrEmpty(protectitemid) ? "" : protectitemid.Trim();
                priceArgsId           = BWJSCommonHelper.SafeString(Request["priceArgsId"], "");
                priceArgsId           = string.IsNullOrEmpty(priceArgsId) ? "" : priceArgsId.Trim();
                price                 = BWJSCommonHelper.SafeString(Request["price"], "");
                price                 = string.IsNullOrEmpty(price) ? "" : price.Trim();
                SinglePrice           = BWJSCommonHelper.SafeString(Request["SinglePrice"], "");
                SinglePrice           = string.IsNullOrEmpty(SinglePrice) ? "" : SinglePrice.Trim();
                buyCount              = BWJSCommonHelper.SafeString(Request["buyCount"], "");
                buyCount              = string.IsNullOrEmpty(buyCount) ? "" : buyCount.Trim();
                healthId              = BWJSCommonHelper.SafeString(Request["healthId"], "");
                healthId              = string.IsNullOrEmpty(healthId) ? "" : healthId.Trim();
                productId             = DNTRequest.GetInt("productId", 0);
                insurantDateLimitVal  = BWJSCommonHelper.SafeString(Request["hdinsurantDateLimitVal"], "");  //承保值
                insurantDateLimitUnit = BWJSCommonHelper.SafeString(Request["hdinsurantDateLimitUnit"], ""); //承保单位
                CardTypeBLL oCardTypeBLL = new CardTypeBLL();
                oCardTypeList = oCardTypeBLL.GetCardTypeList(CaseCode);
                RelationBLL oRelationBLL = new RelationBLL();
                listRelationViewMode = oRelationBLL.GetRelationViewModelList(CaseCode);
                switch (CaseCode)
                {
                case "0000052178002133":
                    isShowProvince = true;
                    isoneSelf      = true;//被保人必须是投保人本人
                    break;

                case "0001075211202628":
                    isShowcaichansuozaidi    = true;
                    isShowrelatedPersonHouse = true;
                    isoneSelf = true;
                    break;

                case "0000076164701939":
                    isluyouxianCXMDD       = true;
                    oTravelDestinationList = oTravelDestinationBLL.GetTravelDestinationList(CaseCode);
                    ProductDestinationReq oProductDestinationReqModel = new ProductDestinationReq();
                    oProductDestinationReqModel.caseCode = CaseCode;
                    oProductDestinationReqModel.transNo  = TransNo;
                    ProductCXDestinationResp oProductCXDestinationResp = oBaoxianDataBLL.ProductDestinations(oProductDestinationReqModel);
                    CXMDDStr = GetCXMDDStr(oProductCXDestinationResp);
                    //     isShowrelatedPersonHouse = true;
                    break;

                case "0000052067400588":
                    isShowcaichansuozaidi = true;
                    isoneSelf             = true;
                    break;

                case "0001077178502139":
                    typeMen = true;
                    break;

                case "0001077178602140":
                    typeWomen = true;
                    break;

                case "0001076209802609":    //一起慧99-百万医疗保险 无门诊计划
                    isHaveJob = true;
                    break;

                case "0001076211102627":    //一起慧99-百万医疗保险 有门诊计划
                    isHaveJob = true;
                    break;

                case "0001075190802342":    //少儿住院宝
                    isOnlyOthers    = true;
                    StartDateParame = 3;    // 这个产品要求(起保日期只能为投保日起第三天)
                    break;
                }
                List <Products> oProductsList = bll.ProductsByCaseCode(CaseCode);
                if (oProductsList != null)
                {
                    ProModel = oProductsList.FirstOrDefault();
                }
            }
        }