Ejemplo n.º 1
0
 protected override void AttachChildControls()
 {
     this.inputPaymentModeId      = (HtmlInputHidden)this.FindControl("inputPaymentModeId");
     this.inputShippingModeId     = (HtmlInputHidden)this.FindControl("inputShippingModeId");
     this.hidPaymentId_Podrequest = (HtmlInputHidden)this.FindControl("hidPaymentId_Podrequest");
     this.hidGetgoodsOnStores     = (HtmlInputHidden)this.FindControl("hidGetgoodsOnStores");
     this.hidDeliveryTime         = (HtmlInputHidden)this.FindControl("hidDeliveryTime");
     this.hidStoreId       = (HtmlInputHidden)this.FindControl("hidStoreId");
     this.hidShipAddressId = (HtmlInputHidden)this.FindControl("hidShipAddressId");
     this.rptStores        = (AppshopTemplatedRepeater)this.FindControl("rptStores");
     if (!this.Page.IsPostBack)
     {
         this.hidGetgoodsOnStores.Value     = "false";
         this.hidPaymentId_Podrequest.Value = "0";
         int num = 0;
         if (this.from != "countdown" && this.from != "groupbuy" && SalesHelper.IsSupportPodrequest())
         {
             num = 1;
             this.hidPaymentId_Podrequest.Value = "1";
         }
         if (this.paymentModeId != 0 && this.paymentModeId != num && this.paymentModeId != -3)
         {
             this.paymentModeId = 0;
         }
         this.hidDeliveryTime.Value     = this.deliveryTime;
         this.inputPaymentModeId.Value  = this.paymentModeId.ToString();
         this.inputShippingModeId.Value = this.shippingModeId.ToString();
         this.hidStoreId.Value          = this.storeId.ToString();
         int shipAddressId = 0;
         int.TryParse(this.Page.Request.QueryString["ShipAddressId"].ToNullString(), out shipAddressId);
         IList <ShippingAddressInfo> shippingAddresses = MemberProcessor.GetShippingAddresses(false);
         int num2 = 0;
         IList <ShippingAddressInfo> list = new List <ShippingAddressInfo>();
         ShippingAddressInfo         shippingAddressInfo = null;
         string address = "";
         if (shipAddressId > 0)
         {
             shippingAddressInfo = shippingAddresses.FirstOrDefault((ShippingAddressInfo a) => a.ShippingId == shipAddressId);
             if (shippingAddressInfo != null)
             {
                 num2    = shippingAddressInfo.RegionId;
                 address = shippingAddressInfo.FullAddress;
             }
         }
         else if (shippingAddresses != null && shippingAddresses.Count > 0)
         {
             num2 = shippingAddresses.FirstOrDefault().RegionId;
         }
         this.hidShipAddressId.Value = shipAddressId.ToString();
         StoresQuery storesQuery = new StoresQuery();
         storesQuery.RegionID    = num2;
         storesQuery.RegionName  = RegionHelper.GetFullRegion(num2, " ", true, 0);
         storesQuery.State       = 1;
         storesQuery.CloseStatus = 1;
         DataTable storeList = StoresHelper.GetStoreList(this.newProductSku, num2, address, this.buyAmount);
         this.rptStores.DataSource = storeList;
         this.rptStores.DataBind();
         PageTitle.AddSiteNameTitle("门店选择");
     }
 }
Ejemplo n.º 2
0
        private StoresQuery getQuery(HttpContext context)
        {
            int num  = 1;
            int num2 = 10;

            num = base.GetIntParam(context, "page", false).Value;
            if (num < 1)
            {
                num = 1;
            }
            num2 = base.GetIntParam(context, "rows", false).Value;
            if (num2 < 1)
            {
                num2 = 10;
            }
            StoresQuery storesQuery = new StoresQuery();

            storesQuery.UserName  = context.Request["UserName"];
            storesQuery.StoreName = context.Request["StoreName"];
            storesQuery.StoreName = storesQuery.StoreName.Trim();
            storesQuery.SortOrder = SortAction.Desc;
            storesQuery.PageIndex = num;
            storesQuery.PageSize  = num2;
            return(storesQuery);
        }
Ejemplo n.º 3
0
        public StoresQuery GetDataQuery(HttpContext context)
        {
            StoresQuery storesQuery = new StoresQuery();
            int         num         = 1;
            int         num2        = 10;

            num = base.GetIntParam(context, "page", false).Value;
            if (num < 1)
            {
                num = 1;
            }
            num2 = base.GetIntParam(context, "rows", false).Value;
            if (num2 < 1)
            {
                num2 = 10;
            }
            storesQuery.UserName  = context.Request["UserName"];
            storesQuery.StoreName = context.Request["StoreName"];
            if (!string.IsNullOrEmpty(context.Request["RegionId"]))
            {
                int num3 = context.Request["RegionID"].ToInt(0);
                storesQuery.RegionID   = num3;
                storesQuery.RegionName = RegionHelper.GetFullRegion(num3, " ", true, 0);
            }
            if (!string.IsNullOrEmpty(context.Request["tagId"]))
            {
                storesQuery.tagId = context.Request["tagId"].ToInt(0);
            }
            storesQuery.SortOrder = SortAction.Desc;
            storesQuery.PageIndex = num;
            storesQuery.PageSize  = num2;
            return(storesQuery);
        }
