protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { busSupplier bussup = new busSupplier(); this.GridView1.PageIndex = e.NewPageIndex; DataTable dt = new DataTable("User"); dt = bussup.allSupplier(); GridView1.DataSource = dt; GridView1.DataBind(); }
protected void btnSave_Click(object sender, EventArgs e) { ////Hashtable htParameters = new Hashtable(); ////htParameters.Add("Mode", 0); ////htParameters.Add("Company",txtCompanyName.Text); ////htParameters.Add("LastName",txtLastName.Text); ////htParameters.Add("FirstName",txtFirstName.Text); ////htParameters.Add("EmailAddress",txtEmail.Text); ////htParameters.Add("JobTitle",ddlDesignation.Text); ////htParameters.Add("BusinessPhone",txtTelephone.Text); //////htParameters.Add("HomePhone",DBNull.Value); //// //,MobilePhone ////htParameters.Add("FaxNumber",txtFax.Text); ////htParameters.Add("Address",txtNo.Text + " " + txtStreet.Text + " " + ddlCountry.SelectedValue + " " + txtZipCode.Text); ////htParameters.Add("ZipPostal", txtZipCode.Text); ////htParameters.Add("WebPage", txtWebsite.Text); FrameWork.Suppliers supp = new FrameWork.Suppliers(); supp.Company = txtCompanyName.Text; supp.Address = txtNo.Text + " " + txtStreet.Text + " " + ddlCountry.SelectedValue + " " + txtZipCode.Text; supp.TIN = txtTIN.Text; supp.LastName = txtLastName.Text; supp.FirstName = txtFirstName.Text; supp.EmailAddress = txtEmail.Text; supp.JobTitle = ddlDesignation.Text; supp.BusinessPhone = txtTelephone.Text; supp.FaxNumber = txtFax.Text; supp.ZipPostal = txtZipCode.Text; supp.WebPage = txtWebsite.Text; BusinessRule.busSupplier supps = new BusinessRule.busSupplier(); supps.insertSupplier(supp); busSupplier bussup = new busSupplier(); DataTable dt = new DataTable("User"); dt = bussup.allSupplier(); GridView1.DataSource = dt; GridView1.DataBind(); //MainClass.Library.Command.Execute(htParameters, "SupplierMod"); //,City //,StateProvince //,ZipPostal //,CountryRegion //,WebPage //,Notes //,Attachments //,SupplierName //,FileAs }
protected void Page_Load(object sender, EventArgs e) { if (Session["user"] == null) { Response.Redirect("Login.aspx"); } if (!IsPostBack) { busSupplier bussup = new busSupplier(); DataTable dt = new DataTable("User"); dt = bussup.allSupplier(); ViewState["Supplier"] = dt; GridView1.DataSource = dt; GridView1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataTable dt = new DataTable("User"); 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())); } busSupplier busSup = new busSupplier(); dt = busSup.allSupplier(); ViewState["Supplier"] = dt; this.drpSupplier.Items.Clear(); this.drpSupplier.Items.Add(new ListItem("Select One", "0")); foreach (DataRow dr in dt.Rows) { this.drpSupplier.Items.Add(new ListItem(dr["Company"].ToString(), dr["ID"].ToString())); } } }
protected void BtnOk_Click(object sender, EventArgs e) { ////Hashtable htParameters = new Hashtable(); ////htParameters.Add("Mode", 0); ////htParameters.Add("Company",txtCompanyName.Text); ////htParameters.Add("LastName",txtLastName.Text); ////htParameters.Add("FirstName",txtFirstName.Text); ////htParameters.Add("EmailAddress",txtEmail.Text); ////htParameters.Add("JobTitle",ddlDesignation.Text); ////htParameters.Add("BusinessPhone",txtTelephone.Text); //////htParameters.Add("HomePhone",DBNull.Value); //// //,MobilePhone ////htParameters.Add("FaxNumber",txtFax.Text); ////htParameters.Add("Address",txtNo.Text + " " + txtStreet.Text + " " + ddlCountry.SelectedValue + " " + txtZipCode.Text); ////htParameters.Add("ZipPostal", txtZipCode.Text); ////htParameters.Add("WebPage", txtWebsite.Text); FrameWork.Suppliers supp = new FrameWork.Suppliers(); supp.Company = txtCompanyName.Text; supp.Address = txtNo.Text + " " + txtStreet.Text + " " + ddlCountry.SelectedValue + " " + txtZipCode.Text; supp.TIN = txtTIN.Text; supp.LastName = txtLastName.Text; supp.FirstName = txtFirstName.Text; supp.EmailAddress = txtEmail.Text; supp.JobTitle = ddlDesignation.Text; supp.BusinessPhone = txtTelephone.Text; supp.FaxNumber = txtFax.Text; supp.ZipPostal = txtZipCode.Text; supp.WebPage = txtWebsite.Text; BusinessRule.busSupplier supps = new BusinessRule.busSupplier(); string x = supps.insertSupplier(supp); if (x.Trim() == string.Empty) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Successfully added new Supplier')", true); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Failed to added new Supplier')", true); } busSupplier bussup = new busSupplier(); DataTable dt = new DataTable("User"); //dt = bussup.allSupplier(); //GridView1.DataSource = dt; //GridView1.DataBind(); //MainClass.Library.Command.Execute(htParameters, "SupplierMod"); //,City //,StateProvince //,ZipPostal //,CountryRegion //,WebPage //,Notes //,Attachments //,SupplierName //,FileAs }