示例#1
0
        public DataSet getShopListByAddressId(int aid, int sid, int did, string orderType)
        {
            ShopsBLL bll = new ShopsBLL();
            DataSet  ds  = null;

            if (did > 0)
            {
                ds = bll.GetListByDistrictId(did);  //根据楼宇搜索
            }
            else if (sid > 0)
            {
                ds = bll.GetListByStreetId(sid);    //根据街道搜索
            }
            else
            {
                ds = bll.GetListByAreaIdSort(aid, orderType); //搜索所有的数据
            }
            foreach (DataTable dt in ds.Tables)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    foreach (DataColumn dc in dt.Columns)
                    {
                        return(ds);
                    }
                }
            }

            return(null);
        }
示例#2
0
        private void PageInit()
        {
            decimal decSum = 0;

            if (Session["ShoppingCart"] != null)
            {
                List <Cart> list = (List <Cart>)Session["ShoppingCart"];
                shopid = list[0].ShopID;
                Shop shopinfo = new ShopsBLL().GetShopItem(list[0].ShopID);
                L_ShopName.Text     = shopinfo.ShopName;
                hiddenshoptel.Value = shopinfo.Phone;

                foreach (Cart item in list)
                {
                    decSum += item.SumPrice;
                }
                //绑定购物车
                rpt_list.DataSource = list;
                rpt_list.DataBind();

                //UserInfo uinfo = ubll.GetUserByID(list[0].UserID);
                UserInfo    uinfo       = Session["cudoUser"] as UserInfo;
                UserAddress userAddress = Session["selectAddress"] as UserAddress;
                L_Mobile.Text   = uinfo.Mobile;
                L_Name.Text     = userAddress.UserName;
                hiddenaid.Value = userAddress.Address.Split('|')[0].Split(',')[2];
                L_Address.Text  = userAddress.Address.Split('|')[1];
            }
        }
示例#3
0
 public ActionResult AllotAdmit(int id)
 {
     UsersBLL usreBll = new UsersBLL();
     string loginName = Request.Form["U_LoginName"];
     int S_ID = Convert.ToInt32(Request.Form["S_ID"]);
     ShopsBLL shopBll = new ShopsBLL();
     Shops s = shopBll.SelectWhere(m => m.S_ID == S_ID).FirstOrDefault();
     Users u = new Users();
     try
     {
         using (TransactionScope ts = new TransactionScope())
         {
             u.U_LoginName = loginName;
             u.U_Password = "******";
             u.S_ID = S_ID;
             u.U_Role = 2;
             s.S_IsHasSetAdmin = true;
             shopBll.SaveChanges();
             usreBll.Add(u);
             usreBll.SaveChanges();
             ts.Complete();
         }
         return Json(new { result = "ok" });
     }
     catch
     {
         return Json(new { result = "error" });
     }
 }
示例#4
0
        public DataSet getShopList(string sortType)
        {
            ShopsBLL bll = new ShopsBLL();
            DataSet  ds  = bll.GetListByAreaId(0);

            return(ds);
        }
示例#5
0
        private void PageInit()
        {
            UserInfo item = Session["cudoUser"] as UserInfo;

            Shop shopitem = new ShopsBLL().GetShopItem(item.ShopId);

            if (shopitem != null)
            {
                shopname.Value = shopitem.ShopName;
                address.Value  = shopitem.Address;
                phone.Value    = shopitem.Phone;
                intro.Value    = shopitem.Intro;
            }
        }
示例#6
0
 public ActionResult Create(Shops shop)
 {
     try
     {
         ShopsBLL db = new ShopsBLL();
         shop.S_CreateTime = DateTime.Now;
         shop.S_IsHasSetAdmin = false;
         db.Add(shop);
         db.SaveChanges();
         return Json(new { result = "ok" });
     }
     catch
     {
         return Json(new { result = "error" });
     }
 }
