コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PFCERPConnectionString = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["PFCERPConnectionString"]);
        Ajax.Utility.RegisterTypeForAjax(typeof(ItemBuilderBuilder));
        btnVerify.Attributes.Add("OnClick", "javascript:return SubmitForm()");

        if (!IsPostBack)
        {
            GetSecurity();
            itembuilder.BindListControls(ddlAliasType, "ListDesc", "ListValue", itembuilder.GetAliasType(hidSubItemSec.Value.ToString()));

            lblStatus.Text = "";

            if (Request.QueryString["UserName"] != null)
            {
                Session["CustNo"]   = Request.QueryString["CustomerNumber"].ToString();
                Session["UserName"] = Request.QueryString["UserName"].ToString();
                string chkDCUser = Session["UserName"].ToString().Trim();
                if (chkDCUser == "DC")
                {
                    Header1.Visible   = false;
                    btnUpload.Visible = true;
                    btnCancel.Visible = true;
                    btnVerify.Visible = false;
                    btnClose.Visible  = false;
                }
                else
                {
                    Header1.Visible     = true;
                    btnUpload.Visible   = false;
                    btnCancel.Visible   = false;
                    btnVerify.Visible   = true;
                    btnClose.Visible    = true;
                    rdoExcel.Enabled    = true;
                    rdoText.Enabled     = true;
                    rdoRealTime.Enabled = true;
                    rdoBatch.Enabled    = true;

                    //2010-Apr-20 - Remove "Realtime" option
                    rdoRealTime.Checked = false;
                    rdoRealTime.Enabled = false;
                    rdoRealTime.Visible = false;
                    rdoText.Checked     = false;
                    rdoText.Enabled     = false;
                    rdoText.Visible     = false;
                    rdoBatch.Checked    = true;
                    rdoExcel.Checked    = true;
                }
            }

            if (rdoBatch.Checked == true)
            {
                rdoText.Checked  = false;
                rdoExcel.Checked = true;
                rdoText.Enabled  = false;
            }
            else
            {
                rdoText.Enabled = true;
            }

            uplXRefFile.Enabled = true;

            string customerNo = Session["CustNo"].ToString();
            if (customerNo != "000000")
            {
                dtCustomerInformation = itembuilder.GetCustomerID(customerNo);
                lblCustomerName.Text  = dtCustomerInformation.Rows[0]["Name1"].ToString();
                lblAddress.Text       = dtCustomerInformation.Rows[0]["AddrLine1"].ToString();
                lblCity.Text          = dtCustomerInformation.Rows[0]["City"].ToString();
                lblState.Text         = dtCustomerInformation.Rows[0]["State"].ToString();
                lblPostCd.Text        = dtCustomerInformation.Rows[0]["PostCd"].ToString();
            }
            else
            {
                lblCustomerName.Text = "Customer #000000";
                lblAddress.Text      = "Generic Cross Reference Item Entry";
                lblCity.Text         = "";
                lblState.Text        = "";
                lblPostCd.Text       = "";
            }
        }
    }