Ejemplo n.º 4
0
        private void GetList(HttpContext context)
        {
            StoresQuery dataQuery = this.GetDataQuery(context);
            DataGridViewModel <Dictionary <string, object> > dataList = this.GetDataList(dataQuery);
            string s = base.SerializeObjectToJson(dataList);

            context.Response.Write(s);
            context.Response.End();
        }
Ejemplo n.º 5
0
        private void GetList(HttpContext context)
        {
            StoresQuery query = this.getQuery(context);
            MemberDetailsModel <Dictionary <string, object> > dataList = this.GetDataList(query);
            string s = base.SerializeObjectToJson(dataList);

            context.Response.Write(s);
            context.Response.End();
        }
Ejemplo n.º 6
0
        public void ExportToExcel(HttpContext context)
        {
            StoresQuery         dataQuery       = this.GetDataQuery(context);
            IList <StoresModel> storeExportData = ManagerHelper.GetStoreExportData(dataQuery);
            StringBuilder       stringBuilder   = new StringBuilder();

            stringBuilder.Append("<table border='1'>");
            stringBuilder.Append("<thead><tr>");
            stringBuilder.Append("<th>门店名称</th>");
            stringBuilder.Append("<th>抽佣比例</th>");
            stringBuilder.Append("<th>用户名</th>");
            stringBuilder.Append("<th>联系人</th>");
            stringBuilder.Append("<th>联系电话</th>");
            stringBuilder.Append("<th>所在区域</th>");
            stringBuilder.Append("<th>详细地址</th>");
            stringBuilder.Append("<th>门店标签</th>");
            stringBuilder.Append("<th>配送方式</th>");
            stringBuilder.Append("<th>营业时间</th>");
            stringBuilder.Append("<th>门店LOGO</th>");
            stringBuilder.Append("</tr></thead>");
            StringBuilder stringBuilder2 = new StringBuilder();
            DateTime      dateTime;

            foreach (StoresModel item in storeExportData)
            {
                stringBuilder2.Append("<tr>");
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.StoreName, true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.CommissionRate + "%", false));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.UserName, true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.ContactMan, true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.Tel, false));
                string fullRegion = RegionHelper.GetFullRegion(item.RegionId, " ", true, 0);
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(fullRegion, true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(fullRegion + " " + item.Address, true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.TagsName, true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.DeliveryTypes, true));
                StringBuilder stringBuilder3 = stringBuilder2;
                dateTime = item.OpenStartDate;
                string str = dateTime.ToString("HH:mm:ss");
                dateTime = item.OpenEndDate;
                stringBuilder3.Append(ExcelHelper.GetXLSFieldsTD(str + "-" + dateTime.ToString("HH:mm:ss"), true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(Globals.FullPath(item.StoreImages), true));
                stringBuilder2.Append("</tr>");
            }
            stringBuilder.AppendFormat("<tbody>{0}</tbody></table>", stringBuilder2.ToString());
            StringWriter stringWriter = new StringWriter();

            stringWriter.Write(stringBuilder);
            HttpResponse  response       = context.Response;
            StringBuilder stringBuilder4 = stringWriter.GetStringBuilder();

            dateTime = DateTime.Now;
            DownloadHelper.DownloadFile(response, stringBuilder4, "StoreList" + dateTime.ToString("yyyyMMddhhmmss") + ".xls");
            stringWriter.Close();
            context.Response.End();
        }
Ejemplo n.º 7
0
        private MemberDetailsModel <Dictionary <string, object> > GetDataList(StoresQuery query)
        {
            MemberDetailsModel <Dictionary <string, object> > memberDetailsModel = new MemberDetailsModel <Dictionary <string, object> >();

            if (query != null)
            {
                DbQueryResult storeExpand = StoresHelper.GetStoreExpand(query);
                memberDetailsModel.rows  = DataHelper.DataTableToDictionary(storeExpand.Data);
                memberDetailsModel.total = storeExpand.TotalRecords;
            }
            return(memberDetailsModel);
        }
Ejemplo n.º 8
0
        public static IList <StoresInfo> GetCanShipStores(int regionId, bool isAutoAllot = false)
        {
            StoresQuery storesQuery = new StoresQuery();

            storesQuery.RegionID    = regionId;
            storesQuery.RegionPath  = RegionHelper.GetFullPath(regionId, true);
            storesQuery.State       = 1;
            storesQuery.CloseStatus = 1;
            if (isAutoAllot)
            {
                storesQuery.StoreIsDeliver = true;
            }
            return(new StoresDao().GetStoreList(storesQuery));
        }
