protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
            return;

        if (Request.QueryString["ID"] != null)
        {
            if (Request.QueryString["ID"] == "True")
            {
                //lblMsg.Visible = true;
                //lblMsg.Text = "Successfully Edited";
            }
        }

        if (Request.QueryString["companyid"] != null)
        {
            int companyid = Convert.ToInt32(Request.QueryString["companyid"]);
            dtCompany = taCompany.SelectAllCompanyByCompanyId(companyid);

            if (dtCompany.Rows.Count > 0)
            {
                    DataRow row = dtCompany.Rows[0];
                    lblCompany.Text = row["CompanyName"].ToString();
            }

        }

        BindData();
    }
Ejemplo n.º 2
0
 protected void LoadCompanies()
 {
     dtCompany = taCompany.SelectAllCompany();
     ddlCompany.DataSource = dtCompany;
     ddlCompany.DataTextField = dtCompany.Columns[1].ToString();
     ddlCompany.DataValueField = dtCompany.Columns[0].ToString();
     ddlCompany.DataBind();
 }
Ejemplo n.º 3
0
 protected void LoadCompanies()
 {
     dtCompany = taCompany.SelectAllCompany();
     ddlCompany.DataSource = dtCompany;
     ddlCompany.DataTextField = dtCompany.Columns[1].ToString();
     ddlCompany.DataValueField = dtCompany.Columns[0].ToString();
     ddlCompany.DataBind();
     ddlCompany.Items.Insert(0, new ListItem("Please select one", ""));
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
            return;

        if (Request.QueryString["ID"] != null)
        {
            if (Request.QueryString["ID"] == "True")
            {
                lblMsg.Visible = true;
                lblMsg.Text = "Successfully Edited";
            }
        }

        if (Request.QueryString["companyid"] != null)
        {
            int companyid = Convert.ToInt32(Request.QueryString["companyid"]);
            dtCompany = taCompany.SelectAllCompanyByCompanyId(companyid);

            if (dtCompany.Rows.Count > 0)
            {
                    DataRow row = dtCompany.Rows[0];
                    lblCompany.Text = row["CompanyName"].ToString();
                    txtAboutCompany.Text = row["AboutCompany"].ToString();
                    txtBrand.Text = row["Brand"].ToString();
                    txtOwner.Text = row["Owner"].ToString();
                    txtYearEstablished.Text = row["YearEstablished"].ToString();
                    txtContact.Text = row["Contact"].ToString();
                    txtEmail.Text = row["Email"].ToString();
                    txtTel1.Text = row["Tel1"].ToString();
                    txtFax1.Text = row["Fax1"].ToString();
                    txtURL.Text = row["URL"].ToString();
                    txtZipCode.Text = row["ZipCode"].ToString();
                    txtAddress.Text = row["Address"].ToString();
                    txtBusinessType.Text = row["BusinessType"].ToString();
                    txtMainProduct.Text = row["MainProduct"].ToString();
                    txtMainMarket.Text = row["MainMarket"].ToString();
                    txtApprovalCertificate.Text = row["ApprovalCertificate"].ToString();
                    txtMembership.Text = row["Membership"].ToString();
                    lblLogoName.Text = row["logoName"].ToString();
                    Image1.ImageUrl = "~/thumbnail.aspx?Image=Images/Logo/" + row["logoName"].ToString() ;

            }

        }
    }
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            LinkButton lbtnDelete = (LinkButton)e.Row.FindControl("lbtnDelete");
            lbtnDelete.Attributes.Add("OnClick", "return confirm('Are you sure to delete this record?');");

            Label lblCompanyId = (Label)e.Row.FindControl("lblCompanyId");
            if (lblCompanyId.Text != "")
            {
                dtCompany = taCompany.SelectCompanyNameFromCompanyId(Convert.ToInt32(lblCompanyId.Text));

                if (dtCompany.Rows.Count > 0)
                    lblCompanyId.Text = dtCompany[0].CompanyName.ToString();
                else
                    lblCompanyId.Visible = false;
            }
        }
    }
    private void BindData()
    {
        DataTable DT;
        ylib = new ylibWebClass(constr.connect());

        FillWebControlClass FCC = new FillWebControlClass();

        int CompanyId; int SubCategoryId; int CategoryId; int ProductGroupCode;

        #region SetListVariables

        CompanyId = StringOperation.QueryStringInt16Value(Request.QueryString["CompanyId"]);
        CategoryId = StringOperation.QueryStringInt16Value(Request.QueryString["CategoryId"]);
        SubCategoryId = StringOperation.QueryStringInt16Value(Request.QueryString["SubCategoryId"]);
        ProductGroupCode = StringOperation.QueryStringInt16Value(Request.QueryString["ProductGroupCode"]);

        #endregion

        #region FillDropDownLists

        dtCompany = taCompany.GetData();
        FCC.FillDropDownList(ref ddlCompany, dtCompany, "CompanyName", "CompanyId", true, true, CompanyId.ToString());

        dtCategory = taCategory.SelectCategorybyCompanyId(CompanyId);
        FCC.FillDropDownList(ref ddlCategory, dtCategory, "CategoryName", "CategoryId", true, true, CategoryId.ToString());

        dtSubCategory = taSubCategory.GetDataByCategoryId(CategoryId);
        FCC.FillDropDownList(ref ddlSubCategory, dtSubCategory, "SubCategoryName", "SubCategoryId", true, true, SubCategoryId.ToString());

        dtProductGroup = taProductGroup.GetDataBySubCategoryId(SubCategoryId);
        FCC.FillDropDownList(ref ddlProductGroupCode, dtProductGroup, "ProductGroupDescription", "ProductGroupCode", true, true, ProductGroupCode.ToString());

        #endregion

        #region SetSelectionLabel

        if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0 && ProductGroupCode != 0)
            lblGroupLevel.Text = "Product Group";
        else if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0)
            lblGroupLevel.Text = "Sub Category";
        else if (CompanyId != 0 && CategoryId != 0)
            lblGroupLevel.Text = "Category";
        else if (CompanyId != 0)
            lblGroupLevel.Text = "Company";

        #endregion

        #region Set Main Repeater Page Parts

        DT = ylib.GiveDataTable_BySQLStatement("select PagePartName from PageParts ");

        if (DT.Rows.Count > 0)
        {
            if (CompanyId != 0)
            {
                Repeater1.DataSource = DT;
                Repeater1.DataBind();
            }

        }
        else
        {
            lblMsg.Text = "No record found";
            return;
        }

        #endregion
    }
    private void BindData()
    {
        int SectionCode = 0;
        FillWebControlClass FCC = new FillWebControlClass();

        ylib = new ClassP.ylibWebClass(constr.connect());

        lblGroupLevel.Text = Request.QueryString["lblGroupLevel"];

        int CompanyId ;        int SubCategoryId ;        int CategoryId;        int ProductGroupCode ;

        #region SetListVariables

        SectionCode = StringOperation.QueryStringInt16Value(Request.QueryString["SectionCode"]);
        CompanyId = StringOperation.QueryStringInt16Value(Request.QueryString["CompanyId"]);
        CategoryId = StringOperation.QueryStringInt16Value(Request.QueryString["CategoryId"]);
        SubCategoryId = StringOperation.QueryStringInt16Value(Request.QueryString["SubCategoryId"]);
        ProductGroupCode = StringOperation.QueryStringInt16Value(Request.QueryString["ProductGroupCode"]);

        #region Write Cookies

        if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0 && ProductGroupCode != 0)
        {
            Response.Cookies["ProductGroupCode"].Value=ProductGroupCode.ToString();
            Response.Cookies["ProductGroupCode"].Expires=DateTime.Now.AddDays(1);
        }
        else if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0)
        {
            Response.Cookies["SubCategoryId"].Value=SubCategoryId.ToString();
            Response.Cookies["SubCategoryId"].Expires=DateTime.Now.AddDays(1);
        }
        else if (CompanyId != 0 && CategoryId != 0)
        {
            Response.Cookies["CategoryId"].Value = CategoryId.ToString();
            Response.Cookies["CategoryId"].Expires = DateTime.Now.AddDays(1);
        }
        else if (CompanyId != 0)
        {
            Response.Cookies["CompanyId"].Value = CompanyId.ToString();
            Response.Cookies["CompanyId"].Expires = DateTime.Now.AddDays(1);
        }

        #endregion

        #endregion

        lblSectionName.Text = ylib.giveValue("select SectionName from   MainPageSection where SectionCode=" + SectionCode);

        #region FillDropDownLists

        dtCompany = taCompany.GetData();
        FCC.FillDropDownList(ref ddlCompany, dtCompany, "CompanyName", "CompanyId",true,true,CompanyId.ToString());

        dtCategory = taCategory.SelectCategorybyCompanyId(CompanyId);
        FCC.FillDropDownList(ref ddlCategory, dtCategory, "CategoryName", "CategoryId", true, true, CategoryId.ToString());

        dtSubCategory = taSubCategory.GetDataByCategoryId(CategoryId);
        FCC.FillDropDownList(ref ddlSubCategory, dtSubCategory, "SubCategoryName", "SubCategoryId", true, true, SubCategoryId.ToString());

        dtProductGroup = taProductGroup.GetDataBySubCategoryId(SubCategoryId);
        FCC.FillDropDownList(ref ddlProductGroupCode, dtProductGroup, "ProductGroupDescription", "ProductGroupCode", true, true, ProductGroupCode.ToString());

        #endregion

        if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0 && ProductGroupCode!=0)
            dtProduct = taProduct.GetDataByProductGroupCode(ProductGroupCode);
        else
            dtProduct = taProduct.GetDataByProductGroupCode(0);

        if (dtProduct.Rows.Count > 0)
        {
            GridView1.DataSourceID = null;
            GridView1.DataSource = dtProduct;
            GridView1.DataBind();
        }
        else
        {
            GridView1.DataSourceID = null;
            GridView1.DataSource = dtProduct;
            GridView1.DataBind();
            lblMsg.Text = "No record found";
            return;
        }
    }
