public async Task <IActionResult> Personaldata(string MemberMobile) { // 2-1.系統在Action【Member/Personaldata】中讀取會員基本資料。 MemberViewModel MVM = await IMR.GetMember(MemberMobile); // 3.系統在Action【Member/Personaldata】中回傳View,並傳回2-1讀取值。 return(View(MVM)); }
public ActionResult GetBankAccountImg(string MemberPhone) { Task <MemberViewModel> ret = IMR.GetMember(MemberPhone); if (ret.Result.PictureContent != null) { return(File(ret.Result.PictureContent, "image/jpeg")); } return(new EmptyResult()); }
//20181121 ---棋 public async Task <IViewComponentResult> InvokeAsync(string MemberMobile, DateTime?sDate, DateTime?eDate, string ReferrerMobile, int Page, int StartPage) { //9-1.系統在ViewComponent【Followertriumph】中讀取Appsetting.json中的每頁筆數BRowsPerPage以及分頁頁碼連結總數PageCount。 int RowsPerPage = int.Parse(config["Page:BRowsPerPage"]); int PageCount = int.Parse(config["Page:PageCount"]); //9-2.系統在ViewComponent【Followertriumph】讀取我的下線業績總數。 long memberCount = await IMR.GetBonusChangeRecordCount(MemberMobile, sDate, eDate); //9-3.系統依9-2傳回值將9傳送頁碼重設在Between 1 and(9讀取記錄筆數/RowsPerPage)+(9讀取記錄筆數%RowsPerPage==0?0:1)。 int TotalPages = (int)(memberCount / RowsPerPage); if (memberCount % RowsPerPage > 0) { TotalPages += 1; } if (Page < 1) { Page = 1; } if (Page > TotalPages) { Page = TotalPages; } if (Page <= 0) { Page = 1; } //9-4.系統計算資料Skip數 = (9傳送頁碼(預設1) - 1)*9 - 1讀取RowsPerPage。 int Skip = (Page - 1) * RowsPerPage; //9-5系統在ViewComponent【FollowertriumphViewComponent】讀取我的下線業績清單: List <BonusChangeRecordListViewModel> GMBCRL = await IMR.GetBonusChangeRecordList(MemberMobile, sDate, eDate, Skip, RowsPerPage); MemberViewModel Member = await IMR.GetMember(MemberMobile); //9-6.系統設定PagerTagHelper之相關參數 int CurrentPage = Page; //9-6-1.系統將管理者權限清單Session["EmployeeRights"]暫存在ViewBag.TR。 ViewBag.TR = HttpContext.Session.GetObjectFromJson <List <int> >("EmployeeRights"); ViewBag.Page = Page; return(View(new PointnotesManageViewModel { listGetMemberBonusChangeRecordListViewModel = GMBCRL, CurrentPage = CurrentPage, TotalPages = TotalPages, PageCount = PageCount, StartPage = StartPage, Member = Member, Parameters = Page, })); }
// 8.系統接收6上傳資料。 public async Task <int> UpdateOrderState(string OrderId, byte OrderStateId, string MemberMobile) { int ret = 1; // 12.系統回傳0。 try { // 9.系統更新一筆銷貨單狀態。 ret = await IMR.UpdateOrderState(OrderId, OrderStateId); if (OrderStateId == 4) { // 9-1.系統判斷OrderStateId==4(己付款)。 // 9-2.系統在Action【Member/Personaldata】中讀取會員基本資料。 MemberViewModel mvm = await IMR.GetMember(MemberMobile); System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage(); mail.To.Add(mvm.eMail); mail.From = new System.Net.Mail.MailAddress($@"{IEC.SmtpUsername}@{IEC.SmtpServer}"); mail.Subject = "288訂購訊息"; mail.Body = "您好,\n"; mail.Body += $"您在288建立的訂單己確認付款完成,訂單代碼為{OrderId},<br>"; mail.Body += $"若為會員,請至本平台會員中心查詢訂單處理狀態,<br>"; mail.Body += $"若非會員,本平台會寄送eMail告知訂單處理狀況,<br>"; mail.Body += $"288網址:http://dreammaker.game.tw/YunQiWholesale,<br>"; mail.Body += $"客服專線:04-28825252"; mail.Body += $"288應謝您!"; mail.IsBodyHtml = true; IES.SendMail(mail); } // 9-1a.系統判斷OrderStateId!=4(己付款)。 // 9-1a-1.回10。 // 10.系統判斷9成功執行。 // 11.系統回傳9傳回值。 } catch (Exception ex) { // 10.系統判斷9執行時發生例外。 // 10a-1.系統回傳3。 ret = 3; } return(ret); }
public async Task <int> InsertMemberForget(string MemberMobile) { int ret = 0; //產生NewGuid var token = Utility.Data.IntGuid(); ret = await IMR.InsertMemberForget(MemberMobile, token); //取得 MemberEmail MemberViewModel MemberList = await IMR.GetMember(MemberMobile); //此帳號沒有email if (MemberList.eMail == null || MemberList.eMail == "") { ret = -1; } if (ret == 0) { //產生Email System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage(); mail.To.Add(MemberList.eMail); mail.From = new System.Net.Mail.MailAddress($@"{IEC.SmtpUsername}@{IEC.SmtpServer}"); mail.Subject = "更改密碼"; mail.Body = "您好,\n <br>"; mail.Body += $"最近有人要求更改您 員工管理系統 的帳戶密碼。<br>"; mail.Body += $"如果是您提出的請求,您可以從這裡設定新密碼:<br>"; mail.Body += $"網址: https://localhost:44378/LostPassword?MemberMobile=" + MemberMobile + "&token=" + token + "<br>"; mail.Body += $"若您不想變更密碼,或是您沒有提出此要求,請忽略並刪除此訊息。<br>"; mail.Body += $"為確保您的帳戶安全無虞,請不要轉寄這封電子郵件。 請參訪說明中心,瞭解更多。<br>"; mail.Body += $"使用愉快!<br>"; mail.IsBodyHtml = true; IES.SendMail(mail); return(ret); } return(ret); }
public async Task <IViewComponentResult> InvokeAsync(int Month, int Enabled, string MemberMobile = "", string MemberName = "", string ReferrerMobile = "", int MemberLevelId = 0, int Page = 1, int LinkType = 0, int StartPage = 1, string AClass = "page-link") { // 9-1.系統在ViewComponent【MemberList】中讀取Appsetting.json中的每頁筆數RowsPerPage以及分頁頁碼連結總數PageCount。 int RowsPerPage = int.Parse(config["Page:RowsPerPage"]); int PageCount = int.Parse(config["Page:PageCount"]); // 9-2.系統在ViewComponent【MemberList】讀取會員總數。 long memberCount = await IMR.GetMemberListCount(MemberMobile, MemberName, ReferrerMobile, MemberLevelId, Enabled); long BonusListCount = await IMR.GetMemberBonusListCount(Month, ReferrerMobile); // 9-3.系統依9-2傳回值將9傳送頁碼重設在Between 1 and (9讀取記錄筆數/RowsPerPage)+(9讀取記錄筆數%RowsPerPage==0?0:1)。 int TotalPages = (int)(memberCount / RowsPerPage); if (memberCount % RowsPerPage > 0) { TotalPages += 1; } if (Page < 1) { Page = 1; } if (Page > TotalPages) { Page = TotalPages; } if (Page <= 0) { Page = 1; } // 9-4.系統計算資料Skip數=(9傳送頁碼(預設1)-1)*9-1讀取RowsPerPage。 int Skip = (Page - 1) * RowsPerPage; // 9-5系統在ViewComponent【MemberListViewComponent】讀取會員清單: MemberViewModel Member = await IMR.GetMember(MemberMobile); List <MemberBonusListViewModel> o = await IPR.GetMemberBonusList(int.Parse(DateTime.Now.ToString("yyyyMM")), ReferrerMobile, Skip, RowsPerPage); List <MemberViewModel> lMLVM = await IMR.GetMemberList(MemberMobile, MemberName, ReferrerMobile, MemberLevelId, Enabled, Skip, RowsPerPage); int ret = 0; foreach (MemberViewModel tmp in lMLVM) { lMLVM[ret].OrderBonus = await IMR.GetMemberOrderBonusSum(tmp.MemberMobile); ret++; } // 9-6.系統設定PagerTagHelper之相關參數 int CurrentPage = Page; // 9-6-1.系統將管理者權限清單Session["EmployeeRights"]暫存在ViewBag.TR。 ViewBag.TR = HttpContext.Session.GetObjectFromJson <List <int> >("EmployeeRights"); // 9-7.系統回傳View(new MemberManageViewModel { //listMemberListViewModel = 9 - 5讀取值, //CurrentPage = 9 - 6設定值, //TotalPages = 9 - 6設定值, //PageCount = 9 - 6設定值, //StartPage = 9 - 6設定值, //Parameters = 9 - 6設定值 //}); return(View(new MemberListManageViewModel { listMemberListViewModel = lMLVM, listMemberBonusListViewModel = o, CurrentPage = CurrentPage, TotalPages = TotalPages, PageCount = PageCount, StartPage = StartPage, LinkType = LinkType, AClass = AClass })); }