Пример #1
0
        public ActionResult EditYTOrder(Guid YTOrderid)
        {
            YTOrder ytorder = ytorderService.GetByID(YTOrderid);

            if (TryUpdateModel(ytorder, new string[] { "Url", "Count", "Productid", "YTOrderStatus", "Categoryid", "Istest" }) && ModelState.IsValid)
            {
                /*** 訂單不是進行中,將完成名單的會員Docker關閉 ****/
                if (ytorder.YTOrderStatus != 1)
                {
                    IEnumerable <YTMembers>   YTMembers   = ytmembersService.Get();
                    IEnumerable <YTOrderlist> YTOrderlist = ytorderlistService.Get().Where(a => a.YTOrderid == YTOrderid);
                    foreach (YTOrderlist list in YTOrderlist)
                    {
                        foreach (YTMembers YTMember in YTMembers)
                        {
                            if (YTMember.YTMemberid == list.YTMemberid)
                            {
                                YTMember.Isdocker = 0;  // 關閉Docker 【0 : 關閉, 1 : 開啟】
                                ytmembersService.SpecificUpdate(YTMember, new string[] { "Isdocker" });
                            }
                        }
                    }
                    ytmembersService.SaveChanges();
                }
                ytorderService.Update(ytorder);
                ytorderService.SaveChanges();
            }
            return(RedirectToAction("YTOrder"));
        }
Пример #2
0
        public ActionResult DeleteYTMembers(Guid YTMemberid, int p)
        {
            YTMembers ytmember = ytmembersService.GetByID(YTMemberid);

            ytmember.Isenable = 0;
            ytmembersService.SpecificUpdate(ytmember, new string[] { "Isenable" });
            ytmembersService.SaveChanges();
            return(RedirectToAction("YTMembers"));
        }
Пример #3
0
        /*** 批量刪除YT會員 ****/
        public JsonResult AjaxDeleteYTMembersChecked(Guid[] YTMemberid)
        {
            if (YTMemberid != null)
            {
                foreach (Guid thismemberid in YTMemberid)
                {
                    YTMembers ytmember = ytmembersService.GetByID(thismemberid);
                    ytmember.Isenable = 0;
                    ytmembersService.SpecificUpdate(ytmember, new string[] { "Isenable" });
                }
                ytmembersService.SaveChanges();
            }

            return(this.Json("Success"));
        }