示例#7
0
        protected void btnSend_Click(object sender, EventArgs e)
        {
            StringBuilder    str      = new StringBuilder(); //餐品内容
            OrderInfo        item     = new OrdersBLL().GetItem(orderno);
            Shop             shopinfo = new ShopsBLL().GetShopItem(item.ShopId);
            List <OrderItem> list     = new OrderItemBLL().GetList(orderno);

            foreach (OrderItem temp in list)
            {
                str.Append(temp.ProductName + "(" + temp.BuyNum + ") ");
            }
            string contentstr = Server.UrlEncode(shopinfo.ShopName + ":" + str.ToString() + ";合" + item.TotalPrice + "元;电话" + shopinfo.Phone);
            string sendurl    = "http://www.ums86.com:8899/sms/Api/Send.do?SpCode=001418&LoginName=fz_lx&Password=lx6856&MessageContent=" + contentstr + "&UserNumber=" + item.UserTel + "&SerialNumber=&ScheduleTime=&f=1";

            GetHtmlFromUrl(sendurl);

            Response.Write("<script>window.parent.tb_remove();</script>");
        }
示例#8
0
        protected string CheckShopTime(HttpContext context, int shopid)
        {
            string strResult = string.Empty;
            Shop   item      = new ShopsBLL().GetShopItem(shopid);

            string[] ordertime = item.OrderTime.Split('|');
            if (ordertime[0].Trim() == "" && ordertime[1].Trim() == "")
            {
                strResult = "{\"types\":\"1\",\"msg\":\"\"}";
            }
            else
            {
                DateTime nowtime = DateTime.Now;
                int      result1 = 0, result2 = 0;
                if (ordertime[0].Trim() != "")
                {
                    string[] timelist = ordertime[0].Split('-');
                    if (DateTime.Compare(nowtime, Convert.ToDateTime(timelist[0])) >= 0 && DateTime.Compare(nowtime, Convert.ToDateTime(timelist[1])) <= 0)
                    {
                        //在时间段里面
                        result1 = 1;
                    }
                }
                if (ordertime[1].Trim() != "")
                {
                    string[] timelist = ordertime[1].Split('-');
                    if (DateTime.Compare(nowtime, Convert.ToDateTime(timelist[0])) >= 0 && DateTime.Compare(nowtime, Convert.ToDateTime(timelist[1])) <= 0)
                    {
                        //在时间段里面
                        result2 = 1;
                    }
                }
                if (result1 == 0 && result2 == 0)
                {
                    strResult = "{\"types\":\"0\",\"msg\":\"非网络订餐时段,请自行电话订餐!\"}";
                }
                else
                {
                    strResult = "{\"types\":\"1\",\"msg\":\"\"}";
                }
            }
            return(strResult);
        }
示例#9
0
        private void PageInit()
        {
            UserInfo item     = Session["cudoUser"] as UserInfo;
            Shop     shopitem = new ShopsBLL().GetShopItem(item.ShopId);

            if (shopitem != null)
            {
                string[] ordertime = shopitem.OrderTime.Split('|');
                opentime.Value       = shopitem.OpenTime;
                amtime.Value         = ordertime[0];
                pmtime.Value         = ordertime[1];
                sendlimitprice.Value = shopitem.LimitPrice.ToString();
                sendprice.Value      = shopitem.SendPrice.ToString();
                sendtime.Value       = shopitem.SendTime.ToString();
            }

            rpt_shoparealist.DataSource = bll.GetListByShopId(item.ShopId);
            rpt_shoparealist.DataBind();

            AreaInit();
        }
