public void BindMakerGrid() { BLL_Infra_SupplierList objSupp = new BLL_Infra_SupplierList(); int rowcount = ucCustomPagerItems.isCountRecord; string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); int? sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString()); } DataTable dt = objSupp.Get_Suppliers_List_Search(txtfilter.Text != "" ? txtfilter.Text : null, sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); if (ucCustomPagerItems.isCountRecord == 1) { ucCustomPagerItems.CountTotalRec = rowcount.ToString(); ucCustomPagerItems.BuildPager(); } if (dt.Rows.Count > 0) { gvSuppliers.DataSource = dt; gvSuppliers.DataBind(); } else { gvSuppliers.DataSource = dt; gvSuppliers.DataBind(); } }
protected void btnsave_Click(object s, EventArgs e) { BLL_Infra_SupplierList objSupp = new BLL_Infra_SupplierList(); if (ValidateScope()) { if (HiddenFlag.Value == "Add") { objSupp.Ins_Supplier_Details(Session["USERID"].ToString(), txtMakerName_AV.Text, txtAddress_AV.Text, txtAddress2_AV.Text, ddlCountry_AV.SelectedValue, txtEmail_AV.Text, txtEmail2_AV.Text , txtPhone_AV.Text, txtPhone2_AV.Text, txtFax_AV.Text, txtFax2_AV.Text, txtTelex_AV.Text, txtTelex2_AV.Text, "", txtMakerCode_AV.Text, ddlSupplierType.SelectedValue, SupplierScope(), ddlCurrency.SelectedItem.Text, txtShortName.Text.Trim()); } else { objSupp.Upd_Suppliers_Details(Convert.ToInt32(ViewState["SUPPLIER_ID"].ToString()), Session["USERID"].ToString(), txtMakerName_AV.Text, txtAddress_AV.Text, txtAddress2_AV.Text, ddlCountry_AV.SelectedValue , txtEmail_AV.Text, txtEmail2_AV.Text, txtPhone_AV.Text, txtPhone2_AV.Text, txtFax_AV.Text, txtFax2_AV.Text, txtTelex_AV.Text, txtTelex2_AV.Text, "", txtMakerCode_AV.Text, ddlSupplierType.SelectedValue, SupplierScope(), ddlCurrency.SelectedItem.Text, txtShortName.Text.Trim()); } string hideMaker = String.Format("hideModal('divadd')"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hideMaker", hideMaker, true); ClearControls(); BindMakerGrid(); } else { string hideMaker = String.Format("hideModal('divadd')"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hideMaker", hideMaker, true); } }
protected void lbtnDelete_Click(object s, CommandEventArgs e) { BLL_Infra_SupplierList objSupp = new BLL_Infra_SupplierList(); objSupp.Del_Supplier_Details(Convert.ToInt32(e.CommandArgument.ToString()), Session["USERID"].ToString()); BindMakerGrid(); }
protected void ImgExpExcel_Click(object sender, EventArgs e) { //BLL_Infra_Supplier objSupp = new BLL_Infra_Supplier(); BLL_Infra_SupplierList objSupp = new BLL_Infra_SupplierList(); int rowcount = ucCustomPagerItems.isCountRecord; string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); int? sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString()); } //DataTable dt = objSupp.Get_Suppliers_List_Search(txtfilter.Text != "" ? txtfilter.Text : null, sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); DataTable dt = objSupp.Get_Suppliers_List_Search(txtfilter.Text != "" ? txtfilter.Text : null, sortbycoloumn, sortdirection, null, null, ref rowcount); string[] HeaderCaptions = { "Code", "Name", "Currency", "Country", "Email", "Address", "Phone", "Fax", "Telex" }; string[] DataColumnsName = { "Supplier_Code", "Supplier_Name", "Supplier_Currency", "Country", "Email", "Address_1", "Phone", "fax", "TELEX" }; GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "Supplier", "Supplier", ""); }
protected void onUpdate(object s, CommandEventArgs e) { BLL_Infra_SupplierList objSupp = new BLL_Infra_SupplierList(); HiddenFlag.Value = "Edit"; OperationMode = "Edit Supplier"; DataTable dtSuppDtl = objSupp.Get_Suppliers_Details(Convert.ToInt32(e.CommandArgument.ToString())); ViewState["SUPPLIER_ID"] = dtSuppDtl.Rows[0]["SUPPLIER_ID"].ToString(); txtAddress_AV.Text = dtSuppDtl.Rows[0]["ADDRESS_1"].ToString(); txtAddress2_AV.Text = dtSuppDtl.Rows[0]["ADDRESS_2"].ToString(); txtCreationDate_AV.Text = dtSuppDtl.Rows[0]["Created_Date"].ToString(); txtEmail_AV.Text = dtSuppDtl.Rows[0]["Email1"].ToString(); txtEmail2_AV.Text = dtSuppDtl.Rows[0]["Email2"].ToString(); txtFax_AV.Text = dtSuppDtl.Rows[0]["Fax1"].ToString(); txtFax2_AV.Text = dtSuppDtl.Rows[0]["Fax2"].ToString(); txtPhone_AV.Text = dtSuppDtl.Rows[0]["PHONE1"].ToString(); txtPhone2_AV.Text = dtSuppDtl.Rows[0]["PHONE2"].ToString(); txtMakerCode_AV.Text = dtSuppDtl.Rows[0]["Supplier_Code"].ToString(); txtMakerName_AV.Text = dtSuppDtl.Rows[0]["Full_NAME"].ToString(); txtShortName.Text = Convert.ToString(dtSuppDtl.Rows[0]["Supplier_Name"]); txtTelex_AV.Text = dtSuppDtl.Rows[0]["TELEX1"].ToString(); txtTelex2_AV.Text = dtSuppDtl.Rows[0]["TELEX2"].ToString(); ddlCountry_AV.ClearSelection(); ListItem list = ddlCountry_AV.Items.FindByValue(dtSuppDtl.Rows[0]["Country"].ToString()); if (list != null) { list.Selected = true; } txtCreationDate_AV.Enabled = false; ddlSupplierType.SelectedValue = dtSuppDtl.Rows[0]["supplier_Type"].ToString(); //if(dtSuppDtl.Rows[0]["Supplier_Currency"].ToString()!="") // ddlCurrency.SelectedValue = dtSuppDtl.Rows[0]["Supplier_Currency"].ToString(); if (ddlCurrency.Items.FindByValue(dtSuppDtl.Rows[0]["Supplier_Currency"].ToString()) != null) { ddlCurrency.SelectedValue = dtSuppDtl.Rows[0]["Supplier_Currency"].ToString() != "" ? dtSuppDtl.Rows[0]["Supplier_Currency"].ToString() : "0"; } else { ddlCurrency.SelectedValue = "0"; } string[] scoplist = dtSuppDtl.Rows[0]["supplier_scope"].ToString().Split(','); cblSupplier.ClearSelection(); for (int i = 0; i < scoplist.Length - 1; i++) { ListItem list1 = cblSupplier.Items.FindByValue(scoplist[i].Replace("'", "")); if (list1 != null) { list1.Selected = true; } } string AddMaker = String.Format("showModal('divadd',false);"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddMaker", AddMaker, true); }