Ejemplo n.º 1
0
    //protected string strdate = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["userCode"] == null || Session["userCode"].ToString().Trim() == "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "window.location.href='../Login.aspx','_self';", true);
            return;
        }
        if (!IsPostBack)
        {
            //strdate = DateTime.Now.ToString("yyyy-MM-dd");
            SysManager sysMgr = new SysManager();
            txtBillCode.Text = sysMgr.GetYbbxBillName("", DateTime.Now.ToString("yyyMMdd"), 1);
            string strType = Request.QueryString["type"];
            if (Page.Request.QueryString["djtype"] == null)
            {
                this.hd_djtype.Value = "ybbx";
                hfdydj.Value         = "02";
                this.lbdjmc.Text     = "费用报销单→表头信息";
            }
            else
            {
                this.hd_djtype.Value = Page.Request.QueryString["djtype"].ToString().Trim();
                this.lbdjmc.Text     = "其他报销单";
                hfdydj.Value         = "02";
            }


            IList <Bill_DataDic> list = (new SysManager()).GetDicByType("02");
            ddlBxmxlx.DataSource     = list;
            ddlBxmxlx.DataTextField  = "DicName";
            ddlBxmxlx.DataValueField = "DicCode";
            ddlBxmxlx.DataBind();

            //2014-04-28 beg
            if (!string.IsNullOrEmpty(Request["dydj"]) && Request["dydj"] == "sr")
            {
                this.hd_djtype.Value    = Page.Request.QueryString["dydj"].ToString().Trim();
                this.lbdjmc.Text        = "收入单";
                ddlBxmxlx.SelectedValue = "04";
            }
            //2014-04-28 end

            //2014-04-29 beg
            if (!string.IsNullOrEmpty(Request["dydj"]) && Request["dydj"] == "gdzcgz")
            {
                this.hd_djtype.Value    = Page.Request.QueryString["dydj"].ToString().Trim();
                hfdydj.Value            = "03";
                this.lbdjmc.Text        = "固定资产购置单";
                ddlBxmxlx.SelectedValue = "05";
            }
            //2014-04-29 end


            txtBillDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
            txtZdr.Text      = server.GetCellValue("select '['+usercode+']'+userName  from bill_users where userCode='" + Session["userCode"] + "'");
            txtBillDept.Text = server.GetCellValue("select '['+a.deptCode+']'+a.deptName  as dept from bill_departments a,bill_users b where a.deptCode=b.userDept and b.userCode='" + Session["userCode"] + "'");
            BindGk();
        }
    }