Example #1
0
        private ReplaceApplyQuery GetReplaceQuery()
        {
            ReplaceApplyQuery replaceApplyQuery = new ReplaceApplyQuery();

            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["OrderId"]))
            {
                replaceApplyQuery.OrderId = Globals.UrlDecode(this.Page.Request.QueryString["OrderId"]);
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["HandleStatus"]))
            {
                int num = 0;
                if (int.TryParse(this.Page.Request.QueryString["HandleStatus"], out num) && num > -1)
                {
                    replaceApplyQuery.HandleStatus = new int?(num);
                }
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["StartTime"]))
            {
                replaceApplyQuery.StratTime = this.Page.Request.QueryString["StartTime"];
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["StartTime"]))
            {
                replaceApplyQuery.EndTime = this.Page.Request.QueryString["EndtTime"];
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["Operator"]))
            {
                replaceApplyQuery.Operator = Globals.UrlDecode(this.Page.Request.QueryString["Operator"]);
            }
            replaceApplyQuery.PageIndex = this.pager.PageIndex;
            replaceApplyQuery.PageSize  = this.pager.PageSize;
            replaceApplyQuery.SortBy    = "ApplyForTime";
            replaceApplyQuery.SortOrder = SortAction.Desc;
            return(replaceApplyQuery);
        }
        private ReplaceApplyQuery GetReplaceQuery()
        {
            ReplaceApplyQuery replaceApplyQuery = new ReplaceApplyQuery();

            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["OrderId"]))
            {
                replaceApplyQuery.OrderId = Globals.UrlDecode(Globals.StripAllTags(this.Page.Request.QueryString["OrderId"]));
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["HandleStatus"]))
            {
                int num = 0;
                if (int.TryParse(this.Page.Request.QueryString["HandleStatus"], out num) && num > -1)
                {
                    replaceApplyQuery.HandleStatus = num;
                }
            }
            if (this.Page.Request.QueryString["AfterSaleId"].ToInt(0) > 0)
            {
                replaceApplyQuery.ReplaceId = this.Page.Request.QueryString["AfterSaleId"].ToInt(0);
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["productName"]))
            {
                replaceApplyQuery.ProductName = Globals.UrlDecode(Globals.StripAllTags(this.Page.Request.QueryString["productName"]));
            }
            replaceApplyQuery.PageIndex = this.pager.PageIndex;
            replaceApplyQuery.PageSize  = this.pager.PageSize;
            replaceApplyQuery.SortBy    = "ApplyForTime";
            replaceApplyQuery.SortOrder = SortAction.Desc;
            return(replaceApplyQuery);
        }
Example #3
0
        public void GetList(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;
            }
            ReplaceApplyQuery replaceApplyQuery = new ReplaceApplyQuery();

            replaceApplyQuery.OrderId      = Globals.UrlDecode(context.Request["OrderId"]);
            replaceApplyQuery.HandleStatus = base.GetIntParam(context, "HandleStatus", true);
            replaceApplyQuery.PageIndex    = num;
            replaceApplyQuery.PageSize     = num2;
            replaceApplyQuery.SortBy       = "ApplyForTime";
            replaceApplyQuery.SortOrder    = SortAction.Desc;
            DataGridViewModel <Dictionary <string, object> > dataList = this.GetDataList(replaceApplyQuery);
            string s = base.SerializeObjectToJson(dataList);

            context.Response.Write(s);
            context.Response.End();
        }
