ModelManage/SaleSetManage/BillType/AddBillType.aspx.cs
(完整代码) 2KBusing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class SaleSetManage_BillType_AddBillType : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
btnOK.Visible = RoleControl("|1104_2|");
if (Request.Form["AddBillType"] != null)//添加事件
{
btnOKS();
}
else
{
//自动编码
string AreaNumber = AutoCode.CreateNumber("BillTypeInfor", "BTNumber", DateTime.Now);
if (AreaNumber != "")
{
txtBTNumber.Value = AreaNumber;
txtBTNumber.Attributes.Add("readonly", "true");
}
}
}
}
public void btnOKS()
{
try
{
BLL.BillTypeInfor BillTypeBll = new BLL.BillTypeInfor();
Model.BillTypeInfor BillTypeModel = new Model.BillTypeInfor();
DataSet dsBillType = BillTypeBll.GetList(" BTName='" + Request.Form["txtBTName"].ToString() + "' and BTMainTypeID=" + Request.Form["txtBTMainTypeID"].ToString() + " and (BTState=0 or BTState=1)");
DataTable dtBillType = dsBillType.Tables[0];
if (dtBillType.Rows.Count > 0) { Response.Write("again|v|"); return; }
BillTypeModel.BTMainTypeID = Request.Form["txtBTMainTypeID"].ToString();
BillTypeModel.BTNumber = Request.Form["txtBTNumber"].ToString();
BillTypeModel.BTName = Request.Form["txtBTName"].ToString();
BillTypeModel.BuilderID = Common.DataConvert.StringToInt(Session["UserID"].ToString());
BillTypeModel.BuiderTime = DateTime.Now;
BillTypeModel.BTState = 0;
BillTypeModel.BOper = Common.DataConvert.StringToInt(Request.Form["txtOper"].ToString());
BillTypeBll.Add(BillTypeModel);
Response.Write("suc|v|");
}
catch (Exception ex)
{
Common.WriteLog.CreateLog(ex, "SaleSetManage_BillTypeSet_AddBillType", "btnOKS", Session["TrueName"].ToString());
}
}
}
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
