예제 #1
0
        private void loadCustomerDetails(int custId)
        {
            Customer objcust = DBManagement.getCustomerByID(custId);

            lblAddress1.Text = objcust.Address;
            lblAddress2.Text = objcust.City + ", " + objcust.State + " " + objcust.ZipCode;
            lblPhone.Text    = objcust.Phone;
            lblEmail.Text    = objcust.Email;
        }
예제 #2
0
        protected void btnAddCList_Click(object sender, EventArgs e)
        {
            int      custId  = Convert.ToInt32(ddlCustomerList.SelectedValue);
            Customer objcust = DBManagement.getCustomerByID(custId);

            CustomerList objCustList = (CustomerList)Session["CustomerList"];

            objCustList.AddItem(objcust);

            Session["CustomerList"] = objCustList;
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataSet ds = DBManagement.getAllCustomers();

                if (ds != null)
                {
                    ddlCustomerList.DataSource     = ds.Tables[0].DefaultView;
                    ddlCustomerList.DataTextField  = "Name";
                    ddlCustomerList.DataValueField = "CustomerID";
                    ddlCustomerList.DataBind();

                    ddlCustomerList.SelectedIndex = 0;

                    int custId = Convert.ToInt32(ddlCustomerList.SelectedValue);
                    loadCustomerDetails(custId);
                }
            }
        }
예제 #4
0
        protected void btnGetIncidents_Click(object sender, EventArgs e)
        {
            List <Incident> objIncidentList = DBManagement.getIncidentByCustID(Convert.ToInt32(txtCustomerId.Text.Trim()));

            if (objIncidentList.Count > 0)
            {
                enabledControls();
                ListItem item = new ListItem("--Select an incident--", "None");
                lstBxIncidents.Items.Add(item);
                foreach (Incident i in objIncidentList)
                {
                    item = new ListItem(i.CustomerIncidentDisplay(), i.IncidentID.ToString());
                    lstBxIncidents.Items.Add(item);
                }

                lstBxIncidents.Focus();
            }
            else
            {
                disabledControls();
                lblMessage.Text = "No closed incident found with given CustomerID.";
            }
        }