Example #4
0
        public DbQueryResult GetReplaceApplys(ReplaceApplyQuery query)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(" 1=1");
            if (!string.IsNullOrEmpty(query.OrderId))
            {
                stringBuilder.AppendFormat(" and OrderId = '{0}'", query.OrderId);
            }
            if (query.HandleStatus.HasValue)
            {
                stringBuilder.AppendFormat(" AND HandleStatus = {0}", query.HandleStatus);
            }
            if (query.UserId.HasValue)
            {
                stringBuilder.AppendFormat(" AND UserId = {0}", query.UserId.Value);
            }
            if (!string.IsNullOrEmpty(query.StratTime))
            {
                stringBuilder.AppendFormat(" and ApplyForTime>='{0}'", query.StratTime);
            }
            if (!string.IsNullOrEmpty(query.EndTime))
            {
                stringBuilder.AppendFormat(" and ApplyForTime<='{0} 23:59:59'", query.EndTime.Trim());
            }
            if (!string.IsNullOrEmpty(query.Operator))
            {
                stringBuilder.AppendFormat(" AND Operator LIKE '%{0}%'", DataHelper.CleanSearchString(query.Operator));
            }

            return(DataHelper.PagingByRownumber(query.PageIndex, query.PageSize, query.SortBy, query.SortOrder, query.IsCount, "vw_Ecshop_OrderReplace", "ReplaceId", stringBuilder.ToString(), "*"));
        }
Example #5
0
        public IList <ReplaceInfo> GetReplaceApplysNoPage(ReplaceApplyQuery query)
        {
            query.OrderId = base.GetTrueOrderId(query.OrderId);
            IList <ReplaceInfo> result        = new List <ReplaceInfo>();
            StringBuilder       stringBuilder = new StringBuilder();

            stringBuilder.Append(" 1=1");
            if (!string.IsNullOrEmpty(query.OrderId))
            {
                stringBuilder.AppendFormat(" and OrderId = '{0}'", query.OrderId);
            }
            if (query.SupplierId.HasValue)
            {
                if (query.SupplierId == -1)
                {
                    stringBuilder.Append(" AND SupplierId > 0 ");
                }
                else
                {
                    stringBuilder.AppendFormat(" AND SupplierId = {0} ", query.SupplierId.Value);
                }
            }
            else if (query.UserId.ToInt(0) <= 0)
            {
                stringBuilder.Append(" and ISNULL(SupplierId,0)=0 ");
            }
            if (query.HandleStatus.HasValue)
            {
                stringBuilder.AppendFormat(" AND HandleStatus = {0}", query.HandleStatus);
            }
            if (query.UserId.HasValue)
            {
                stringBuilder.AppendFormat(" AND UserId = {0}", query.UserId.Value);
            }
            if (query.StoreId.HasValue && query.StoreId > 0)
            {
                stringBuilder.AppendFormat(" AND StoreId = {0}", query.StoreId.Value);
            }
            if (query.ReplaceId.HasValue)
            {
                stringBuilder.AppendFormat(" AND ReplaceId = {0}", query.ReplaceId.Value);
            }
            if (!string.IsNullOrEmpty(query.ProductName))
            {
                stringBuilder.AppendFormat(" AND ShopName LIKE '%{0}%'", query.ProductName);
            }
            if (!string.IsNullOrEmpty(query.ReplaceIds))
            {
                stringBuilder.Append($" AND ReplaceId IN({query.ReplaceIds}) ");
            }
            DbCommand sqlStringCommand = base.database.GetSqlStringCommand("SELECT * FROM vw_Hishop_OrderReplace WHERE " + stringBuilder.ToString());

            using (IDataReader objReader = base.database.ExecuteReader(sqlStringCommand))
            {
                result = DataHelper.ReaderToList <ReplaceInfo>(objReader);
            }
            return(result);
        }
