コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            customerTableAdapter daCustomer = new customerTableAdapter();

            if (!User.Identity.IsAuthenticated)
            {
                Response.Redirect("~/Login.aspx");
            }

            daCustomer.Update(dsCustomer);
            daCustomer.Fill(dsCustomer.customer);

            foreach (DataRow r in dsCustomer.customer)
            {
                TableRow tblRow = new TableRow();

                TableCell linkButtons  = new TableCell();
                TableCell firstName    = new TableCell();
                TableCell lastName     = new TableCell();
                TableCell phoneNumber  = new TableCell();
                TableCell custAddress  = new TableCell();
                TableCell custCity     = new TableCell();
                TableCell custPostal   = new TableCell();
                TableCell emailAddress = new TableCell();

                linkButtons.Controls.Add(new LinkButton {
                    Text = "Edit", PostBackUrl = "Customer_Edit.aspx?val=" + r.ItemArray[0].ToString()
                });
                linkButtons.Controls.Add(new Literal {
                    Text = "<br />"
                });
                linkButtons.Controls.Add(new LinkButton {
                    Text = "Delete", PostBackUrl = "Customer_Delete.aspx?val=" + r.ItemArray[0].ToString()
                });

                firstName.Text    = r.ItemArray[1].ToString();
                lastName.Text     = r.ItemArray[2].ToString();
                phoneNumber.Text  = r.ItemArray[3].ToString();
                custAddress.Text  = r.ItemArray[4].ToString();
                custCity.Text     = r.ItemArray[5].ToString();
                custPostal.Text   = r.ItemArray[6].ToString();
                emailAddress.Text = r.ItemArray[7].ToString();

                tblRow.Cells.Add(linkButtons);
                tblRow.Cells.Add(firstName);
                tblRow.Cells.Add(lastName);
                tblRow.Cells.Add(phoneNumber);
                tblRow.Cells.Add(custAddress);
                tblRow.Cells.Add(custCity);
                tblRow.Cells.Add(custPostal);
                tblRow.Cells.Add(emailAddress);

                this.tblCustomers.Rows.Add(tblRow);
            }

            this.ddlManagement.Items[0].Attributes.Add("style", "color:#009900");
            this.ddlManagement.Items[0].Attributes.Add("disabled", "disabled");
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!User.Identity.IsAuthenticated)  //if not logged in
            {
                Response.Redirect("/");
            }

            try
            {
                dsCustomer = new CustomerDataSet();
                customerTableAdapter daCustomer = new customerTableAdapter();
                daCustomer.Fill(dsCustomer.customer);


                if (Request.Cookies["ID"] != null) // Request the cookies which contaions the ID Of thr record that was carried over from the index page
                {
                    id = Convert.ToInt32(Request.Cookies["ID"].Value);
                }
                if (Request.Cookies["Action"] != null && Request.Cookies["Action"].Value == "Delete")
                {
                    pnlDeleteConfirm.Visible = true;
                    lblTitle.Text            = "Delete Customer";
                }
                else
                {
                    pnlDeleteConfirm.Visible = false;
                }
            }
            catch { return; }

            if (id != -1)
            {
                try
                {
                    DataRow customer = dsCustomer.customer.FindByID(id); // Find the related Record and fill the fields in the page with the data

                    if (customer != null)
                    {
                        this.txtID.Text      = customer.ItemArray[0].ToString();
                        this.txtFName.Text   = customer.ItemArray[1].ToString();
                        this.txtLName.Text   = customer.ItemArray[2].ToString();
                        this.txtPhone.Text   = customer.ItemArray[3].ToString();
                        this.txtAddress.Text = customer.ItemArray[4].ToString();
                        this.txtCity.Text    = customer.ItemArray[5].ToString();
                        this.txtPCode.Text   = customer.ItemArray[6].ToString();
                        this.txtEmail.Text   = customer.ItemArray[7].ToString();
                    }
                    else
                    {
                        lblStatus.Text = "Record doesn't exist";
                    }
                }
                catch
                {
                    lblStatus.Text = "Database Error";
                }
            }
        }
コード例 #3
0
        static NewCustomer()
        {
            customerTableAdapter daCustomer = new customerTableAdapter();

            try
            {
                daCustomer.Fill(dsCustomer.customer);
            }
            catch { }
        }
