コード例 #1
0
        public ActionResult ToInsert(string datas)
        {
            var scores = JsonSerializer.Deserialize <Score[]>(datas);

            foreach (var i in scores)
            {
                CProductRank rank = new CProductRank();
                rank.fRank           = i.score;
                rank.fComment        = i.message;
                rank.fSubmitDataTime = DateTime.UtcNow.AddHours(08);
                rank.fDetailOrderIId = i.id;
                CProductRankFactory.fn評價新增(rank);

                var a = CDetailOrderFactory.fn訂單明細查詢().Where(n => n.fDetailOrderIId == i.id).ToList();

                CNotice c = new CNotice();
                c.fCategoryType   = "評價留言";
                c.fLink           = "超連結";
                c.fNoticeDatetime = DateTime.UtcNow.AddHours(08);
                c.fMemberId       = a.Single().fMemberSellerId;
                c.fNoticeContent  = "您的" + a.Single().fName + "以新增評價";
                CNoticeFactory.fn通知訂單訊息新增(c);
            }

            return(new ApiResult());
        }
コード例 #2
0
        //將選取的對象加入黑名單
        public string intoblacklist(int memberid, string blackreason)
        {
            var goblacklist = CMemberFactory.fn會員查詢().FirstOrDefault(g => g.fMemberId == memberid);

            if (goblacklist.fIsBanned == true)//判斷是否已經是黑名單 避免重複加入黑名單
            {
                ViewBag.blacklist = "此會員已是黑名單會員";

                return("已是黑名單成員");
            }
            else
            {
                goblacklist.fIsBanned = true;
                CMemberFactory.fn會員更新(goblacklist);
                CBlackListFactory.fn黑名單新增(new CBlackList()
                {
                    fLockDateTime = DateTime.UtcNow.AddHours(08),
                    fMemberId     = memberid,
                    fReason       = blackreason
                });

                CNotice c = new CNotice();
                c.fNoticeDatetime = DateTime.Now;
                c.fNoticeContent  = "此帳號因發言屢次違規已被設為黑名單,期間內無法針對商品進行留言";
                c.fCategoryType   = "管理員";
                c.fLink           = "超連結";
                c.fMemberId       = goblacklist.fMemberId;
                CNoticeFactory.fn通知訂單訊息新增(c);

                return("黑名單更新成功!");
            }
        }
コード例 #3
0
        //將選取的對象加入黑名單
        public string commentboard(int commentid, string content, int memberid)
        {
            CAdmin admin = Session[CAdminSession.Session_Login_User] as CAdmin;

            var comment = CCommentFactory.fn留言查詢().FirstOrDefault(m => m.fCommentId == commentid);

            comment.fContent  = content;
            comment.fIsBanned = true;
            CCommentFactory.fn留言更新(comment);
            var member = CMemberFactory.fn會員查詢().FirstOrDefault(n => n.fMemberId == memberid);

            CNotice c = new CNotice();

            c.fNoticeDatetime = DateTime.UtcNow.AddHours(08);
            c.fNoticeContent  = "此留言因涉及違規發言已被遮蔽";
            c.fCategoryType   = "管理員";
            c.fLink           = "超連結";
            c.fMemberId       = member.fMemberId;
            CNoticeFactory.fn通知訂單訊息新增(c);

            return("遮蔽原因更新成功!");
        }
コード例 #4
0
        //將選取的對象解除黑名單
        public string unlockBlacklist(int bannid, int memberid)
        {
            CAdmin            admin     = Session[CAdminSession.Session_Login_User] as CAdmin;
            List <CBlackList> blacklist = new List <CBlackList>();
            var unlock = CBlackListFactory.fn黑名單查詢().FirstOrDefault(m => m.fBannedId == bannid);
            var member = CMemberFactory.fn會員查詢().FirstOrDefault(n => n.fMemberId == memberid);

            member.fIsBanned = false;
            CMemberFactory.fn會員更新(member);
            CBlackListFactory.fn黑名單刪除(unlock);

            CNotice c = new CNotice();

            c.fNoticeDatetime = DateTime.UtcNow.AddHours(08);
            c.fNoticeContent  = "此帳號已從黑名單解鎖";
            c.fCategoryType   = "管理員";
            c.fLink           = "超連結";
            c.fMemberId       = member.fMemberId;
            CNoticeFactory.fn通知訂單訊息新增(c);

            return("解鎖成功!");
        }
コード例 #5
0
        public void ToOrder(int totalprice, int remain, int cartId)
        {
            CMember member = (CMember)Session[CMemberSession.Session_Login_User];//會員
            COrder  o      = new COrder();

            o.fPurchaseDate = DateTime.UtcNow.AddHours(08);
            o.fTotalPrice   = totalprice;
            o.fMemberId     = member.fMemberId;
            COrderFactory.fn訂單新增(o);

            CMemberFactory.fn會員更新點數(member, remain);

            CNotice c = new CNotice();

            c.fCategoryType   = "系統";
            c.fLink           = "超連結";
            c.fNoticeDatetime = DateTime.UtcNow.AddHours(08);
            c.fMemberId       = member.fMemberId;
            c.fNoticeContent  = "您的訂單已完成了";
            CNoticeFactory.fn通知訂單訊息新增(c);

            List <CCartProduct> CP = CCartProductFactory.fn購物車商品個人查詢(cartId).ToList();

            var f = CNoteFolderFactory.fn筆記資料夾查詢(member).Where(q => q.fFolderName == "未分類筆記").ToList();

            int orderid = COrderFactory.fn訂單查詢(member).LastOrDefault().fOrderId;

            foreach (var a in CP)
            {
                CDetailOrderFactory.fn訂單明細新增(orderid, a.fProductId);
                CNotice c1 = new CNotice();
                c1.fCategoryType   = "銷售";
                c1.fLink           = "超連結";
                c1.fNoticeDatetime = DateTime.UtcNow.AddHours(08);
                c1.fMemberId       = a.fMemberSellerId;
                c1.fNoticeContent  = "您的" + a.fName + "已被購買";
                CNoticeFactory.fn通知訂單訊息新增(c1);

                CIncome i1 = new CIncome();
                i1.fIncome          = a.fPrice;
                i1.fPaymentDateTime = DateTime.UtcNow.AddHours(08);
                i1.fIncomeCategory  = "獲利";
                i1.fMemberId        = a.fMemberSellerId;
                CIncomeFactory.fn公司獲利新增(i1);

                var     point  = CMemberFactory.fn會員查詢().Where(z => z.fMemberId == a.fMemberSellerId);
                int     point1 = (point.Single().fMoneyPoint) + a.fPrice;
                CMember cm1    = new CMember();
                cm1.fMemberId = point.Single().fMemberId;
                CMemberFactory.fn會員更新點數(cm1, point1);

                var t = CNoteFactory.fn私人筆記全部查詢().Where(q => q.fFolderId == f.Single().fFolderId).ToList();

                int t1 = t.Count();

                CNote n = new CNote();
                n.fNoteListName     = a.fName;
                n.fCreateDateTime   = DateTime.UtcNow.AddHours(08);
                n.fEditDateTime     = DateTime.UtcNow.AddHours(08);
                n.fNoteListLevel    = t1;
                n.fIsMyFavourite    = false;
                n.fIsTrash          = false;
                n.fFolderId         = f.Single().fFolderId;
                n.fJsonContent      = a.fContent;
                n.fTheShareLink     = null;
                n.fTheContactPerson = null;
                n.fHTMLContent      = "";
                CNoteFactory.fn訂單私人筆記新增(n);
            }

            CCartFactory.fn購物車個人更新(cartId);
        }