Example #6
0
        private void GetlistReplace(HttpContext context)
        {
            int               num               = 1;
            int               num2              = 10;
            string            empty             = string.Empty;
            int?              nullable          = null;
            string            empty2            = string.Empty;
            ReplaceApplyQuery replaceApplyQuery = new ReplaceApplyQuery();

            empty2 = context.Request["OrderId"];
            empty  = context.Request["HandleStatus"];
            if (!string.IsNullOrWhiteSpace(empty) && !string.IsNullOrWhiteSpace(empty))
            {
                try
                {
                    nullable = int.Parse(empty);
                    if (nullable > -1)
                    {
                        nullable = ((nullable == 0) ? new int?(4) : nullable);
                    }
                }
                catch
                {
                    nullable = null;
                }
            }
            num = base.GetIntParam(context, "page", false).Value;
            if (num < 1)
            {
                num = 1;
            }
            num2 = base.GetIntParam(context, "rows", false).Value;
            if (num2 < 1)
            {
                num2 = 10;
            }
            replaceApplyQuery.SupplierId   = HiContext.Current.Manager.StoreId;
            replaceApplyQuery.PageIndex    = num;
            replaceApplyQuery.PageSize     = num2;
            replaceApplyQuery.OrderId      = empty2;
            replaceApplyQuery.HandleStatus = nullable;
            DataGridViewModel <ReplaceInfo> replaceOrder = this.GetReplaceOrder(replaceApplyQuery);
            List <ReplaceInfo> list = new List <ReplaceInfo>();

            foreach (ReplaceInfo row in replaceOrder.rows)
            {
                row.ReplaceStatusStr = this.GetReplaceStatus((int)row.HandleStatus);
                row.handleTimeStr    = this.GetHandleTime(row);
                row.OperText         = this.GetOperText(row.HandleStatus);
                list.Add(row);
            }
            replaceOrder.rows = list;
            string s = JsonConvert.SerializeObject(replaceOrder);

            context.Response.Write(s);
            context.Response.End();
        }
Example #7
0
        public void GetList(HttpContext context)
        {
            ReplaceApplyQuery dataQuery = this.GetDataQuery(context);
            DataGridViewModel <Dictionary <string, object> > dataList = this.GetDataList(dataQuery);
            string s = base.SerializeObjectToJson(dataList);

            context.Response.Write(s);
            context.Response.End();
        }
Example #8
0
        private void GetList(HttpContext context)
        {
            int               pageIndex         = 1;
            int               pageSize          = 10;
            string            empty             = string.Empty;
            ReplaceApplyQuery replaceApplyQuery = new ReplaceApplyQuery();

            if (!string.IsNullOrEmpty(context.Request["OrderId"]))
            {
                replaceApplyQuery.OrderId = Globals.UrlDecode(context.Request["OrderId"]);
            }
            empty = context.Request["HandleStatus"];
            if (!string.IsNullOrWhiteSpace(empty))
            {
                int value = base.GetIntParam(context, "HandleStatus", false).Value;
                if (value > -1)
                {
                    replaceApplyQuery.HandleStatus = value;
                }
            }
            empty = context.Request["page"];
            if (!string.IsNullOrWhiteSpace(empty))
            {
                try
                {
                    pageIndex = int.Parse(empty);
                }
                catch
                {
                    pageIndex = 1;
                }
            }
            empty = context.Request["rows"];
            if (!string.IsNullOrWhiteSpace(empty))
            {
                try
                {
                    pageSize = int.Parse(empty);
                }
                catch
                {
                    pageSize = 10;
                }
            }
            replaceApplyQuery.PageIndex  = pageIndex;
            replaceApplyQuery.PageSize   = pageSize;
            replaceApplyQuery.StoreId    = base.CurrentManager.StoreId;
            replaceApplyQuery.SupplierId = 0;
            replaceApplyQuery.SortBy     = "ApplyForTime";
            replaceApplyQuery.SortOrder  = SortAction.Desc;
            DataGridViewModel <ReplaceInfo> dataList = this.GetDataList(replaceApplyQuery);
            string s = base.SerializeObjectToJson(dataList);

            context.Response.Write(s);
            context.Response.End();
        }
        private ReplaceApplyQuery GetReplaceQuery()
        {
            ReplaceApplyQuery replaceApplyQuery = new ReplaceApplyQuery();

            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["OrderId"]))
            {
                replaceApplyQuery.OrderId = Globals.UrlDecode(this.Page.Request.QueryString["OrderId"]);
            }
            replaceApplyQuery.SortBy = "ApplyForTime";
            return(replaceApplyQuery);
        }
