예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ID = Request.QueryString["BillID"] + "";
        FormID = Request.QueryString["FormID"] + "";
        if (!IsPostBack)
        {
            ViewState["StrWhere"] = string.Format(" BillID='{0}'", ID);
            Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey);
            BindEdll();
            if (ID != "")
            {
                DataTable dt = dal.GetViewRecord(ViewState["StrWhere"].ToString());
                BindData(dt);
                this.txtBillID.ReadOnly = true;
                this.txtBillID.CssClass = "TextRead";
                this.txtStyleID.CssClass = "TextRead";
                this.txtProducePages.CssClass = "TextRead";
                this.txtStdPages.CssClass = "TextRead";
                this.btnImageQuery.Enabled = true;
                this.btnStyleQuery.Enabled = true;
            }
            else
            {
                this.txtBillID.Text = dal.GetAutoCode(DateTime.Now);
                this.txtBillDate.DateValue = DateTime.Now;
                this.txtLastModifyUserName.Text = Session["User"].ToString();
                this.txtLastModifyDate.Text = ToYMDHM(DateTime.Now);
                this.txtCreateUserName.Text = Session["User"].ToString();
                this.txtCreateDate.Text = ToYMDHM(DateTime.Now);
                this.ddlBillState.SelectedIndex = 1;
            }

            BindOther();
        }
    }
예제 #2
0
 public string autoCode(string FormID, string cnKey, string strdate)
 {
     Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey);
     return dal.GetAutoCode(DateTime.Parse(strdate));
 }
예제 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ID = Request.QueryString["BillID"] + "";
        FormID = Request.QueryString["FormID"] + "";
        if (!IsPostBack)
        {
            //後台ddl綁定
            //DataTable dt1 = new DataTable();
            //DataColumn dc = new DataColumn("id", typeof(string));
            //dt1.Columns.Add(dc);
            //DataRow dr;
            //dr = dt1.NewRow();
            //dr[0] = "";
            //dt1.Rows.Add(dr);
            //dr = dt1.NewRow();
            //dr[0] = "1";
            //dt1.Rows.Add(dr);
            //dr = dt1.NewRow();
            //dr[0] = "2";
            //dt1.Rows.Add(dr);
            //txtDeliverCountry.DataSource = dt1;
            //txtDeliverCountry.Text = "2";

            ViewState["StrWhere"] = string.Format(" BillID='{0}'", ID);
            Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey);
            if (ID != "")
            {
                DataTable dt = dal.GetViewRecord(ViewState["StrWhere"].ToString());
                BindData(dt);
                this.txtBillID.ReadOnly = true;
                this.txtBillID.CssClass = "TextRead";
            }
            else
            {
                this.txtBillID.Text = dal.GetAutoCode(DateTime.Now);
                this.txtBillDate.DateValue = DateTime.Now;
                this.txtLastModifyUserName.Text = Session["User"].ToString();
                this.txtLastModifyDate.Text = ToYMDHM(DateTime.Now);
                this.txtCreateUserName.Text = Session["User"].ToString();
                this.txtCreateDate.Text = ToYMDHM(DateTime.Now);
            }

            BindEdll();

            BindOther();
        }
    }