Ejemplo n.º 8
0
    private void BindData()
    {
        FillWebControlClass FCC = new FillWebControlClass();

        int CompanyId ;        int SubCategoryId ;        int CategoryId;        int ProductGroupCode ;

        #region SetListVariables

        CompanyId = StringOperation.QueryStringInt16Value(Request.QueryString["CompanyId"]);
        CategoryId = StringOperation.QueryStringInt16Value(Request.QueryString["CategoryId"]);
        SubCategoryId = StringOperation.QueryStringInt16Value(Request.QueryString["SubCategoryId"]);
        ProductGroupCode = StringOperation.QueryStringInt16Value(Request.QueryString["ProductGroupCode"]);

        #region Write Cookies

        if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0 && ProductGroupCode != 0)
        {
            Response.Cookies["ProductGroupCode"].Value = ProductGroupCode.ToString();
            Response.Cookies["ProductGroupCode"].Expires = DateTime.Now.AddDays(1);
        }
        else if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0)
        {
            Response.Cookies["SubCategoryId"].Value = SubCategoryId.ToString();
            Response.Cookies["SubCategoryId"].Expires = DateTime.Now.AddDays(1);
        }
        else if (CompanyId != 0 && CategoryId != 0)
        {
            Response.Cookies["CategoryId"].Value = CategoryId.ToString();
            Response.Cookies["CategoryId"].Expires = DateTime.Now.AddDays(1);
        }
        else if (CompanyId != 0)
        {
            Response.Cookies["CompanyId"].Value = CompanyId.ToString();
            Response.Cookies["CompanyId"].Expires = DateTime.Now.AddDays(1);
        }

        #region GetCookies

        if (Request.Cookies["CompanyId"] != null && CompanyId==0)
            CompanyId = StringOperation.QueryStringInt16Value(Convert.ToString(Request.Cookies["CompanyId"].Value));
        if (Request.Cookies["CompanyId"] != null && Request.Cookies["CategoryId"] != null && CategoryId == 0)
            CategoryId = StringOperation.QueryStringInt16Value(Convert.ToString(Request.Cookies["CategoryId"].Value));
        if (Request.Cookies["CompanyId"] != null && Request.Cookies["CategoryId"] != null && Request.Cookies["SubCategoryId"] != null && SubCategoryId == 0)
            SubCategoryId = StringOperation.QueryStringInt16Value(Convert.ToString(Request.Cookies["SubCategoryId"].Value));
        //if (Request.Cookies["ProductGroupCode"] != null && ProductGroupCode == 0)
        //    ProductGroupCode = StringOperation.QueryStringInt16Value(Convert.ToString(Request.Cookies["ProductGroupCode"].Value));

        #endregion

        #endregion

        #endregion

        #region FillDropDownLists

        dtCompany = taCompany.GetData();
        FCC.FillDropDownList(ref ddlCompany, dtCompany, "CompanyName", "CompanyId",true,true,CompanyId.ToString());

        dtCategory = taCategory.SelectCategorybyCompanyId(CompanyId);
        FCC.FillDropDownList(ref ddlCategory, dtCategory, "CategoryName", "CategoryId", true, true, CategoryId.ToString());

        dtSubCategory = taSubCategory.GetDataByCategoryId(CategoryId);
        FCC.FillDropDownList(ref ddlSubCategory, dtSubCategory, "SubCategoryName", "SubCategoryId", true, true, SubCategoryId.ToString());

        dtProductGroup = taProductGroup.GetDataBySubCategoryId(SubCategoryId);
        FCC.FillDropDownList(ref ddlProductGroupCode, dtProductGroup, "ProductGroupDescription", "ProductGroupCode", true, true, ProductGroupCode.ToString());

        #endregion

        if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0 && ProductGroupCode!=0)
            dtProduct = taProduct.GetDataByProductGroupCode(ProductGroupCode);
        else
            dtProduct = taProduct.GetDataByProductGroupCode(0);

        if (dtProduct.Rows.Count > 0)
        {
            GridView1.DataSourceID = null;
            GridView1.DataSource = dtProduct;
            GridView1.DataBind();
        }
        else
        {
            GridView1.DataSourceID = null;
            GridView1.DataSource = dtProduct;
            GridView1.DataBind();
            lblMsg.Text = "No record found";
            return;
        }
    }