Example #10
0
        public DataGridViewModel <ReplaceInfo> GetReplaceOrder(ReplaceApplyQuery query)
        {
            DataGridViewModel <ReplaceInfo> dataGridViewModel = new DataGridViewModel <ReplaceInfo>();

            if (query != null)
            {
                PageModel <ReplaceInfo> replaceApplys = OrderHelper.GetReplaceApplys(query);
                dataGridViewModel.rows  = replaceApplys.Models.ToList();
                dataGridViewModel.total = replaceApplys.Total;
            }
            return(dataGridViewModel);
        }
Example #11
0
        private void BindReplace()
        {
            ReplaceApplyQuery replaceQuery = this.ReplaceApplyQuery();

            replaceQuery.UserId = new int?(HiContext.Current.User.UserId);
            //DbQueryResult refundApplys = TradeHelper.GetReplaceApplys(replaceQuery);
            //this.rptApply.DataSource = refundApplys.Data;


            this.rptApply.DataSource = TradeHelper.NewGetReplaceApplys(replaceQuery);
            this.rptApply.DataBind();
        }
Example #12
0
        public void ExportToExcel(HttpContext context)
        {
            ReplaceApplyQuery replaceApplyQuery = new ReplaceApplyQuery();

            replaceApplyQuery.ReplaceIds   = context.Request["Ids"].ToNullString();
            replaceApplyQuery.SupplierId   = 0;
            replaceApplyQuery.OrderId      = Globals.UrlDecode(context.Request["OrderId"]);
            replaceApplyQuery.HandleStatus = base.GetIntParam(context, "HandleStatus", true);
            replaceApplyQuery.SortBy       = "ApplyForTime";
            replaceApplyQuery.SortOrder    = SortAction.Desc;
            IList <ReplaceInfo> replaceApplysNoPage = OrderHelper.GetReplaceApplysNoPage(replaceApplyQuery);
            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("</tr></thead>");
            StringBuilder stringBuilder2 = new StringBuilder();

            foreach (ReplaceInfo item in replaceApplysNoPage)
            {
                stringBuilder2.Append("<tr>");
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.ReplaceId, true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.UserName, true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.OrderId, true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.ApplyForTime, true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD((item.StoreId.HasValue && item.StoreId.Value > 0) ? DepotHelper.GetStoreNameByStoreId(item.StoreId.Value) : "平台店", true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.ReplaceReason, true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.ShopName + "(" + item.Quantity + ")", true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(EnumDescription.GetEnumDescription((Enum)(object)item.HandleStatus, 0), true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(this.GetHandleTime(item), false));
                stringBuilder2.Append("</tr>");
            }
            stringBuilder.AppendFormat("<tbody>{0}</tbody></table>", stringBuilder2.ToString());
            StringWriter stringWriter = new StringWriter();

            stringWriter.Write(stringBuilder);
            DownloadHelper.DownloadFile(context.Response, stringWriter.GetStringBuilder(), "ReplaceApplys" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".xls");
            stringWriter.Close();
            context.Response.End();
        }
Example #13
0
        public override DbQueryResult GetReplaceApplys(ReplaceApplyQuery query, int userId)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendFormat(" UserId={0}", userId);
            if (!string.IsNullOrEmpty(query.OrderId))
            {
                stringBuilder.AppendFormat(" and OrderId = '{0}'", query.OrderId);
            }
            if (query.HandleStatus.HasValue)
            {
                stringBuilder.AppendFormat(" AND HandleStatus = {0}", query.HandleStatus);
            }
            return(DataHelper.PagingByRownumber(query.PageIndex, query.PageSize, query.SortBy, query.SortOrder, query.IsCount, "vw_Hishop_OrderReplace", "ReplaceId", stringBuilder.ToString(), "*"));
        }
        private void BindRefund()
        {
            ReplaceApplyQuery replaceQuery  = this.GetReplaceQuery();
            DbQueryResult     replaceApplys = TradeHelper.GetReplaceApplys(replaceQuery, HiContext.Current.User.UserId);

            this.listReplace.DataSource = replaceApplys.Data;
            this.listReplace.DataBind();
            this.pager.TotalRecords            = replaceApplys.TotalRecords;
            this.txtOrderId.Text               = replaceQuery.OrderId;
            this.ddlHandleStatus.SelectedIndex = 0;
            if (replaceQuery.HandleStatus.HasValue && (replaceQuery.HandleStatus.Value > -1))
            {
                this.ddlHandleStatus.SelectedValue = replaceQuery.HandleStatus.Value.ToString();
            }
        }
