示例#1
0
 private void BindGrid()
 {
     Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, Session["EnterpriseID"].ToString());
     DataTable dt = dal.GetViewRecord(ViewState["StrWhere"].ToString());
     this.GridView1.DataSource = dt;
     this.GridView1.DataBind();
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["cnKey"] != null)
            cnKey = Session["cnKey"].ToString();
        ID = Request.QueryString["ID"] + "";
        FormID = Request.QueryString["FormID"] + "";

        if (!IsPostBack)
        {
            //ViewState["StrWhere"] = string.Format(" ResumeID='{0}'", ID);
            ViewState["StrWhere"] = string.Format(" ResumeID='{0}' and EnterpriseID='{1}'", ID, Session["EnterpriseID"].ToString());
            Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey);
            if (ID != "")
            {
                DataTable dt = dal.GetViewRecord(ViewState["StrWhere"].ToString());
                BindData(dt);
                this.txtResumeID.ReadOnly = true;
                //this.txtProductName.ReadOnly = true;
            }
            else
            {
                this.txtResumeID.Text = dal.GetMaxID("EnterpriseID='" + Session["EnterpriseID"].ToString() + "'  and flag=2");
                this.txtLastModifyUserName.Text = Session["User"].ToString();
                this.txtLastModifyDate.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm");
                this.txtCreateUserName.Text = Session["User"].ToString();
                this.txtCreateDate.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm");
            }
            this.txtEnterpriseID.Text = Session["EnterPriseID"].ToString();
            this.txtEnterpriseName.Text = Session["EnterpriseName"].ToString();
        }
    }
示例#3
0
    protected void btnBUCheck_Click(object sender, EventArgs e)
    {
        DataRow dr = ((DataTable)ViewState["dt"]).Rows[0];
        Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey);

        if (this.txtBU_CheckUserName.Text.Length > 0)
        {
            dr["CheckUserName"] = "";
            dr["CheckDate"] = DBNull.Value;
        }
        else
        {
            dr["CheckUserName"] = Session["User"].ToString();
            dr["CheckDate"] = DateTime.Now;
        }
        dal.Update(dr, this.txtBillID.Text);
        DataTable dt = dal.GetViewRecord(string.Format(_strWhere, this.txtBillID.Text));

        BindData(dt);
    }
示例#4
0
    protected void btnBillState_Click(object sender, EventArgs e)
    {
        DataRow dr = ((DataTable)ViewState["dt"]).Rows[0];
        Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey);

        if (this.ddlBillState.SelectedIndex == 0)
        {
            dr["BillState"] = 1;
        }
        else
        {
            dr["BillState"] = 0;
        }
        dr["LastModifyDate"] = DateTime.Now;
        dr["LastModifyUserName"] = Session["User"].ToString();

        dal.Update(dr, this.txtBillID.Text);
        DataTable dt = dal.GetViewRecord(string.Format(_strWhere, this.txtBillID.Text));

        BindData(dt);
    }
示例#5
0
    protected void WebReport1_StartReport(object sender, EventArgs e)
    {
        //WebReport1.Report = new FastReport.SimpleList();
        WebReport1.Report = new Report();
        //System.IO.StreamReader dd = new System.IO.StreamReader(@"D:\Untitled.frx");
        //WebReport1.Report.LoadFromString(new System.IO.StreamReader(@"D:\Untitled.frx").ReadToEnd());
        //WebReport1.Report.Load(dd);
        WebReport1.Report.Load(@"D:\Untitled.frx");

        Js.BLL.BaseDal dal = new Js.BLL.BaseDal("LB_Style", "Label");
        WebReport1.Report.RegisterData(dal.GetViewRecord("1=1 and id = 'A0001_A02'"), "LB_Style");
        //WebReport1.Report.Dictionary.Connections[0].ConnectionString = "server=(local);database=SDOPDB;uid=sa;pwd=a@1";
        //WebReport1.Report.Dictionary.p
        //WebReport1.Report.Dictionary.
        //FastReport.Data.ParameterCollection para = WebReport1.Report.Dictionary.Parameters;
        //para[0].Value = "1003";
        //WebReport1.Report.Dictionary.Connections[0].ConnectionString = "Provider=SQLOLEDB.1;Password=a@1;Persist Security Info=True;User ID=sa;Initial Catalog=rptdata01;Data Source=ACER-PC";
        return;
        //RegisterData(WebReport1.Report);
    }
示例#6
0
 protected void btnEstimate_Click(object sender, EventArgs e)
 {
     //HdnSubDetail1
     Js.DAO.Label.OrderDao orddao = new Js.DAO.Label.OrderDao(FormID, cnKey);
     orddao.ChangeEstimate(this.txtBillID.Text, HdnSubDetail1.Value);
     Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey);
     DataTable dt = dal.GetViewRecord(string.Format(_strWhere, this.txtBillID.Text));
     BindData(dt);
 }
示例#7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ID = Request.QueryString["ID"] + "";
        FormID = Request.QueryString["FormID"] + "";
        if (!IsPostBack)
        {
            BindDropDownList();
            //ViewState["StrWhere"] = string.Format(" BillID='{0}'", ID);
            Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey);
            DataTable dt = dal.GetViewRecord(string.Format(_strWhere, ID));
            Js.BLL.Sys.SysComDal sdal = new Js.BLL.Sys.SysComDal(cnKey);

            BindData(dt);
            if (sdal.GetBillCanBeEdit(FormID, ID) > 0)
                this.btnEdit.Enabled = false;

            if ("" + Session["UserType"] == "EP")
            {
                this.btnBUCheck.Visible = false;
            //    this.GridView1.Columns[7].Visible = false;
            //    this.GridView1.Columns[15].Visible = false;
            //    this.GridView1.Columns[19].Visible = false;
            //    this.GridView1.Columns[24].Visible = false;
            //    this.GridView1.Columns[25].Visible = false;
            }
            //else
            //{
            //    this.btnEPCheck.Visible = false;
            //}
            this.txtTotalPages.Attributes.Add("style", "text-align:right");

            writeJsvar(FormID, cnKey, "");
        }
    }
示例#8
0
    protected void btnOrdPreNO_Click(object sender, EventArgs e)
    {
        Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey);
        DataTable dtSub1 = dal.GetSubDetail(this.txtBillID.Text).Tables[0];
        DataTable newdtb = Js.Com.JsonHelper.Json2Dtb(HdnSubDetail1.Value);
        for (int i = 0; i < newdtb.Rows.Count; i++)
        {
            DataRow dr1 = dtSub1.Rows[i];
            for (int j = 0; j < newdtb.Columns.Count; j++)
            {
                dr1[newdtb.Columns[j].ColumnName] = newdtb.Rows[i][j];
            }
        }
        dtSub1.TableName = "LB_OrderSub";
        dal.SaveDetail(dtSub1, this.txtBillID.Text);
        if (((Button)sender).ClientID == "btnCancelOrdNo") new Js.DAO.Label.OrderDao(FormID, cnKey).updateBillState(this.txtBillID.Text);

        DataTable dt = dal.GetViewRecord(string.Format(_strWhere, this.txtBillID.Text));
        BindData(dt);

        //Response.Redirect("OrderView.aspx?FormID=" + Server.UrlEncode(FormID) + "&ID=" + Server.UrlEncode(this.txtBillID.Text));
    }
    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();
        }
    }
示例#10
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();
        }
    }