using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
using System.Web.UI;
|
using System.Web.UI.WebControls;
|
using CY.BLL;
|
using CY.Model;
|
using CY.Infrastructure.Query;
|
using CY.Infrastructure.Common;
|
using CY.BLL.EC;
|
|
namespace CY.WebForm.Pages.webmanage
|
{
|
public partial class PrizeReciveAddressEdit :BasePage
|
{
|
|
public string Province = ""; //接收值 Request["selectProvince"].ToString2();
|
public string City = "";//接收值 Request["selectCity"].ToString2();
|
public string County = "";//接收值 Request["selectCounty"].ToString2();
|
EC_PrizeReciveAddressBLL _EC_PrizeReciveAddressBLL = null; //奖品地址类业务逻辑操作对象
|
EC_PrizeReciveAddress prizeReciveAddress= null; // 奖品地址实体对象
|
|
public PrizeReciveAddressEdit()
|
{
|
_EC_PrizeReciveAddressBLL = new EC_PrizeReciveAddressBLL();
|
prizeReciveAddress = new EC_PrizeReciveAddress();
|
}
|
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
if (!IsPostBack)
|
{
|
if (Request["Keyid"].ToInt32() > 0)
|
{
|
InitialModifyData();
|
}
|
}
|
|
}
|
/// <summary>
|
/// 加载要修改的数据
|
/// </summary>
|
protected void InitialModifyData()
|
{
|
prizeReciveAddress = _EC_PrizeReciveAddressBLL.getOnePriceAddress(Request["Keyid"].ToInt32());
|
this.txtDetailedAddress.Value = prizeReciveAddress.DetailedAddress;
|
this.txtRemark.Value = prizeReciveAddress.Remark;
|
this.txtWorkTime.Value = prizeReciveAddress.WorkTime;
|
this.Province = prizeReciveAddress.Province;
|
this.County = prizeReciveAddress.County;
|
this.City = prizeReciveAddress.City;
|
|
|
}
|
|
|
protected void btn_Submit_Click(object sender, EventArgs e)
|
{
|
if (Request["Keyid"].ToInt32() > 0) //如果keyid 大于0 则再加载一次对象,方便利用对象里面的不变属性
|
{
|
prizeReciveAddress = _EC_PrizeReciveAddressBLL.getOnePriceAddress(Request["Keyid"].ToInt32());
|
|
}
|
prizeReciveAddress.LastUpdateTime = System.DateTime.Now;
|
prizeReciveAddress.Remark = txtRemark.Value.ToString2();
|
prizeReciveAddress.Province = Request["selectProvince"].ToString2();
|
prizeReciveAddress.City = Request["selectCity"].ToString2();
|
prizeReciveAddress.County = Request["selectCounty"].ToString2();
|
prizeReciveAddress.DetailedAddress = txtDetailedAddress.Value.ToString2();
|
prizeReciveAddress.Operator = CurrentUser.ShortName;
|
prizeReciveAddress.WorkTime = txtWorkTime.Value.ToString2();
|
if (Request["Keyid"].ToInt32() > 0)
|
{
|
if (_EC_PrizeReciveAddressBLL.UpdateModel(prizeReciveAddress))
|
{
|
JavaScript.RefreshDIVOpener(this);
|
}
|
else
|
{
|
JavaScript.MessageBox("更新失败", this);
|
}
|
|
}
|
else
|
{
|
|
|
|
if (_EC_PrizeReciveAddressBLL.InsertModel(prizeReciveAddress))
|
{
|
JavaScript.RefreshDIVOpener(this);
|
}
|
else
|
{
|
JavaScript.MessageBox("添加失败", this);
|
}
|
}
|
}
|
}
|
}
|