Example #15
0
        private DataGridViewModel <ReplaceInfo> GetDataList(ReplaceApplyQuery query)
        {
            DataGridViewModel <ReplaceInfo> dataGridViewModel = new DataGridViewModel <ReplaceInfo>();
            PageModel <ReplaceInfo>         replaceApplys     = OrderHelper.GetReplaceApplys(query);

            dataGridViewModel.rows  = replaceApplys.Models.ToList();
            dataGridViewModel.total = replaceApplys.Total;
            foreach (ReplaceInfo row in dataGridViewModel.rows)
            {
                row.ReplaceStatusStr = this.GetReplaceStatus(row.HandleStatus);
                row.handleTimeStr    = this.GetHandleTime(row);
                row.OperText         = this.GetOperText(row.HandleStatus);
            }
            return(dataGridViewModel);
        }
Example #16
0
        private void BindReplace()
        {
            ReplaceApplyQuery replaceQuery          = this.GetReplaceQuery();
            DbQueryResult     purchaseReplaceApplys = SalesHelper.GetPurchaseReplaceApplys(replaceQuery);

            this.dlstReplace.DataSource = purchaseReplaceApplys.Data;
            this.dlstReplace.DataBind();
            this.pager.TotalRecords            = purchaseReplaceApplys.TotalRecords;
            this.pager1.TotalRecords           = purchaseReplaceApplys.TotalRecords;
            this.txtOrderId.Text               = replaceQuery.OrderId;
            this.ddlHandleStatus.SelectedIndex = 0;
            if (replaceQuery.HandleStatus.HasValue && replaceQuery.HandleStatus.Value > -1)
            {
                this.ddlHandleStatus.SelectedValue = replaceQuery.HandleStatus.Value.ToString();
            }
        }
Example #17
0
        public DataSet NewGetReplaceApplys(ReplaceApplyQuery query)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(" 1=1");
            if (!string.IsNullOrEmpty(query.OrderId))
            {
                stringBuilder.AppendFormat(" and OrderId = '{0}'", query.OrderId);
            }
            if (query.HandleStatus.HasValue)
            {
                stringBuilder.AppendFormat(" AND HandleStatus = {0}", query.HandleStatus);
            }
            if (query.UserId.HasValue)
            {
                stringBuilder.AppendFormat(" AND UserId = {0}", query.UserId.Value);
            }
            if (!string.IsNullOrEmpty(query.StratTime))
            {
                stringBuilder.AppendFormat(" and ApplyForTime>='{0}'", query.StratTime);
            }
            if (!string.IsNullOrEmpty(query.EndTime))
            {
                stringBuilder.AppendFormat(" and ApplyForTime<='{0} 23:59:59'", query.EndTime.Trim());
            }
            if (!string.IsNullOrEmpty(query.Operator))
            {
                stringBuilder.AppendFormat(" AND Operator LIKE '%{0}%'", DataHelper.CleanSearchString(query.Operator));
            }


            string sqlText = "SELECT * FROM vw_Ecshop_OrderReplace where ";

            sqlText += stringBuilder.ToString();

            sqlText += " order by ReplaceId desc ;";
            sqlText  = sqlText + " SELECT AId, SkuId, ProductId, Quantity, ItemAdjustedPrice, ItemDescription,ThumbnailsUrl,Weight,SKUContent FROM Ecshop_OrderAppFormItems as A  WHERE ApplyType=2 and AId IN (SELECT ReplaceId FROM vw_Ecshop_OrderReplace WHERE  " + stringBuilder.ToString() + ")";

            DbCommand    sqlStringCommand = this.database.GetSqlStringCommand(sqlText);
            DataSet      dataSet          = this.database.ExecuteDataSet(sqlStringCommand);
            DataColumn   parentColumn     = dataSet.Tables[0].Columns["ReplaceId"];
            DataColumn   childColumn      = dataSet.Tables[1].Columns["AId"];
            DataRelation relation         = new DataRelation("OrderItems", parentColumn, childColumn, false);

            dataSet.Relations.Add(relation);
            return(dataSet);
        }
