/******************************************************
|
FileName: 名片快速询价
|
Copyright (c) 四川川印包转股份有限公司软件事业部
|
Writer: dongbenjian
|
create Date:2013-04-27
|
Rewriter:
|
Rewrite Date:
|
|
******************************************************/
|
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
using System.Web.UI;
|
using System.Web.UI.WebControls;
|
using CY.Infrastructure.Common;
|
using CY.BLL.Inquiry;
|
using CY.Model;
|
|
namespace CY.WebForm.Pages.sysInquiry
|
{
|
public partial class GraphicDesignerFast : BasePage
|
{
|
#region 变量
|
GraphicDesignerFastBLL _graphicDesignerFastBLL = new GraphicDesignerFastBLL();
|
#endregion
|
|
#region 属性
|
#endregion
|
|
#region 方法
|
|
|
|
/// <summary>
|
/// 初始化绑定页面
|
/// </summary>
|
private void BindPage()
|
{
|
this.RepGraphicDesignerFastList.DataSource = _graphicDesignerFastBLL.GetModelList(InquiryConditionObj.InquiryId);
|
this.RepGraphicDesignerFastList.DataBind();
|
}
|
|
|
#endregion
|
|
#region 事件
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
if (!IsPostBack)
|
{
|
BindPage();
|
}
|
}
|
|
|
/// <summary>
|
/// 保存事件
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
protected void btnSave_Click(object sender, EventArgs e)
|
{
|
|
bool isSuccess = true;
|
|
IList<Inquiry_GraphicDesignerFastCost> list = new List<Inquiry_GraphicDesignerFastCost>();
|
IList<Inquiry_GraphicDesignerFastCost> tempList = new List<Inquiry_GraphicDesignerFastCost>();
|
|
Inquiry_GraphicDesignerFastCost model = null;
|
|
string[] printCountArry = new string[]{
|
"53","54","55","56","57","58","59"
|
};
|
foreach (RepeaterItem item in this.RepGraphicDesignerFastList.Items)
|
{
|
if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
|
{
|
Label lblPriceType = item.FindControl("lblPriceType") as Label;
|
if (lblPriceType.Text == "单价(元)")
|
{
|
foreach (string printCount in printCountArry)
|
{
|
string textBoxName = "txtPrice" + printCount.ToString();
|
TextBox txtPrice = item.FindControl(textBoxName) as TextBox;
|
model = new Inquiry_GraphicDesignerFastCost();
|
model.FirmId = InquiryConditionObj.ActualFirmId;
|
model.SJTypeId = printCount.ToString().ToInt32().Value;
|
model.Price = txtPrice.Text.ToDecimal2().Value;
|
model.Operater = CurrentUser.ShortName;
|
model.Unit = string.Empty;
|
model.OperateTime = DateTime.Now;
|
model.LastUpdateTime = DateTime.Now;
|
tempList.Add(model);
|
}
|
}
|
else
|
{
|
foreach (string printCount in printCountArry)
|
{
|
model = tempList.SingleOrDefault(p => p.SJTypeId.ToString() == printCount);
|
string textBoxName = "txtPrice" + printCount.ToString();
|
TextBox txtPrice = item.FindControl(textBoxName) as TextBox;
|
model.StartPrice = txtPrice.Text.ToDecimal2().Value;
|
list.Add(model);
|
}
|
}
|
}
|
}
|
isSuccess = _graphicDesignerFastBLL.SaveModelList(list, InquiryConditionObj);
|
|
if (isSuccess)
|
{
|
JavaScript.MessageBox("保存成功", this);
|
}
|
else
|
{
|
JavaScript.MessageBox("保存失败", this);
|
}
|
}
|
#endregion
|
}
|
}
|