示例#10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //*判断卖家是否是第一次登陆,
                //将卖家信息写入DB
                if (!Page.IsPostBack)
                {
                    //初始化买家会员级别
                    DataTable tbbuyerlevel = ShopsBLL.GetBuyerGrade(Users.Nick);
                    if (tbbuyerlevel != null)
                    {
                        lbQianZai.Text      = tbbuyerlevel.Rows[0]["grade"].ToString();
                        lbCommonBuyer.Text  = tbbuyerlevel.Rows[1]["grade"].ToString();
                        lbAdvanceBuyer.Text = tbbuyerlevel.Rows[2]["grade"].ToString();
                        lbVIP.Text          = tbbuyerlevel.Rows[3]["grade"].ToString();
                        lbTopVIP.Text       = tbbuyerlevel.Rows[4]["grade"].ToString();
                    }
                    else
                    {
                        lbQianZai.Text      = "0";
                        lbCommonBuyer.Text  = "0";
                        lbAdvanceBuyer.Text = "0";
                        lbVIP.Text          = "0";
                        lbTopVIP.Text       = "0";
                    }

                    //从数据库读取最近30天活跃会员总金额排行榜
                    grdTopBuyerTradeAmount.DataSource = null;
                    grdTopBuyerTradeAmount.DataBind();
                    //获取销量最好的前10条宝贝
                    grdTopSales.DataSource = SellersBLL.GetTop10Sales(Users.Nick);
                    grdTopSales.DataBind();
                    //获取店铺统计信息
                    DataTable tbsellerStatic = ShopsBLL.GetShopeInfoStatic(Users.Nick);
                    if (tbsellerStatic != null)
                    {
                        lbTotalSales.Text = "¥" + tbsellerStatic.Rows[0]["Result_Flag"].ToString();
                        var orderCount = tbsellerStatic.Rows[1]["Result_Flag"].ToString();
                        lbOrderCount.Text = orderCount.Substring(0, orderCount.Length - 3);
                        var userCount = tbsellerStatic.Rows[2]["Result_Flag"].ToString();
                        lbUserCount.Text = userCount.Substring(0, userCount.Length - 3);
                        var orderPrice = tbsellerStatic.Rows[3]["Result_Flag"].ToString();
                        lbPerOrderPirce.Text = "¥" + orderPrice.Substring(0, orderPrice.Length - 3);

                        var newUserOrderCount = tbsellerStatic.Rows[4]["Result_Flag"].ToString();
                        lbNewUserOrderCount.Text = newUserOrderCount.Substring(0, newUserOrderCount.Length - 3);

                        var newBuyerCount = tbsellerStatic.Rows[4]["Result_Flag"].ToString();
                        lbNewBuyerCount.Text = newBuyerCount.Substring(0, newBuyerCount.Length - 3);
                        var refundOrderCount = tbsellerStatic.Rows[5]["Result_Flag"].ToString();
                        lbRefundOrderCount.Text = refundOrderCount.Substring(0, refundOrderCount.Length - 3);
                        var qianzaiBuyerCount = tbsellerStatic.Rows[6]["Result_Flag"].ToString();
                        QianZaiBuyerCount.Text = qianzaiBuyerCount.Substring(0, qianzaiBuyerCount.Length - 3);
                        var threeMonthsNoLoginCount = tbsellerStatic.Rows[7]["Result_Flag"].ToString();
                        lb3MonthsNoLoginCount.Text = threeMonthsNoLoginCount.Substring(0, threeMonthsNoLoginCount.Length - 3);
                        var oldBuyerCount = tbsellerStatic.Rows[8]["Result_Flag"].ToString();
                        if (oldBuyerCount.Length > 0)
                        {
                            lbOldBuyerCount.Text = oldBuyerCount.Substring(0, oldBuyerCount.Length - 3);
                        }
                        else
                        {
                            lbOldBuyerCount.Text = "0";
                        }
                    }
                    else
                    {
                        lbTotalSales.Text          = "0";
                        lbOrderCount.Text          = "0";
                        lbUserCount.Text           = "0";
                        lbPerOrderPirce.Text       = "0";
                        lbNewUserOrderCount.Text   = "0";
                        lbRefundOrderCount.Text    = "0";
                        lbNewBuyerCount.Text       = "0";
                        QianZaiBuyerCount.Text     = "0";
                        lb3MonthsNoLoginCount.Text = "0";
                        lbOldBuyerCount.Text       = "0";
                    }

                    //左上角店铺信息初始化
                    DataTable tbShop = ShopsBLL.GetSellerShopInfo(Users.Nick);
                    if (tbShop != null && tbShop.Rows.Count > 0)
                    {
                        shopImg.ImageUrl = "http://logo.taobao.com/shop-logo" + tbShop.Rows[0]["pic_path"].ToString().Trim();
                        lbNickName.Text  = Users.Nick;
                        string shopName = tbShop.Rows[0]["title"].ToString().Trim();
                        if (shopName.Length > 10)
                        {
                            shopName = shopName.Substring(0, shopName.Length - 1) + "...";
                        }
                        lbShopName.Text     = shopName;
                        Session["ShopName"] = lbShopName.Text;
                        //订购服务到期时间
                        //ArticleUserSubscribe userSub = Users.GetDeadLineDate("ts-1811102", Users.Nick);
                        lbUptoDate.Text = "";    //userSub == null ? DateTime.Now.AddMonths(1).ToShortDateString() : Convert.ToDateTime(userSub.Deadline).ToShortDateString();
                    }
                    DataTable tb = MsgBLL.GetSellerMsgStatus(Users.Nick);
                    if (tb != null && tb.Rows.Count > 0)
                    {
                        lbUnUseMsgCount.Text = tb.Rows[0]["msgCanUseCount"].ToString() + "条";
                    }
                    else
                    {
                        lbUnUseMsgCount.Text = "0条";
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Web_UI);
            }
        }