Example #18
0
        public PageModel <ReplaceInfo> GetReplaceApplys(ReplaceApplyQuery query)
        {
            query.OrderId = base.GetTrueOrderId(query.OrderId);
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(" 1=1");
            if (!string.IsNullOrEmpty(query.OrderId))
            {
                stringBuilder.AppendFormat(" and OrderId = '{0}'", query.OrderId);
            }
            if (query.SupplierId.HasValue)
            {
                if (query.SupplierId == -1)
                {
                    stringBuilder.Append(" AND SupplierId > 0 ");
                }
                else
                {
                    stringBuilder.AppendFormat(" AND SupplierId = {0} ", query.SupplierId.Value);
                }
            }
            else if (query.UserId.ToInt(0) <= 0)
            {
                stringBuilder.Append(" and ISNULL(SupplierId,0)=0 ");
            }
            if (query.HandleStatus.HasValue)
            {
                stringBuilder.AppendFormat(" AND HandleStatus = {0}", query.HandleStatus);
            }
            if (query.UserId.HasValue)
            {
                stringBuilder.AppendFormat(" AND UserId = {0}", query.UserId.Value);
            }
            if (query.StoreId.HasValue && query.StoreId > 0)
            {
                stringBuilder.AppendFormat(" AND StoreId = {0}", query.StoreId.Value);
            }
            if (query.ReplaceId.HasValue)
            {
                stringBuilder.AppendFormat(" AND ReplaceId = {0}", query.ReplaceId.Value);
            }
            if (!string.IsNullOrEmpty(query.ProductName))
            {
                stringBuilder.AppendFormat(" AND ShopName LIKE '%{0}%'", query.ProductName);
            }
            return(DataHelper.PagingByRownumber <ReplaceInfo>(query.PageIndex, query.PageSize, query.SortBy, query.SortOrder, query.IsCount, "vw_Hishop_OrderReplace", "ReplaceId", stringBuilder.ToString(), "*"));
        }
        private void BindReplace()
        {
            ReplaceApplyQuery replaceQuery = this.ReplaceApplyQuery();

            replaceQuery.UserId = new int?(HiContext.Current.User.UserId);
            DbQueryResult refundApplys = TradeHelper.GetReplaceApplys(replaceQuery);

            this.rptApply.DataSource = refundApplys.Data;
            this.rptApply.DataBind();
            //this.pager.TotalRecords = refundApplys.TotalRecords;
            //this.txtOrderId.Value = refundQuery.OrderId;
            //this.handleStatus.SelectedIndex = 0;
            //if (refundQuery.HandleStatus.HasValue && refundQuery.HandleStatus.Value > -1)
            //{
            //    this.handleStatus.Value = refundQuery.HandleStatus.Value.ToString();
            //}
        }
