⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 docwrite.aspx.cs

📁 java 最出色的报表工具代码,愿分享....
💻 CS
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Admin_Frameset_Operation_DocWrite : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Vouchers voucher = new Vouchers();
            this.htCode.Text = voucher.GetId().ToString();
            Boolean flag = voucher.LoadData(Convert.ToInt32(this.htCode.Text.Trim()));

            if (flag)
            {


                this.CustomerName.Text = voucher.CustomerName;
                this.XZMode.Text = voucher.XZMode;
                this.EngineLocal.Text = voucher.EngineLocal;
                this.FiteCode.Text = voucher.FiteCode;
                this.EngineName.Text = voucher.EngineName;
                this.GiveLocal.Text = voucher.GiveLocal;
                this.TongStrong.Text = voucher.TongStrong;
                this.ShuiniCode.Text = voucher.ShuiniCode;
                this.Taluodu.Text = voucher.Taluodu;
                this.SjName.Text = voucher.SjName;
                this.dCarFl.Text = voucher.dCarFl;
                this.TotalFl.Text = voucher.TotalFl;
                this.StartTime.Text = voucher.StartTime.ToString();
                this.CarCode.Text = voucher.CarCode;
                this.EndTime.Text = voucher.EndTime.ToString();
                this.XwTime.Text = voucher.XwTime.ToString();
                this.OperPerson.Text = voucher.OperPerson;
                this.DiaoduOper.Text = voucher.DiaoduOper;
                this.PrintTime.Value = voucher.PrintTime;


                //设置控件不可用
                this.CustomerName.ReadOnly =true;
                this.XZMode.ReadOnly = true;
                this.EngineLocal.ReadOnly = true;
                this.FiteCode.ReadOnly = true;
                this.EngineName.ReadOnly = true;
                this.GiveLocal.ReadOnly = true;
                this.TongStrong.ReadOnly = true;
                this.ShuiniCode.ReadOnly = true;
                this.Taluodu.ReadOnly = true;
                this.SjName.ReadOnly = true;
                this.dCarFl.ReadOnly = true;
                this.TotalFl.ReadOnly = true;
                this.StartTime.ReadOnly = true;
                this.CarCode.ReadOnly = true;
                this.EndTime.ReadOnly = true;
                this.XwTime.ReadOnly = true;
                this.OperPerson.ReadOnly = true;
                this.DiaoduOper.ReadOnly = true;
                this.htCode.ReadOnly = true;
                this.lkbsave.Enabled=false;
                this.PrintTime.ReadOnly = true;

            }
        }
    }
    protected void lkbAdd_Click(object sender, EventArgs e)
    {
        //设置控件可用
        this.CustomerName.ReadOnly = false;
        this.XZMode.ReadOnly = false;
        this.EngineLocal.ReadOnly = false;
        this.FiteCode.ReadOnly = false;
        this.EngineName.ReadOnly = false;
        this.GiveLocal.ReadOnly = false;
        this.TongStrong.ReadOnly = false;
        this.ShuiniCode.ReadOnly = false;
        this.Taluodu.ReadOnly = false;
        this.SjName.ReadOnly = false;
        this.dCarFl.ReadOnly = false;
        this.TotalFl.ReadOnly = false;
        this.StartTime.ReadOnly = false;
        this.CarCode.ReadOnly = false;
        this.EndTime.ReadOnly = false;
        this.XwTime.ReadOnly = false;
        this.OperPerson.ReadOnly = false;
        this.DiaoduOper.ReadOnly = false;
        this.htCode.ReadOnly = false;
        this.lkbsave.Enabled = true;
        this.PrintTime.ReadOnly = false;
      

        Vouchers voucher = new Vouchers();
        this.htCode.Text = Convert.ToString(Convert.ToInt32(voucher.GetId().ToString()) + 1);
        this.htCode.ReadOnly = true;
        this.lbkLook.Enabled = false;
        this.lkbsave.Enabled = true;
        this.PrintTime.Enabled = true;

        this.CustomerName.Text = "";
        this.XZMode.Text = "";
        this.EngineLocal.Text = "";
        this.FiteCode.Text = "";
        this.EngineName.Text = "";
        this.GiveLocal.Text = "";
        this.TongStrong.Text = "";
        this.ShuiniCode.Text = "";
        this.Taluodu.Text = "";
        this.SjName.Text = "";
        this.dCarFl.Text = "";
        this.TotalFl.Text = "";
        this.StartTime.Text = "";
        this.CarCode.Text = "";
        this.EndTime.Text = "";
        this.XwTime.Text = "";
        this.OperPerson.Text = "";
        this.DiaoduOper.Text = "";
        this.PrintTime.Value = DateTime.Now.ToShortTimeString().ToString();
    }
    protected void lkbsave_Click(object sender, EventArgs e)
    {
        this.lbkLook.Enabled = true;
        Vouchers voucher = new Vouchers();
        voucher.PrintTime = Convert.ToDateTime(this.PrintTime.Text.Trim());
        voucher.XZMode = this.XZMode.Text.ToString();
        voucher.CustomerName = this.CustomerName.Text.Trim();
        voucher.EngineName = this.EngineName.Text.Trim();
        voucher.EngineLocal = this.EngineLocal.Text.Trim();
        voucher.GiveLocal = this.GiveLocal.Text.Trim();
        voucher.FiteCode = this.FiteCode.Text.Trim();
        voucher.TongStrong = this.TongStrong.Text.Trim();
        voucher.ShuiniCode = this.ShuiniCode.Text.Trim();
        voucher.Taluodu = this.Taluodu.Text.Trim();
        voucher.SjName = this.SjName.Text.Trim();
        voucher.CarCode = this.CarCode.Text.Trim();
        voucher.dCarFl = this.dCarFl.Text.Trim();
        voucher.TotalFl = this.TotalFl.Text.Trim();
        voucher.StartTime = Convert.ToDateTime(this.StartTime.Text.Trim());
        voucher.EndTime = Convert.ToDateTime(this.EndTime.Text.Trim());
        voucher.XwTime = Convert.ToDateTime(this.XwTime.Text.Trim());
        voucher.OperPerson = this.OperPerson.Text.Trim();
        voucher.DiaoduOper = this.DiaoduOper.Text.Trim();

        Boolean flag = voucher.InsertNumbser();
        if (flag)
        {

            Response.Write("<script>alert('保存成功!')</script>");
            //设置控件不可用
            this.CustomerName.ReadOnly = false;
            this.XZMode.ReadOnly = false;
            this.EngineLocal.ReadOnly = false;
            this.FiteCode.ReadOnly = false;
            this.EngineName.ReadOnly = false;
            this.GiveLocal.ReadOnly = false;
            this.TongStrong.ReadOnly = false;
            this.ShuiniCode.ReadOnly = false;
            this.Taluodu.ReadOnly = false;
            this.SjName.ReadOnly = false;
            this.dCarFl.ReadOnly = false;
            this.TotalFl.ReadOnly = false;
            this.StartTime.ReadOnly = false;
            this.CarCode.ReadOnly = false;
            this.EndTime.ReadOnly = false;
            this.XwTime.ReadOnly = false;
            this.OperPerson.ReadOnly = false;
            this.DiaoduOper.ReadOnly = false;
            this.htCode.ReadOnly = false;
            this.lkbsave.Enabled = true;
            this.PrintTime.ReadOnly = false;
          
            Response.Redirect("DocWrite.aspx");
        }
        else
        {
            Response.Write("<script>alert('出现异常')</script>");
        }
    }
    protected void lbkLook_Click(object sender, EventArgs e)
    {
        Response.Redirect("../SummaryToDetail/Detail.aspx?ProductID=" + Convert.ToInt32(this.htCode.Text.Trim()));
    }
    protected void lkbclose_Click(object sender, EventArgs e)
    {
        this.WebDialogWindow1.WindowState = Infragistics.Web.UI.LayoutControls.DialogWindowState.Hidden;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -