コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                lblUsername.Text = "Hello " + Session["username"];
                if (Session["username"].ToString() == "")
                {
                    throw new Exception();
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("Login.aspx");
            }
            client = (ConsumerManagementService.ConsumerManagementServiceClient)
                     Session["client"];

            btnYes.Click += new System.EventHandler(this.btn_Clicked);
            btnNo.Click  += new System.EventHandler(this.btn_Clicked);
            List <ConsumerManagementService.Consumer> list = client.getConsumerID(Session["consumerId"].ToString()).ToList();

            lblConsumerId.Text = list[0].ConsumerID.ToString();
            lblFirstName.Text  = list[0].FirstName;
            lblLastName.Text   = list[0].LastName;
            lblCity.Text       = list[0].City;
            lblBillAmount.Text = list[0].BillAmount.ToString();
            lblDueDate.Text    = list[0].DueDate.ToString();
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            client = new ConsumerManagementService.ConsumerManagementServiceClient();

            btnLogin.Click    += new System.EventHandler(this.btn_Clicked);
            btnReset.Click    += new System.EventHandler(this.btn_Clicked);
            lblError.ForeColor = System.Drawing.Color.Red;
        }
コード例 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         lblUsername.Text = "Hello " + Session["username"];
         if (Session["username"].ToString() == "")
         {
             throw new Exception();
         }
     }
     catch (Exception ex)
     {
         Response.Redirect("Login.aspx");
     }
     client = (ConsumerManagementService.ConsumerManagementServiceClient)
              Session["client"];
     lblError.ForeColor = System.Drawing.Color.Red;
 }
コード例 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                lblUsername.Text = "Hello " + Session["username"];
                if (Session["username"].ToString() == "")
                {
                    throw new Exception();
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("Login.aspx");
            }
            client = (ConsumerManagementService.ConsumerManagementServiceClient)
                     Session["client"];

            lblConsumerId.ForeColor = System.Drawing.Color.Red;
            lblFirstName.ForeColor  = System.Drawing.Color.Red;
            lblLastName.ForeColor   = System.Drawing.Color.Red;
            lblCity.ForeColor       = System.Drawing.Color.Red;
            lblBillAmount.ForeColor = System.Drawing.Color.Red;
            lblDueDate.ForeColor    = System.Drawing.Color.Red;

            btnAdd.Click   += new EventHandler(this.btn_Click);
            btnReset.Click += new EventHandler(this.btn_Click);

            if (Session["operation"] != null && Session["operation"].Equals("edit"))
            {
                List <ConsumerManagementService.Consumer> list = client.getConsumerID(Session["consumerId"].ToString()).ToList();
                tbConsumerID.Text    = list[0].ConsumerID.ToString();
                tbConsumerID.Enabled = false;
                tbFirstName.Text     = list[0].FirstName;
                tbLastName.Text      = list[0].LastName;
                tbCity.Text          = list[0].City;
                tbBillAmount.Text    = list[0].BillAmount.ToString();
                tbDueDate.Text       = list[0].DueDate.ToString("yyyy-MM-dd");
                btnAdd.Text          = "Update";
            }
        }