示例#11
0
        public ActionResult Delete(int id)
        {
            try
            {
                ShopsBLL spBll = new ShopsBLL(); UsersBLL uBll = new UsersBLL();

                Shops shop = spBll.Find(id);
                Users user = uBll.SelectWhere(m => m.S_ID == shop.S_ID && m.U_Role == 2).FirstOrDefault();
                using (TransactionScope ts = new TransactionScope())
                {
                    // 软删除当前店铺的管理员
                    if (user != null)
                    {
                        user.U_Role = 4;
                        uBll.SaveChanges();
                    }
                    shop.S_Category = 4;
                    spBll.SaveChanges();
                    ts.Complete();
                }
                return Json(new { result = "ok" });
            }
            catch
            {
                return Json(new { result = "error" });
            }
        }
示例#12
0
        public ActionResult Index(int id)
        {
            int pageIndex = 0, pageSize = 0;
            if (!string.IsNullOrEmpty(Request.Form["rows"]))
            {
                pageSize = Convert.ToInt32(Request.Form["rows"]);
            }
            if (!string.IsNullOrEmpty(Request.Form["page"]))
            {
                pageIndex = Convert.ToInt32(Request.Form["page"]);
            }

            string S_Name = Request.Form["S_Name"];
            string S_ContactName = Request.Form["S_ContactName"];
            string S_Address = Request.Form["S_Address"];

            int totalRow; var pagelist = new ShopsBLL().GetShops(pageIndex, pageSize, S_Name, S_ContactName, S_Address, out totalRow);
            return Json(new { total = totalRow, rows = pagelist }, JsonRequestBehavior.AllowGet);
        }
示例#13
0
 public ActionResult Edit(Shops shop)
 {
     try
     {
         ShopsBLL db = new ShopsBLL();
         db.Edit(shop, "S_Name", "S_Category", "S_ContactName", "S_ContactTel", "S_Address", "S_Remark");
         db.SaveChanges();
         return Json(new { result = "ok" });
     }
     catch
     {
         return Json(new { result = "error" });
     }
 }
示例#14
0
 /// <summary>
 /// 修改类型绑定
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public ActionResult Edit(int id)
 {
     Shops shop = new ShopsBLL().Find(id);
     CategoryItemsBLL CategoryItemsBLL = new BLL.CategoryItemsBLL();
     var type = CategoryItemsBLL.SelectWhere(m => m.C_Category == "S_Category");
     ViewBag.S_Category = new SelectList(type, "CI_ID", "CI_Name", shop.S_Category);
     return View(shop);
 }