protected void BtnOk_Click(object sender, EventArgs e)
        {
            FrameWork.Customers cust = new FrameWork.Customers();
            cust.Company = txtCompanyName.Text;
            cust.Address = txtNo.Text + " " + txtStreet.Text + " " + ddlCountry.SelectedValue + " " + txtZipCode.Text;
            cust.TIN = txtTIN.Text;
            cust.LastName = txtLastName.Text;
            cust.FirstName = txtFirstName.Text;
            cust.EmailAddress = txtEmail.Text;
            cust.JobTitle = ddlDesignation.Text;
            cust.BusinessPhone = txtTelephone.Text;
            cust.FaxNumber = txtFax.Text;
            cust.ZipPostal = txtZipCode.Text;
            cust.WebPage = txtWebsite.Text;
            BusinessRule.busCustomer custs = new BusinessRule.busCustomer();
            string  x = custs.insertCustomer(cust);

            if (x.Trim() == string.Empty)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Successfully added new Customer')", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Failed to added new Customer')", true);
            }

            busCustomer buscust = new busCustomer();
            DataTable dt = new DataTable("customer");
            dt = buscust.allCustomer();
            //GridView1.DataSource = dt;
            //GridView1.DataBind();
        }
Example #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            FrameWork.Customers cust = new FrameWork.Customers();
            cust.Company       = txtCompanyName.Text;
            cust.Address       = txtNo.Text + " " + txtStreet.Text + " " + ddlCountry.SelectedValue + " " + txtZipCode.Text;
            cust.TIN           = txtTIN.Text;
            cust.LastName      = txtLastName.Text;
            cust.FirstName     = txtFirstName.Text;
            cust.EmailAddress  = txtEmail.Text;
            cust.JobTitle      = ddlDesignation.Text;
            cust.BusinessPhone = txtTelephone.Text;
            cust.FaxNumber     = txtFax.Text;
            cust.ZipPostal     = txtZipCode.Text;
            cust.WebPage       = txtWebsite.Text;
            BusinessRule.busCustomer custs = new BusinessRule.busCustomer();
            custs.insertCustomer(cust);

            busCustomer buscust = new busCustomer();

            DataTable dt = new DataTable("customer");

            dt = buscust.allCustomer();
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
Example #3
0
 protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     busCustomer buscust = new busCustomer();
     this.GridView1.PageIndex = e.NewPageIndex;
     DataTable dt = new DataTable("User");
     dt = buscust.allCustomer();
     GridView1.DataSource = dt;
     GridView1.DataBind();
 }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            if (!IsPostBack)
            {
                busCustomer buscust = new busCustomer();

                DataTable dt = new DataTable("User");

                dt = buscust.allCustomer();
                ViewState["Customer"] = dt;
                GridView1.DataSource = dt;
                GridView1.DataBind();

            }
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            if (!IsPostBack)
            {
                busCustomer buscust = new busCustomer();

                DataTable dt = new DataTable("User");
                dt = buscust.allCustomer();
                ViewState["Customer"] = dt;
                this.drpCustomer.Items.Clear();
                this.drpCustomer.Items.Add(new ListItem("select one", "0"));
                foreach (DataRow dr in dt.Rows)
                {
                    this.drpCustomer.Items.Add(new ListItem(dr["Company"].ToString(), dr["ID"].ToString()));
                }
                busProducts busProd = new busProducts();
                dt = new DataTable("User");
                dt = busProd.allProducts();
                ViewState["Products"] = dt;
                this.drpProduct.Items.Clear();
                this.drpProduct.Items.Add(new ListItem("select one", "0"));
                foreach (DataRow dr in dt.Rows)
                {
                    this.drpProduct.Items.Add(new ListItem(dr["ProductName"].ToString(), dr["ID"].ToString()));
                }
            }
        }