using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
using System.Web.UI;
|
using System.Web.UI.WebControls;
|
using System.Data;
|
using System.Data.SqlClient;
|
using CY.Model;
|
using CY.BLL;
|
using CY.Infrastructure.Common;
|
using CY.Infrastructure.Query;
|
|
namespace CY.WebForm.Pages.soft
|
{
|
//吴辉
|
//新增/修改软件代理
|
public partial class ProxyAdd : BasePage
|
{
|
Soft_ProxyBLL bll_Soft_ProxyBLL = null;
|
|
//初始化
|
public ProxyAdd()
|
{
|
bll_Soft_ProxyBLL = new Soft_ProxyBLL();
|
}
|
|
//页面加载
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
if (!IsPostBack)
|
{
|
InitData();
|
}
|
}
|
|
//数据加载
|
public void InitData()
|
{
|
Soft_Proxy m_Soft_Proxy = bll_Soft_ProxyBLL.GetModelByKeyid(Request["keyid"].ToInt32());
|
if (m_Soft_Proxy != null)
|
{
|
this.txtProxyName.Value = m_Soft_Proxy.ProxyName.ToString2();
|
this.txtProxyPhone.Value = m_Soft_Proxy.ProxyPhone.ToString2();
|
this.txtProxyQQ.Value = m_Soft_Proxy.ProxyQQ.ToString2();
|
this.txtProxyMobile.Value = m_Soft_Proxy.ProxyMobile.ToString2();
|
this.txtProxyCardNum.Value = m_Soft_Proxy.ProxyCardNum.ToString2();
|
}
|
else
|
{
|
this.txtProxyName.Value = "";
|
this.txtProxyPhone.Value = "";
|
this.txtProxyQQ.Value = "";
|
this.txtProxyMobile.Value = "";
|
this.txtProxyCardNum.Value = "";
|
}
|
}
|
|
//表单提交
|
protected void btn_submit_form(object sender, EventArgs e)
|
{
|
try
|
{
|
DateTime nowTime = DateTime.Now;
|
Soft_Proxy m_Soft_Proxy = bll_Soft_ProxyBLL.GetModelByKeyid(Request["keyid"].ToInt32());
|
if (m_Soft_Proxy == null)
|
{
|
m_Soft_Proxy = new Soft_Proxy();
|
m_Soft_Proxy.ProxyStatus = 1;
|
m_Soft_Proxy.ProxyCardImg = "";
|
m_Soft_Proxy.ProxyProvince = "";
|
m_Soft_Proxy.ProxyCity = "";
|
m_Soft_Proxy.ProxyCountry = "";
|
m_Soft_Proxy.ProxyType = 1;
|
m_Soft_Proxy.ProxyMoneyWay = 1;
|
m_Soft_Proxy.ProxyMoneyNum = 1;
|
m_Soft_Proxy.ProxyCreatTime = nowTime;
|
}
|
|
m_Soft_Proxy.ProxyName = this.txtProxyName.Value.ToString2();
|
m_Soft_Proxy.ProxyPhone = this.txtProxyPhone.Value.ToString2();
|
m_Soft_Proxy.ProxyQQ = this.txtProxyQQ.Value.ToString2();
|
m_Soft_Proxy.ProxyMobile = this.txtProxyMobile.Value.ToString2();
|
m_Soft_Proxy.ProxyCardNum = this.txtProxyCardNum.Value.ToString2();
|
m_Soft_Proxy.ProxyEndTime =nowTime;
|
m_Soft_Proxy.LastUpdateTime = nowTime;
|
m_Soft_Proxy.Operator = CurrentUser.ShortName;
|
|
if (Request["keyid"].ToInt32() > 0)
|
{
|
if (bll_Soft_ProxyBLL.UpdateModel(m_Soft_Proxy))
|
JavaScript.MessageBox("更新成功", this, true, true);
|
else
|
JavaScript.MessageBox("更新失败", this);
|
}
|
else
|
{
|
if (bll_Soft_ProxyBLL.InsertModel(m_Soft_Proxy))
|
{
|
JavaScript.MessageBox("新增成功", this, false, true);
|
InitData();
|
}
|
else
|
JavaScript.MessageBox("新增失败", this);
|
}
|
}
|
catch (Exception ex)
|
{
|
PAGEHandleException(ex);
|
JavaScript.MessageBox("操作失败", this);
|
}
|
}
|
}
|
}
|