Ejemplo n.º 9
0
        private DataGridViewModel <Dictionary <string, object> > GetDataList(StoresQuery query)
        {
            DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >();

            if (query != null)
            {
                DbQueryResult storeManagers = ManagerHelper.GetStoreManagers(query);
                dataGridViewModel.rows  = DataHelper.DataTableToDictionary(storeManagers.Data);
                dataGridViewModel.total = storeManagers.TotalRecords;
                foreach (Dictionary <string, object> row in dataGridViewModel.rows)
                {
                    ManagerInfo managerInfo = row.ToObject <ManagerInfo>();
                    row.Add("StoreDeliveryScop", ManagerHelper.GetStoreDeliveryScop(managerInfo.StoreId));
                }
            }
            return(dataGridViewModel);
        }
Ejemplo n.º 10
0
 private void ExportToExcel(HttpContext context)
 {
     try
     {
         StoresQuery query = this.getQuery(context);
         query.PageIndex = 1;
         query.PageSize  = 2147483647;
         DbQueryResult storeExpand   = StoresHelper.GetStoreExpand(query);
         StringBuilder stringBuilder = new StringBuilder();
         stringBuilder.AppendLine("<table cellspacing=\"0\" cellpadding=\"5\" rules=\"all\" border=\"1\">");
         stringBuilder.AppendLine("<tr style=\"font-weight: bold; white-space: nowrap;\">");
         stringBuilder.AppendLine("<td>门店</td>");
         stringBuilder.AppendLine("<td>店员数</td>");
         stringBuilder.AppendLine("<td>累计发展会员数</td>");
         stringBuilder.AppendLine("<td>累计会员消费</td>");
         stringBuilder.AppendLine("<td>累计发展会员订单数</td>");
         stringBuilder.AppendLine("</tr>");
         DataTable data = storeExpand.Data;
         foreach (DataRow row in data.Rows)
         {
             stringBuilder.AppendLine("<tr>");
             stringBuilder.AppendLine("<td>" + row.Field <string>("StoreName") + "</td>");
             stringBuilder.AppendLine("<td>" + row.Field <int>("ManagerCount") + "</td>");
             stringBuilder.AppendLine("<td>" + row.Field <int>("MemberCount") + "</td>");
             stringBuilder.AppendLine("<td>" + row.Field <decimal>("ConsumeTotals").F2ToString("f2") + "</td>");
             stringBuilder.AppendLine("<td>" + row.Field <int>("OrderNumbers") + "</td>");
             stringBuilder.AppendLine("</tr>");
         }
         stringBuilder.AppendLine("<tr>");
         stringBuilder.AppendLine("<td></td>");
         stringBuilder.AppendLine("</tr>");
         stringBuilder.AppendLine("</table>");
         context.Response.Clear();
         context.Response.Buffer  = false;
         context.Response.Charset = "GB2312";
         context.Response.AppendHeader("Content-Disposition", "attachment;filename=StoresExpand_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls");
         context.Response.ContentEncoding = Encoding.GetEncoding("GB2312");
         context.Response.ContentType     = "application/ms-excel";
         context.Response.Write(stringBuilder.ToString());
         context.Response.End();
     }
     catch (Exception)
     {
         throw new HidistroAshxException("导出数据错误");
     }
 }
Ejemplo n.º 11
0
        protected void btnImportToStore_Click(object sender, EventArgs e)
        {
            StoresQuery storesQuery = new StoresQuery();

            storesQuery.PageIndex = 1;
            storesQuery.PageSize  = 2147483647;
            try
            {
                DbQueryResult storeManagers = ManagerHelper.GetStoreManagers(storesQuery);
                DataTable     data          = storeManagers.Data;
                foreach (DataRow row in data.Rows)
                {
                    int storeId = row["StoreId"].ToInt(0);
                    StoresHelper.ImportAllProductToAllStores(storeId);
                }
                this.ShowMsg("同步完成", true);
            }
            catch (Exception)
            {
                this.ShowMsg("同步失败,请重试", true);
            }
        }
Ejemplo n.º 12
0
        private DataGridViewModel <Dictionary <string, object> > GetDataList(HttpContext context)
        {
            DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >();
            string storeName = string.Empty;
            string empty     = string.Empty;

            empty = context.Request["StoreName"];
            if (!string.IsNullOrEmpty(empty))
            {
                storeName = empty;
            }
            StoresQuery storesQuery = new StoresQuery();

            storesQuery.StoreName = storeName;
            storesQuery.PageIndex = base.CurrentPageIndex;
            storesQuery.PageSize  = base.CurrentPageSize;
            DbQueryResult storeManagersHiPOS = ManagerHelper.GetStoreManagersHiPOS(storesQuery);

            dataGridViewModel.rows  = DataHelper.DataTableToDictionary(storeManagersHiPOS.Data);
            dataGridViewModel.total = storeManagersHiPOS.TotalRecords;
            return(dataGridViewModel);
        }
Ejemplo n.º 13
0
 public static DbQueryResult GetStoreManagersHiPOS(StoresQuery query)
 {
     return(new StoresDao().GetStoreManagersHiPOS(query));
 }
Ejemplo n.º 14
0
 public static IList <StoresModel> GetStoreExportData(StoresQuery query)
 {
     return(new StoresDao().GetStoreExportData(query));
 }