using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
using System.Web.UI;
|
using System.Web.UI.WebControls;
|
using CY.BLL.Sys;
|
using CY.BLL.EC;
|
using CY.Infrastructure.Common;
|
using CY.Model;
|
using CY.WebForm.cs;
|
|
namespace CY.WebForm.Pages.front
|
{
|
/*
|
* 寻找订单
|
*
|
* 作用:寻找订单
|
* 创建时间:2013-4-17 15:40
|
* 修改时间:2013-4-17
|
* 创建人:吴崎均
|
* 修改人:吴崎均
|
*/
|
|
/// <summary>
|
/// 寻找订单
|
/// </summary>
|
public partial class FindOrder : FrontBasePage
|
{
|
public bool IsLogin = false;
|
private SysInquiry_PrintingTypeBLL _sysInquiry_PrintingTypeBLL = null;//印刷业务类型业务逻辑操作类对象
|
private EC_QuoteDemandBLL _eC_QuoteDemandBLL = null;//报价需求逻辑操作对象
|
|
/// <summary>
|
/// 初始化
|
/// </summary>
|
public FindOrder()
|
{
|
_sysInquiry_PrintingTypeBLL = new SysInquiry_PrintingTypeBLL();
|
_eC_QuoteDemandBLL = new EC_QuoteDemandBLL();
|
}
|
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
if (CurrentUser != null)
|
{
|
if (CurrentUser.MemberType == "印刷厂商")
|
IsLogin = true;
|
}
|
try
|
{
|
switch (Request["Target"])
|
{
|
case "Search":
|
Search();
|
return;
|
case "DemandQuote":
|
SaveQuoteInfo();
|
break;
|
default:
|
UCPager1.AspNetPager.PageChanged += AspNetPager1_PageChanged;
|
UCPager1.AspNetPager.PageSize = 10;
|
if (!IsPostBack && !IsCallback)
|
{
|
InitPrintTypeData();
|
BingData();
|
}
|
return;
|
}
|
}
|
catch (Exception ex)
|
{
|
PAGEHandleException(ex);
|
Response.Clear();
|
Response.Write("-1");
|
}
|
Response.End();
|
}
|
|
/// <summary>
|
/// 查询方法
|
/// </summary>
|
private void Search()
|
{
|
PrintTypeId = string.IsNullOrEmpty(Request["PrintTypeId"]) ? -1 : MyConvert.ConvertToInt32(Request["PrintTypeId"]).Value;
|
Province = Request["province"];
|
City = Request["City"];
|
UCPager1.AspNetPager.CurrentPageIndex = 1;
|
BingData();
|
}
|
|
/// <summary>
|
/// 保存报价
|
/// </summary>
|
private void SaveQuoteInfo()
|
{
|
EC_DemandQuoteBLL eC_DemandQuoteBLL = new EC_DemandQuoteBLL();
|
EC_DemandQuote demandQuote = new EC_DemandQuote();
|
demandQuote.QuoteRemark = "";
|
demandQuote.QuoterId = CurrentUser.MemberId;
|
WebUtil<EC_DemandQuote>.SaveData(eC_DemandQuoteBLL.AddData, eC_DemandQuoteBLL.UpdateData, demandQuote);
|
}
|
|
/// <summary>
|
/// 分页事件
|
/// </summary>
|
/// <param name="src"></param>
|
/// <param name="e"></param>
|
protected void AspNetPager1_PageChanged(object src, EventArgs e)
|
{
|
BingData();
|
}
|
|
/// <summary>
|
/// 加载是否结束情况数据
|
/// </summary>
|
private void InitPrintTypeData()
|
{
|
//selPrintTypes.DataSource = _sysInquiry_PrintingTypeBLL.SelectUsedModles();
|
//selPrintTypes.DataBind();
|
//selPrintTypes.Items.Add(new ListItem("不限", ""));
|
}
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
private void BingData()
|
{
|
Infrastructure.Query.Pagination pagination = new Infrastructure.Query.Pagination() { PageSize = UCPager1.AspNetPager.PageSize, PageIndex = UCPager1.AspNetPager.CurrentPageIndex };
|
rptData.DataSource = _eC_QuoteDemandBLL.SelectModelPage(pagination, Province, City, PrintTypeId);
|
UCPager1.AspNetPager.RecordCount = pagination.RecordCount;
|
rptData.DataBind();
|
}
|
|
#region 查询参数
|
|
private string Province
|
{
|
get { object obj = ViewState["Province"]; return null == obj ? null : MyConvert.ConvertToString(obj); }
|
set { ViewState["Province"] = value; }
|
}
|
private string City
|
{
|
get { object obj = ViewState["City"]; return null == obj ? null : MyConvert.ConvertToString(obj); }
|
set { ViewState["City"] = value; }
|
}
|
private int PrintTypeId
|
{
|
get { object obj = ViewState["PrintTypeId"]; return null == obj ? -1 : MyConvert.ConvertToInt32(obj).Value; }
|
set { ViewState["PrintTypeId"] = value; }
|
}
|
#endregion
|
}
|
}
|