Ejemplo n.º 9
0
 private void BindData()
 {
     dtCompany = taCompany.SelectAllCompany();
     if (dtCompany.Rows.Count > 0)
     {
         GridView1.DataSourceID = null;
         GridView1.DataSource = dtCompany;
         GridView1.DataBind();
     }
     else
     {
         lblMsg.Text = "No record found";
         return;
     }
 }
    private void SetProfileDetail()
    {
        if (Request.QueryString["companyid"] != null)
        {
            int companyid = Convert.ToInt32(Request.QueryString["companyid"]);
            dtCompany = taCompany.SelectAllCompanyByCompanyId(companyid);

            if (dtCompany.Rows.Count > 0)
            {

                DataRow row = dtCompany.Rows[0];

                lblAboutCompany.Text = row["AboutCompany"].ToString();
                lblBrand.Text = row["Brand"].ToString();
                lblOwner.Text = row["Owner"].ToString();
                lblYearEstablished.Text = row["YearEstablished"].ToString();
                lblContact.Text = row["Contact"].ToString();
                lblEmail.Text = row["Email"].ToString();
                lblTel1.Text = row["Tel1"].ToString();
                lblFax1.Text = row["Fax1"].ToString();
                lblURL.Text = row["URL"].ToString();
                lblZipCode.Text = row["ZipCode"].ToString();
                lblAddress.Text = row["Address"].ToString();
                lblBusinessType.Text = row["BusinessType"].ToString();
                lblMainProduct.Text = row["MainProduct"].ToString();
                lblMainMarket.Text = row["MainMarket"].ToString();
                lblApprovalCertificate.Text = row["ApprovalCertificate"].ToString();
                lblMembership.Text = row["Membership"].ToString();
            }

        }
    }