Example #20
0
        public void ExportToExcel(HttpContext context)
        {
            ReplaceApplyQuery dataQuery = this.GetDataQuery(context);

            dataQuery.ReplaceIds = context.Request["Ids"].ToNullString();
            IList <ReplaceInfo> replaceApplysNoPage = OrderHelper.GetReplaceApplysNoPage(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("</tr></thead>");
            StringBuilder stringBuilder2 = new StringBuilder();

            foreach (ReplaceInfo item in replaceApplysNoPage)
            {
                stringBuilder2.Append("<tr>");
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.ReplaceId, true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.UserName, true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.OrderId, true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.ApplyForTime, true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD((item.SupplierId > 0) ? SupplierHelper.GetSupplierName(item.SupplierId) : "平台店", true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.ReplaceReason, true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(item.ShopName + "(" + item.Quantity + ")", true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(EnumDescription.GetEnumDescription((Enum)(object)item.HandleStatus, 0), true));
                stringBuilder2.Append(ExcelHelper.GetXLSFieldsTD(this.GetHandleTime(item), false));
                stringBuilder2.Append("</tr>");
            }
            stringBuilder.AppendFormat("<tbody>{0}</tbody></table>", stringBuilder2.ToString());
            StringWriter stringWriter = new StringWriter();

            stringWriter.Write(stringBuilder);
            DownloadHelper.DownloadFile(context.Response, stringWriter.GetStringBuilder(), "ReplaceApplys" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".xls");
            stringWriter.Close();
            context.Response.End();
        }
Example #21
0
        private DataGridViewModel <Dictionary <string, object> > GetDataList(ReplaceApplyQuery query)
        {
            DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >();

            if (query != null)
            {
                PageModel <ReplaceInfo> replaceApplys = OrderHelper.GetReplaceApplys(query);
                dataGridViewModel.rows  = new List <Dictionary <string, object> >();
                dataGridViewModel.total = replaceApplys.Total;
                foreach (ReplaceInfo model in replaceApplys.Models)
                {
                    model.OperText         = this.GetOperText(model.HandleStatus);
                    model.ReplaceStatusStr = this.GetStatusText(model.HandleStatus);
                    Dictionary <string, object> dictionary = model.ToDictionary();
                    dictionary.Add("HandleTime", this.GetHandleTime(model));
                    dataGridViewModel.rows.Add(dictionary);
                }
            }
            return(dataGridViewModel);
        }
Example #22
0
        private void BindReplace()
        {
            ReplaceApplyQuery replaceQuery  = this.GetReplaceQuery();
            DbQueryResult     replaceApplys = OrderHelper.GetReplaceApplys(replaceQuery);

            this.dlstReplace.DataSource = replaceApplys.Data;
            this.dlstReplace.DataBind();
            this.pager.TotalRecords            = replaceApplys.TotalRecords;
            this.pager1.TotalRecords           = replaceApplys.TotalRecords;
            this.txtOrderId.Text               = replaceQuery.OrderId;
            this.txtHandler.Text               = replaceQuery.Operator;
            this.ddlHandleStatus.SelectedIndex = 0;

            this.calendarEndDate.Text   = replaceQuery.EndTime;
            this.calendarStartDate.Text = replaceQuery.StratTime;

            if (replaceQuery.HandleStatus.HasValue && replaceQuery.HandleStatus.Value > -1)
            {
                this.ddlHandleStatus.SelectedValue = replaceQuery.HandleStatus.Value.ToString();
            }
        }
        private void BindRefund()
        {
            ReplaceApplyQuery replaceQuery = this.GetReplaceQuery();

            replaceQuery.UserId = HiContext.Current.UserId;
            PageModel <ReplaceInfo> replaceApplys = TradeHelper.GetReplaceApplys(replaceQuery);

            this.listReplace.DataSource = replaceApplys.Models;
            this.listReplace.DataBind();
            this.pager.TotalRecords = replaceApplys.Total;
            this.txtOrderId.Text    = (string.IsNullOrEmpty(replaceQuery.OrderId) ? replaceQuery.ProductName : replaceQuery.OrderId);
            if (replaceQuery.ReplaceId.HasValue)
            {
                this.txtAfterSaleId.Text = replaceQuery.ReplaceId.Value.ToString();
            }
            this.ddlHandleStatus.SelectedIndex = 0;
            if (replaceQuery.HandleStatus.HasValue && replaceQuery.HandleStatus.Value > -1)
            {
                this.ddlHandleStatus.SelectedValue = replaceQuery.HandleStatus.Value;
            }
        }
        private ReplaceApplyQuery GetReplaceQuery()
        {
            ReplaceApplyQuery query = new ReplaceApplyQuery();

            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["OrderId"]))
            {
                query.OrderId = Globals.UrlDecode(this.Page.Request.QueryString["OrderId"]);
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["HandleStatus"]))
            {
                int result = 0;
                if (int.TryParse(this.Page.Request.QueryString["HandleStatus"], out result) && (result > -1))
                {
                    query.HandleStatus = new int?(result);
                }
            }
            query.PageIndex = this.pager.PageIndex;
            query.PageSize  = this.pager.PageSize;
            query.SortBy    = "ApplyForTime";
            query.SortOrder = SortAction.Desc;
            return(query);
        }
