using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
using System.Web.UI;
|
using System.Web.UI.WebControls;
|
using CY.BLL.EC;
|
using CY.Model;
|
using CY.BLL.Sys;
|
using CY.Infrastructure.Common;
|
using CY.BLL;
|
using CY.WebForm.Pages.common;
|
|
namespace CY.WebForm.Pages.membermanage
|
{
|
//吴辉
|
//卖家订单
|
public partial class MemberSellerOrder : BasePage
|
{
|
|
EC_OrderBasicBLL _eC_OrderBasicBLL = null;
|
OA_StaffBLL bll_OA_StaffBLL = null;
|
LF_OrderFileBLL _lF_OrderFileBLL = null;
|
|
/// <summary>
|
/// 初始化构造
|
/// </summary>
|
public MemberSellerOrder()
|
{
|
_eC_OrderBasicBLL = new EC_OrderBasicBLL();
|
bll_OA_StaffBLL = new OA_StaffBLL();
|
_lF_OrderFileBLL = new LF_OrderFileBLL();
|
}
|
|
/// <summary>
|
/// 加载事件
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
UCPager1.AspNetPager.PageChanged += AspNetPager_PageChanged;
|
btn_Search.Click += btn_Search_Click;
|
try
|
{
|
if (!IsPostBack)
|
{
|
Page_Load_Default();
|
}
|
}
|
catch (Exception ex)
|
{
|
PAGEHandleException(ex);
|
Response.Clear();
|
Response.Write("-1");
|
}
|
|
}
|
|
/// <summary>
|
/// 默认执行方法
|
/// </summary>
|
private void Page_Load_Default()
|
{
|
|
txtCommission.Value = CY.Config.WebInfo.Instance.FirmOrderAgencyFee;
|
List<EC_OrderDialogue> dialogues = _eC_OrderBasicBLL.SelectPropertyChangeRequest(CurrentUser.MemberId) as List<EC_OrderDialogue>;
|
|
|
if (!IsPostBack && !IsCallback)
|
{
|
Sys_DictionaryBLL _sys_DictionaryBLL = new Sys_DictionaryBLL();//字典业务逻辑操作类对象
|
|
selOrderStates.DataSource = _sys_DictionaryBLL.GetDataByType("EC_订单状态");
|
selOrderStates.DataBind();
|
selOrderStates.Items.Insert(0, new ListItem("所有", ""));
|
|
//初次数据加载
|
btn_Search_Click(btn_Search, new EventArgs());
|
}
|
}
|
|
/// <summary>
|
/// 搜索按钮点击事件
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
private void btn_Search_Click(object sender, EventArgs e)
|
{
|
Dictionary<int, object> searchParam = new Dictionary<int, object>();
|
|
SetParamValue(searchParam, 1, Request["MemberId"].ToGuid2());
|
SetParamValue(searchParam, 2, txtOrderId.Value.Trim());
|
SetParamValue(searchParam, 3, "");
|
SetParamValue(searchParam, 4, txtBeginData.Value.Trim());
|
SetParamValue(searchParam, 5, txtEndDate.Value.Trim());
|
SetParamValue(searchParam, 6, "");
|
SetParamValue(searchParam, 7, "");
|
SetParamValue(searchParam, 8, selOrderStates.Value);
|
SetParamValue(searchParam, 9, "");
|
SetParamValue(searchParam, 10, "");
|
SetParamValue(searchParam, 11, "");
|
SetParamValue(searchParam, 12, "");
|
SetParamValue(searchParam, 13, "");
|
SetParamValue(searchParam, 14, "");
|
SetParamValue(searchParam, 15, "");
|
SetParamValue(searchParam, 16, "");
|
SearchParam = searchParam;
|
UCPager1.AspNetPager.CurrentPageIndex = 1;//重置页数
|
//再次查询
|
AspNetPager_PageChanged(UCPager1.AspNetPager, new EventArgs());
|
}
|
|
/// <summary>
|
/// 设置查询参数方法
|
/// </summary>
|
/// <param name="target">设置目标</param>
|
/// <param name="key">键</param>
|
/// <param name="value">值</param>
|
private static void SetParamValue(Dictionary<int, object> target, int key, object value)
|
{
|
if (string.IsNullOrEmpty(string.Format("{0}", value)))
|
return;
|
else
|
{
|
}
|
|
if (target.ContainsKey(key))
|
{
|
target[key] = value;
|
}
|
else
|
{
|
target.Add(key, value);
|
}
|
}
|
|
/// <summary>
|
/// 分页事件
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
private void AspNetPager_PageChanged(object sender, EventArgs e)
|
{
|
//UCPager1.AspNetPager.PageSize = 3;
|
|
Infrastructure.Query.Pagination pagination = new Infrastructure.Query.Pagination()
|
{
|
PageSize = UCPager1.AspNetPager.PageSize,
|
PageIndex = UCPager1.AspNetPager.CurrentPageIndex
|
};
|
IEnumerable<EC_OrderBasic> result = _eC_OrderBasicBLL.SelectModelPage(pagination, SearchParam);
|
rptData.DataSource = result;
|
rptData.DataBind();
|
|
UCPager1.AspNetPager.RecordCount = pagination.RecordCount;
|
}
|
|
/// <summary>
|
/// 查询参数
|
/// </summary>
|
private Dictionary<int, object> SearchParam
|
{
|
get
|
{
|
return ViewState["SearchParam"] as Dictionary<int, object>;
|
}
|
set
|
{
|
ViewState["SearchParam"] = value;
|
}
|
}
|
|
/// <summary>
|
/// 可不可以冻结订单
|
/// </summary>
|
/// <returns></returns>
|
public bool IsCanFreezeOrder(int OrderState)
|
{
|
//订单状态为“确认收货”,"已完成","已终止","已冻结","处理中","退款"时不能冻结订单
|
IList<int> typeList=new List<int>()
|
{
|
6,-1,0,-2,-5,-4
|
};
|
if (typeList.Contains<int>(OrderState))
|
{
|
return false;
|
}
|
else
|
{
|
return true;
|
}
|
}
|
|
}
|
}
|