コード例 #4
0
ファイル: Sale2.aspx.cs プロジェクト: FredFishy/Blue-Fish
        protected void Page_Load(object sender, EventArgs e)
        {
            customerTableAdapter cust = new customerTableAdapter();

            cust.Fill(dsSale.customer);
            DataRow[] custRows = dsSale.customer.Select();
            foreach (DataRow r in custRows)
            {
                lbCustomer.Items.Add(r.ItemArray[1].ToString() + " - " + r.ItemArray[2].ToString());
            }
        }
コード例 #5
0
        static OrderSearch()
        {
            dsEmmas = new EmmasDataSet();

            CustomerServiceTableAdapter daCustomerService = new CustomerServiceTableAdapter();
            customerTableAdapter        daCustomer        = new customerTableAdapter();


            try
            {
                daCustomer.Fill(dsEmmas.customer);
            }
            catch { }
        }
コード例 #6
0
        static CustomerOrderSearch()
        {
            dsEmmas = new EmmasDataSet();

            CustomerServiceTableAdapter daCustomerService = new CustomerServiceTableAdapter();
            customerTableAdapter        daCustomer        = new customerTableAdapter();

            try
            {
                daCustomer.Fill(dsEmmas.customer);
                //daCustomerOrder.Fill(dsEmmas.CustomerOrder, 1);
                //daCustomerOrder.Ge
                //    daInventory.Fill(dsCustomer.CustomerInventory);
            }
            catch { }
        }
コード例 #7
0
ファイル: PlaceSales.aspx.cs プロジェクト: ldgmaia/PROG1180
        static PlaceSales()
        {
            dsEmmas = new EmmasDataSet();

            CustomerServiceTableAdapter daCustomerService = new CustomerServiceTableAdapter();
            customerTableAdapter        daCustomer        = new customerTableAdapter();
            InventoryTableAdapter       daInventory       = new InventoryTableAdapter();


            try
            {
                daCustomer.Fill(dsEmmas.customer);
                daInventory.Fill(dsEmmas.Inventory);
            }
            catch { }
        }
コード例 #8
0
        private void button4_Click(object sender, EventArgs e)
        {
            try
            {
                customerTableAdapter          c  = new customerTableAdapter();
                customerSet.customerDataTable cd = new customerSet.customerDataTable();
                c.Fill(cd);
                allcustomer rpt = new allcustomer();
                rpt.SetDataSource(cd[0].Table);


                Report_Viewer vd = new Report_Viewer();
                vd.crystalReportViewer1.ReportSource = rpt;
                vd.ShowDialog();
            }
            catch (Exception)
            {
                MessageBox.Show("There Is No Customer");
            }
        }
コード例 #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!User.Identity.IsAuthenticated)  //if not logged in
            {
                Response.Redirect("/");
            }

            try
            {
                dsCustomer = new CustomerDataSet();
                customerTableAdapter daCustomer = new customerTableAdapter();
                daCustomer.Fill(dsCustomer.customer);
                rows = (Session["criteria"] != null) ? dsCustomer.customer.Select(Session["criteria"].ToString()) : dsCustomer.customer.Select();
                DisplayCustomer();
            }
            catch
            {
            }
            //data loaded successfully
        }
コード例 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!User.Identity.IsAuthenticated)
            {
                Response.Redirect("~/Login.aspx");
            }

            customerTableAdapter daCustomer = new customerTableAdapter();
            custCityTableAdapter daCity     = new custCityTableAdapter();

            daCustomer.Fill(dsSales.customer);
            daCity.Fill(dsSales.custCity);

            this.ddlManagement.Items[0].Attributes.Add("style", "color:#009900");
            this.ddlManagement.Items[0].Attributes.Add("disabled", "disabled");

            if (this.IsPostBack)
            {
                return;
            }

            this.ddlCustomers.Items.Add("Pick a Customer...");
            this.ddlCustomers.Items[0].Attributes.Add("style", "color:gray");
            this.ddlCustomers.Items[0].Attributes.Add("disabled", "disabled");
            this.ddlCustomers.Items[0].Selected = true;

            this.ddlCity.Items.Add("Pick a City...");
            this.ddlCity.Items[0].Attributes.Add("style", "color:gray");
            this.ddlCity.Items[0].Attributes.Add("disabled", "disabled");
            this.ddlCity.Items[0].Selected = true;

            foreach (DataRow r in dsSales.customer)
            {
                this.ddlCustomers.Items.Add(r.ItemArray[1].ToString());
            }

            foreach (DataRow r in dsSales.custCity)
            {
                this.ddlCity.Items.Add(r.ItemArray[0].ToString());
            }
        }