Example #25
0
        private ReplaceApplyQuery GetDataQuery(HttpContext context)
        {
            ReplaceApplyQuery replaceApplyQuery = new ReplaceApplyQuery();

            replaceApplyQuery.OrderId      = base.GetParameter(context, "OrderId", true);
            replaceApplyQuery.HandleStatus = base.GetIntParam(context, "HandleStatus", true);
            int?intParam = base.GetIntParam(context, "SupplierId", true);

            if (intParam.HasValue)
            {
                replaceApplyQuery.SupplierId = intParam.Value;
            }
            else
            {
                replaceApplyQuery.SupplierId = -1;
            }
            replaceApplyQuery.PageIndex = base.CurrentPageIndex;
            replaceApplyQuery.PageSize  = base.CurrentPageSize;
            replaceApplyQuery.SortBy    = "ApplyForTime";
            replaceApplyQuery.SortOrder = SortAction.Desc;
            return(replaceApplyQuery);
        }
        private ReplaceApplyQuery ReplaceApplyQuery()
        {
            ReplaceApplyQuery replaceApplyQuery = new ReplaceApplyQuery();

            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["OrderId"]))
            {
                replaceApplyQuery.OrderId = Globals.UrlDecode(this.Page.Request.QueryString["OrderId"]);
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["HandleStatus"]))
            {
                int num = 0;
                if (int.TryParse(this.Page.Request.QueryString["HandleStatus"], out num) && num > -1)
                {
                    replaceApplyQuery.HandleStatus = new int?(num);
                }
            }
            replaceApplyQuery.PageIndex = 1;
            replaceApplyQuery.PageSize  = 100;
            replaceApplyQuery.SortBy    = "ApplyForTime";
            replaceApplyQuery.SortOrder = SortAction.Desc;
            return(replaceApplyQuery);
        }
Example #27
0
 public static DbQueryResult GetReplaceApplys(ReplaceApplyQuery query)
 {
     return(SalesProvider.Instance().GetReplaceApplys(query));
 }
Example #28
0
 public abstract DbQueryResult GetReplaceApplys(ReplaceApplyQuery query, int userId);
Example #29
0
 public static DbQueryResult GetReplaceApplys(ReplaceApplyQuery query, int userId)
 {
     return(TradeProvider.Instance().GetReplaceApplys(query, userId));
 }
Example #30
0
 public abstract DbQueryResult GetReplaceApplys(ReplaceApplyQuery query);