Exemplo n.º 1
0
        //获取会员等级设置的结果回调
        private void GetMemberLvSettingResult(ResultModel result)
        {
            if (result.pack.Cmd != Cmd.CMD_SYS_INFO || !result.pack.Content.ScSysInfo.Parent.Equals(SystemManageNetOperation.lvParent))
            {
                return;
            }

            NetMessageManage.RemoveResultBlock(GetMemberLvSettingResult);
            //System.Console.WriteLine("GetMemberLvSettingResult:" + result.pack);
            System.Console.WriteLine("获取会员等级信息");
            if (result.pack.Content.MessageType == 1)
            {
                this.memberTypes.Clear();
                this.memberDict.Clear();

                foreach (StructDictItem item in result.pack.Content.ScSysInfo.ChildList)
                {
                    MemberTypeModel model = new MemberTypeModel(item);
                    //this.memberDict.Add(item.Code, model);
                    this.memberDict[item.Code] = model;
                    this.memberTypes.Add(model);
                }
                if (RequestSysEvent != null)
                {
                    this.RequestSysEvent(result);
                }
            }
        }
Exemplo n.º 2
0
        //通过条件查询会员
        private void SearchMember()
        {
            //会员类型
            int type = 0;

            if (this.memberTypeComboBoxEdit.SelectedIndex > 0)
            {
                MemberTypeModel item = this.memberTypes[this.memberTypeComboBoxEdit.SelectedIndex - 1];
                type = item.typeId;
            }

            MEMBERSTATUS status = MEMBERSTATUS.无;

            Enum.TryParse <MEMBERSTATUS>(this.statusComboBoxEdit.Text, out status);

            string key = "";

            if (!this.searchButtonEdit.Text.Equals(this.searchButtonEdit.Properties.NullText))
            {
                key = this.searchButtonEdit.Text;
            }

            //System.Console.WriteLine("type:" + type + "\nstatus:" + status + "\nkey:" + key);
            //测试多条件查询
            StructPage.Builder page = new StructPage.Builder()
            {
                Pagebegin = this.pageBegin,
                Pagesize  = this.pageSize,
                Fieldname = field,
                Order     = order,  //
            };

            MemberNetOperation.SearchConditionMember(SearchMemberResult, page.Build(), (int)status, type, key);
        }
Exemplo n.º 3
0
        public ActionResult Create(MemberTypeModel model)
        {
            int flag;

            try
            {
                // TODO: Add insert logic here

                if (ModelState.IsValid)
                {
                    flag = pro.Insert(model);
                    if (flag == 1)
                    {
                        TempData["success"] = "Record Created Successfully !";
                        return(RedirectToAction("Index"));
                    }
                    else
                    {
                        TempData["message"] = "Value with this name already exists in Records !";
                        return(View(model));
                    }
                }
                else
                {
                    return(View(model));
                }
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 4
0
        public ActionResult Index()
        {
            MemberTypeModel model = new MemberTypeModel();

            model.memberTypes = pro.GetList();
            return(View(model));
        }
Exemplo n.º 5
0
        //
        // GET: /MemberTypeSetup/Edit/5

        public ActionResult Edit(int id)
        {
            MemberTypeModel model = new MemberTypeModel();

            model      = pro.GetObject(id);
            model.date = model.ValidUpto.ToString();
            return(View(model));
        }
Exemplo n.º 6
0
 public MemberTypeModel GetObject(int memberTypeId)
 {
     using (EHMSEntities ent = new EHMSEntities())
     {
         var             obj   = ent.SetupMemberTypes.Where(x => x.MemberTypeID == memberTypeId).FirstOrDefault();
         MemberTypeModel model = AutoMapper.Mapper.Map <SetupMemberType, MemberTypeModel>(obj);
         return(model);
     }
 }
Exemplo n.º 7
0
        //更新会员数据(会员等级设定使用)
        public static void UpdateMemberTypeData(IList <StructDictItem> newMemberTypes)
        {
            SysManage.Manage().memberTypes.Clear();
            SysManage.Manage().memberDict.Clear();

            foreach (StructDictItem item in newMemberTypes)
            {
                MemberTypeModel model = new MemberTypeModel(item);
                SysManage.Manage().memberDict.Add(item.Code, model);
                SysManage.Manage().memberTypes.Add(model);
            }
        }
Exemplo n.º 8
0
 public void Update(MemberTypeModel model)
 {
     using (EHMSEntities ent = new EHMSEntities())
     {
         var objtoedit = ent.SetupMemberTypes.Where(x => x.MemberTypeID == model.MemberTypeID).FirstOrDefault();
         AutoMapper.Mapper.Map(model, objtoedit);
         objtoedit.Status = "A";
         //objtoedit.ValidUpto = Convert.ToDateTime(model.date);
         objtoedit.ValidUpto        = DateTime.Now;
         ent.Entry(objtoedit).State = System.Data.EntityState.Modified;
         ent.SaveChanges();
     }
 }
Exemplo n.º 9
0
 public ActionResult Edit(int id, MemberTypeModel model)
 {
     // TODO: Add update logic here
     if (ModelState.IsValid)
     {
         pro.Update(model);
         TempData["success"] = "Record Updated Successfully !";
         return(RedirectToAction("Index"));
     }
     else
     {
         return(View(model));
     }
 }
Exemplo n.º 10
0
 public int Insert(MemberTypeModel model)
 {
     using (EHMSEntities ent = new EHMSEntities())
     {
         if (ent.SetupMemberTypes.Any(s => s.MemberTypeName == model.MemberTypeName))
         {
             return(0);
         }
         var objToSave = AutoMapper.Mapper.Map <MemberTypeModel, SetupMemberType>(model);
         objToSave.Status = "A";
         //objToSave.ValidUpto = Convert.ToDateTime(model.date);
         objToSave.ValidUpto = DateTime.Now;
         ent.SetupMemberTypes.Add(objToSave);
         ent.SaveChanges();
         return(1);
     }
 }
Exemplo n.º 11
0
        //
        // GET: /MemberTypeSetup/Create

        public ActionResult Create()
        {
            MemberTypeModel model = new MemberTypeModel();

            return(View(model));
        }