ModelManage/WorkManage/Repair/AddReturn.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class WorkManage_Repair_AddReturn : PageBase
{
    protected static int mouldID = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!RoleControl("|31_2|"))//权限判断
            {
                btnOK.Visible = false;
                Common.SL.MessageBox.Show(this, "您没有添加权限!"); return;
            }
            if (Request.QueryString["AddRetrun"] != null)
            {
                string MouldID = Request.QueryString["AddRetrun"].ToString();
                BLL.RepairInfor Mould = new BLL.RepairInfor();
                DataSet dsMould = Mould.GetList("RepairInfor.ID=" + Request.QueryString["AddRetrun"].ToString());
                DataTable dtMould = dsMould.Tables[0];
                if (dtMould.Rows.Count < 1) { return; }
                mouldID = Common.DataConvert.StringToInt(dtMould.Rows[0]["ID"].ToString());//返修编号
                txtMouldID.Text = dtMould.Rows[0]["MouldNumber"].ToString();
            }
            txtMouldID.Attributes.Add("readonly", "true");
        }
    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        BLL.ReturnInfor UserBLL = new BLL.ReturnInfor();
        Model.ReturnInfor UserModel = new Model.ReturnInfor();
        if (mouldID == 0) { Common.SL.MessageBox.Show(this, "返修编号不能为空!"); return; }
        UserModel.RepairID = mouldID;
        UserModel.IFBack = ddlIFBack.Text.ToString();
        if (UserModel.IFBack == "是") UserModel.ReturnTime = DateTime.Parse(txtReturnTime.DayTimeString);
        else UserModel.ReturnTime = null;
        UserModel.ReturnPrice = Common.DataConvert.StringToDecimal(txtReturnPrice.Text.Trim());
        UserModel.Remark = txtRemark.Text.Trim();
        UserModel.BuilderID = Common.DataConvert.StringToInt(Session["UserID"].ToString());
        UserModel.BuiderTime = DateTime.Now;
        UserModel.ReState = 0;
        UserBLL.Add(UserModel);
        //更新主表状态
        UpdateStateMould(MouldNameToInt(txtMouldID.Text), "正常");
        string strSql = "update mouldInfor set IFOK=2 where ID=" + MouldNameToInt(txtMouldID.Text) + "";
        DBUtility.DbHelperSQL.ExecuteSQL(strSql);
        Common.SL.MessageBox.ShowAndRedirect(this, "添加成功!", "RepairList.aspx");
        mouldID = 0;
    }
    //是否已回
    protected void ddlIFBack_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddlIFBack.Text.ToString() == "否")
        {
            txtReturnTime.Visible = false;
后面还有 7 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。