Esempio n. 1
0
    public bool check_discount(DataTable dtitem)
    {
        string      strSql  = "select disc_code,disc_amt,disc from tblDiscountMaster where SiteId='" + Convert.ToString(Request.Params["SiteId"]) + "' and disc_code='" + Convert.ToString(Request.Params["discCode"]) + "'";
        commonclass objdisc = new commonclass();

        DataTable dtdisc = objdisc.Fetchrecords(strSql);

        if (dtdisc.Rows.Count > 0)
        {
            foreach (DataRow dr in dtitem.Rows)
            {
                //disc_amt = Convert.ToDouble(dr["disc_amt"]);
                dr["disc"]      = true;
                dr["disc_code"] = Convert.ToString(dtdisc.Rows[0]["disc_code"]);
                dr["disc_amt"]  = Convert.ToDouble(dtdisc.Rows[0]["disc_amt"]);
                //dr["tot_cost"] = (100 - disc_amt) / 100 * tot_cost;
                //  dr["tot_cost"] = (100 - Convert.ToDouble(dr["disc_amt"])) / 100 * tot_cost;
            }
            Session["flagDiscount"] = true;
            return(true);
        }
        else
        {
            //Response.Write("2");
            //Response.Write("~");
            //Response.Write("Please verify the discount code");
            Session["flagDiscount"] = false;
            return(false);
        }
    }
    protected void ddlService_SelectedIndexChanged(object sender, EventArgs e)
    {
        commonclass objCommon    = new commonclass();
        DataSet     dsSubService = new DataSet();
        string      strError     = "";
        string      strSql       = "select subservice_id,subservice_name from tblSubServiceMaster where subservice_status=1;select sub.subservice_name,r.subservice_id from tblService_SubService_Relation r inner join tblSubServiceMaster sub on r.subservice_id=sub.subservice_id where r.service_id=" + Convert.ToInt32(ddlService.SelectedValue) + " ;";

        //string strSql = "select subservice_id,subservice_name from tblSubServiceMaster where subservice_status=1;select subservice_id from tblService_SubService_Relation ";

        dsSubService = objCommon.ExecuteDS(strSql, ref strError);
        if (dsSubService.Tables[0].Rows.Count > 0)
        {
            cbSubService.DataSource     = dsSubService.Tables[0];
            cbSubService.DataValueField = dsSubService.Tables[0].Columns["subservice_id"].ToString();
            cbSubService.DataTextField  = Convert.ToString(dsSubService.Tables[0].Columns["subservice_name"]);
            //   cbSubService.DataValueField = "subservice_id";
            //  cbSubService.DataTextField = "subservice_name";


            cbSubService.DataBind();

            foreach (ListItem li in cbSubService.Items)
            {
                foreach (DataRow dr in dsSubService.Tables[1].Rows)
                {
                    if (Convert.ToInt32(li.Value) == Convert.ToInt32(dr["subservice_id"]))
                    {
                        li.Selected = true;
                    }
                }
            }
        }
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        commonclass objcat = new commonclass();

        string    strsql = "select Category_Id,Category_Name from tblItemCategory_Web_Server";
        DataTable dtcat  = objcat.Fetchrecords(strsql);

        rptcatname.DataSource = dtcat;
        rptcatname.DataBind();
    }
Esempio n. 4
0
    public DataTable getDatable(string Category_Id)
    {
        commonclass objcat = new commonclass();
        //string   strsql = "select Category_id,Category_Name,Parent_Category_id from tblItemCategory_Web_Server where Parent_Category_id=" + Category_Id + "";
        string strsql = "select Category_id,Category_Name,Parent_Category_id from tblItemCategory_Web_Server";


        DataTable dtcat = objcat.Fetchrecords(strsql);

        return(dtcat);
    }
Esempio n. 5
0
    public void getPaymentOption()
    {
        DataTable   dtPoption = new DataTable();
        commonclass objPo     = new commonclass();

        string strSQL = "select * from tblPaymentOptionMaster";

        dtPoption        = objPo.Fetchrecords(strSQL);
        rptPo.DataSource = dtPoption;
        rptPo.DataBind();
    }
Esempio n. 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            commonclass objmenu = new commonclass();
            DataTable   dtmenu  = new DataTable();
            string      strSql  = "select  * from tblMenuMaster";
            dtmenu = objmenu.Fetchrecords(strSql);

            dvMenu.InnerHtml = generaRootLevel(dtmenu);
        }
    }
Esempio n. 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         commonclass objdt = new commonclass();
         DataTable   dtrep = new DataTable();
         dtrep = objdt.Fetchrecords("select * from products");
         //rep1.DataSource = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(
         //    sConn, CommandType.Text, "select * from products").Tables[0].Rows;
         rep1.DataSource = dtrep;
         rep1.DataBind();
     }
 }
Esempio n. 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string      Chapter_Id = "";
        commonclass objcat     = new commonclass();

        if (Request.QueryString["Chapter_Id"] != null)
        {
            Chapter_Id = Convert.ToString(Request.QueryString["Chapter_Id"]);
        }

        if (Chapter_Id == "")
        {
            //  strsql = "select Category_id,Category_Name from tblItemCategory_Web_Server where Parent_Category_id=" + Request.QueryString["catid"] + "";
            string strsql = "select c.Chapter_Id,c.Chapter_Name, s.chapter_level,s.Chapter_Path,s.Site_id,s.Parent_Id from tblChapter_Master c " +
                            " INNER JOIN tblSiteChapterMaster s ON s.Chapter_Id=c.Chapter_Id where s.chapter_level=0 ";


            DataTable dtArticle = objcat.Fetchrecords(strsql);

            //rptArticles.DataSource = dtArticle;
            //rptArticles.DataBind();
            StringBuilder sboutput = new StringBuilder();


            sboutput.Append("<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">");
            sboutput.Append("<tr><td><h1>Interesting Articles</h1></td></tr>");
            foreach (DataRow drcat in dtArticle.Rows)
            {
                sboutput.Append("<tr>");
                sboutput.Append("<td>");
                sboutput.Append("<a href=\"chapter.aspx?Chapter_Id=" + drcat["Chapter_Id"].ToString() + "&pageno=1\">" + drcat["Chapter_Name"].ToString() + "</a>");
                sboutput.Append("</td>");
                sboutput.Append("</tr>");
            }
            sboutput.Append("</table>");
            lblCategory.Text = sboutput.ToString();
        }

        else
        {
            string strsql = "select c.Chapter_Id,c.Chapter_Name, s.chapter_level,s.Chapter_Path,s.Site_id,s.Parent_Id from tblChapter_Master c " +
                            " INNER JOIN tblSiteChapterMaster s ON s.Chapter_Id=c.Chapter_Id ";



            DataTable dtArticle = objcat.Fetchrecords(strsql);
            lblCategory.Text = "";
            StringBuilder sboutput = new StringBuilder();
            lblCategory.Text = BindLevel1(dtArticle, Chapter_Id);
        }
    }
Esempio n. 9
0
    public void bindRep()
    {
        commonclass objcommon = new commonclass();

        //string strSql = " select ROW_NUMBER() OVER(ORDER BY COL ASC) AS SlNo,COL  from Duplicate ";
        string strSql = " select ROW_NUMBER() OVER(ORDER BY COL ASC) AS SlNo,col, row_number() over (partition by ID,col Order by ID) as Sl from DUPLICATE";

        //DataTable dtApproved = new DataTable();
        // DataTable dtDuplicate = objcommon.Fetchrecords(strSql);
        DataTable dtDuplicate = objcommon.getDataTable(strSql);

        rptDuplicate.DataSource = dtDuplicate;
        rptDuplicate.DataBind();
    }
Esempio n. 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string strSql = "";
            strSql = " select id,count(COL) as wait, COL  from Duplicate  group by id,COL,status having status =1";
            commonclass objcommon = new commonclass();
            DataTable   dtWait    = new DataTable();
            //dtWait.Columns.Add("sid", typeof(int));
            //dtWait.Columns["sid"].AutoIncrement = true;
            //dtWait.Columns["sid"].AutoIncrementSeed = 1;
            dtWait            = objcommon.Fetchrecords(strSql);
            dtWait.PrimaryKey = new System.Data.DataColumn[] { dtWait.Columns["id"] };



            strSql = " select id,count(COL) as approved, COL as siteapproved from Duplicate  group by id,COL,status having status =2";
            DataTable dtApproved = new DataTable();
            //dtApproved.Columns.Add("sid", typeof(int));
            //dtApproved.Columns["sid"].AutoIncrement = true;
            //dtApproved.Columns["sid"].AutoIncrementSeed = 1;
            // dtApproved.PrimaryKey = new System.Data.DataColumn[] { dtApproved.Columns["id"] };

            dtApproved = objcommon.Fetchrecords(strSql);

            // strSql = " select id,count(COL)as cancel , COL  from Duplicate  group by id,COL having status =3";
            strSql = " select id,count(COL) as cancel, COL as sitecancel from Duplicate  group by id,COL,status having status =3";

            DataTable dtCancel = new DataTable();
            //dtCancel.Columns.Add("sid", typeof(int));
            //dtCancel.Columns["sid"].AutoIncrement = true;
            //dtCancel.Columns["sid"].AutoIncrementSeed = 1;
            // dtCancel.PrimaryKey = new System.Data.DataColumn[] { dtCancel.Columns["id"] };
            dtCancel = objcommon.Fetchrecords(strSql);


            //DataTable dtfinal = new DataTable();
            //dtfinal.Columns.Add("COL");
            //dtfinal.Columns.Add("ApplicationName");



            dtWait.Merge(dtApproved);
            dtWait.Merge(dtCancel);
            dlLink.DataSource = dtWait;
            dlLink.DataBind();
        }
    }
Esempio n. 11
0
        protected void Page_Load(object sender, EventArgs e)

        {
            if (!Page.IsPostBack)

            {
                SetInitialRow();
            }

            Member_name_textbox.Text = Session["member_name"].ToString();
            string mymember_name = Member_name_textbox.Text;

            commonclass ref_no = new commonclass();

            Reference_no.Text = ref_no.generate_referenceno(mymember_name);
        }
Esempio n. 12
0
    public List <Service> populateService_list()
    {
        List <Service> colService = new List <Service>();
        Service        objService = null;

        string      strSql    = "select * from tblServiceMaster ";
        commonclass objcommon = new commonclass();
        DataTable   dtService = new DataTable();

        dtService = objcommon.Fetchrecords(strSql);
        foreach (DataRow drService in dtService.Rows)
        {
            objService              = new Service();
            objService.service_id   = Convert.ToInt32(drService["service_id"]);
            objService.service_name = Convert.ToString(drService["service_name"]);
            colService.Add(objService);
        }
        return(colService);
    }
Esempio n. 13
0
    public GCommon <State> populateState()
    {
        GCommon <State> colState = new GCommon <State>();
        State           objstate = null;

        string      strSql    = "select * from tblstate order by sname ";
        commonclass objcommon = new commonclass();
        DataTable   dtState   = new DataTable();

        dtState = objcommon.Fetchrecords(strSql);
        foreach (DataRow drState in dtState.Rows)
        {
            objstate       = new State();
            objstate.sid   = Convert.ToInt32(drState["sid"]);
            objstate.sname = Convert.ToString(drState["sname"]);
            colState.Add(objstate);
        }
        return(colState);
    }
Esempio n. 14
0
    public void getCity()
    {
        string      strSql    = "select * from tblCityMaster  ";
        commonclass objcommon = new commonclass();
        DataTable   dtCity    = new DataTable();

        dtCity             = objcommon.Fetchrecords(strSql);
        rptCity.DataSource = dtCity;
        rptCity.DataBind();
        foreach (DataRow drCity in dtCity.Rows)
        {
            hidCityIds.Value += drCity["city_id"].ToString() + ",";
        }

        if (hidCityIds.Value.Length > 0)
        {
            hidCityIds.Value = hidCityIds.Value.Substring(0, hidCityIds.Value.Length - 1);
        }
        hidTotCity.Value = "1";
    }
Esempio n. 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["connectionString"]);

        //try
        //{
        //    //Class1.conn.Open();
        //    if (conn.State == ConnectionState.Closed)
        //    {
        //        conn.Open();
        //    }
        //    //conn.Open();
        //    DataSet d1 = new DataSet();
        //    SqlDataAdapter adpt = new SqlDataAdapter("select * from ques", conn);
        //    adpt.Fill(d1, "ques");
        //    myrepeater.DataSource = d1.Tables["ques"];
        //    myrepeater.DataBind();
        //}
        //catch { }
        //finally
        //{

        //    if (conn.State == ConnectionState.Open)
        //    {
        //        conn.Close();
        //    }
        //}



        commonclass objrep = new commonclass();

        if (!IsPostBack)
        {
            DataTable dtques = new DataTable();
            string    strSql = "select * from ques";
            dtques = objrep.Fetchrecords(strSql);
            myrepeater.DataSource = dtques;
            myrepeater.DataBind();
        }
    }
Esempio n. 16
0
    public GCommon <City> populateCity()
    {
        GCommon <City> colCity = new GCommon <City>();
        City           objCity = null;
        //string strSql = "select c.city_name " +
        //                " from tblCityMaster c" +
        //                " inner join tblService_SubService_City_Relation r on c.city_id=r.city_id" +
        //                " where c.city_status=1" +
        //                " order by c.city_name";
        string      strSql    = "select * from tblCityMaster order by city_name ";
        commonclass objcommon = new commonclass();
        DataTable   dtCity    = new DataTable();

        dtCity = objcommon.Fetchrecords(strSql);
        foreach (DataRow drCity in dtCity.Rows)
        {
            objCity           = new City();
            objCity.city_id   = Convert.ToInt32(drCity["city_id"]);
            objCity.city_name = Convert.ToString(drCity["city_name"]);
            colCity.Add(objCity);
        }
        return(colCity);
    }
Esempio n. 17
0
    public bool getProduct(string Chapter_Id, int inner, int pagenumber, int numberofProd, ref string strPage)
    {
        bool        bflag      = false;
        int         totproduct = 0;
        commonclass objcat     = new commonclass();
        int         f          = 1;
        int         t          = 6;
        int         upto       = 0;
        int         prev       = 5;
        string      strsql     = "select count(pid) as totproduct from testProduct  ";
        DataTable   dtAllprod  = objcat.Fetchrecords(strsql);

        if (dtAllprod.Rows.Count > 0)
        {
            totproduct = Convert.ToInt32(dtAllprod.Rows[0]["totproduct"]);
        }
        string strSql = "";

        if (pagenumber == 0)
        {
            strSql = "select pname from testProduct";
        }
        else
        {
            strSql = "select top (" + numberofProd + ")pname" +
                     " from testProduct  " +
                     " where pid not in (select top (" + inner + ")pid " +
                     " from testProduct )";
        }


        DataTable dtArticle = objcat.Fetchrecords(strSql);

        if (dtArticle.Rows.Count > 0)
        {
            dtlArticle.DataSource = dtArticle;
            dtlArticle.DataBind();
            StringBuilder sbpage = new StringBuilder();

            if (pagenumber != 0)
            {
                if (totproduct > numberofProd)
                {
                    int intfrompage = (pagenumber - 1) * numberofProd + 1;
                    int inttopage   = pagenumber * numberofProd;
                    if (inttopage > totproduct)
                    {
                        sbpage.Append(intfrompage + "-" + totproduct + " of " + totproduct + "&nbsp");
                    }
                    else
                    {
                        sbpage.Append(intfrompage + "-" + inttopage + " of " + totproduct + "&nbsp");
                    }

                    int nopages = 0;
                    if (totproduct > numberofProd)
                    {
                        if (totproduct % numberofProd != 0)
                        {
                            nopages = totproduct / numberofProd + 1;
                        }
                        else
                        {
                            nopages = totproduct / numberofProd;
                        }
                    }

                    if (intfrompage == 1)
                    {
                        //  btnprev.Enabled = false;
                        sbpage.Append("<image src=\"images/prev_arrow.gif\">");
                        //sbpage.Append("Previous");
                    }
                    else
                    {
                        sbpage.Append("<a href=\"testPagination.aspx?Chapter_Id=" + Chapter_Id + "&pageno=" + (pagenumber - 1) + "\"><image src=\"images/prev_arrow.gif\">");
                        // sbpage.Append("<a href=\"testPagination.aspx?Chapter_Id=" + Chapter_Id + "&pageno=" + (pagenumber - 1) + "\">Previous</a>&nbsp");
                    }

                    if (nopages > 6)
                    {
                        if (pagenumber % 6 == 0)
                        {
                            upto = pagenumber / 6 + 1;
                            f    = pagenumber + 1;
                            t    = 6 * upto;
                            if (nopages < t)
                            {
                                t = nopages;
                            }
                            else
                            {
                                t = 6 * upto;
                            }



                            Session["f"] = f;
                            Session["t"] = t;

                            if (Session["f"] == null && Session["f"] == null || pagenumber < 6)
                            {
                                f = 1;
                                t = 6;
                            }
                            else
                            {
                                f = Convert.ToInt32(Session["f"]);
                                t = Convert.ToInt32(Session["t"]);
                            }

                            for (int i = f - 1; i <= t; i++)
                            {
                                if (pagenumber == (i))
                                {
                                    sbpage.Append(i);
                                }
                                else
                                {
                                    sbpage.Append("<a href=\"testPagination.aspx?Chapter_Id=" + Chapter_Id + "&pageno=" + (i) + "\">" + (i) + "</a>&nbsp");
                                }
                            }
                        }
                        else if (pagenumber - 5 == 0)
                        {
                            f = Convert.ToInt32(Session["f"]) - 6;
                            t = Convert.ToInt32(Session["t"]) - 1;

                            for (int i = 1; i <= 6; i++)
                            {
                                if (pagenumber == (i))
                                {
                                    sbpage.Append(i);
                                }
                                else
                                {
                                    sbpage.Append("<a href=\"testPagination.aspx?Chapter_Id=" + Chapter_Id + "&pageno=" + (i) + "\">" + (i) + "</a>&nbsp");
                                }
                            }
                        }
                        else if ((pagenumber - 5) % 6 == 0)
                        {
                            int p = Convert.ToInt32(Session["t"]) + 1;
                            if (pagenumber < Convert.ToInt32(Session["f"]))//prev
                            {
                                f = Convert.ToInt32(Session["f"]) - 6;
                                t = Convert.ToInt32(Session["t"]) - 6;
                                //if(t-f

                                if (t - f != 5)
                                {
                                    int m = 5 - (t - f);
                                    t = t + m;
                                }


                                for (int i = f - 1; i <= t; i++)
                                {
                                    if (pagenumber == (i))
                                    {
                                        sbpage.Append(i);
                                    }
                                    else
                                    {
                                        sbpage.Append("<a href=\"testPagination.aspx?Chapter_Id=" + Chapter_Id + "&pageno=" + (i) + "\">" + (i) + "</a>&nbsp");
                                    }
                                }
                                Session["f"] = f;
                                Session["t"] = t;
                            }
                            else
                            {
                                f = Convert.ToInt32(Session["f"]);
                                t = Convert.ToInt32(Session["t"]);


                                for (int i = f - 1; i <= t; i++)
                                {
                                    if (pagenumber == (i))
                                    {
                                        sbpage.Append(i);
                                    }
                                    else
                                    {
                                        sbpage.Append("<a href=\"testPagination.aspx?Chapter_Id=" + Chapter_Id + "&pageno=" + (i) + "\">" + (i) + "</a>&nbsp");
                                    }
                                }
                            }
                        }



                        else
                        {
                            if (Session["f"] == null && Session["f"] == null || pagenumber < 6)
                            {
                                f = 1;
                                t = 6;

                                for (int i = f; i <= t; i++)
                                {
                                    if (pagenumber == (i))
                                    {
                                        sbpage.Append(i);
                                    }
                                    else
                                    {
                                        sbpage.Append("<a href=\"testPagination.aspx?Chapter_Id=" + Chapter_Id + "&pageno=" + (i) + "\">" + (i) + "</a>&nbsp");
                                    }
                                }
                            }
                            else
                            {
                                f = Convert.ToInt32(Session["f"]);
                                t = Convert.ToInt32(Session["t"]);


                                for (int i = f - 1; i <= t; i++)
                                {
                                    if (pagenumber == (i))
                                    {
                                        sbpage.Append(i);
                                    }
                                    else
                                    {
                                        sbpage.Append("<a href=\"testPagination.aspx?Chapter_Id=" + Chapter_Id + "&pageno=" + (i) + "\">" + (i) + "</a>&nbsp");
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        for (int i = 0; i < nopages; i++)
                        {
                            if (pagenumber == (i + 1))
                            {
                                sbpage.Append(i + 1);
                            }
                            else
                            {
                                sbpage.Append("<a href=\"testPagination.aspx?Chapter_Id=" + Chapter_Id + "&pageno=" + (i + 1) + "\">" + (i + 1) + "</a>&nbsp");
                            }
                        }
                    }

                    if (pagenumber == nopages)
                    {
                        // btnnext.Enabled = false;
                        sbpage.Append("<image src=\"images/next_arrow.gif\">&nbsp");
                    }
                    else
                    {
                        sbpage.Append("<a href=\"testPagination.aspx?Chapter_Id=" + Chapter_Id + "&pageno=" + (pagenumber + 1) + "\"><image src=\"images/next_arrow.gif\">&nbsp");
                    }
                    sbpage.Append("<a href=\"testPagination.aspx?Chapter_Id=" + Chapter_Id + "&pageno=0\"><image src=\"images/view_all_img.gif\"></a>");
                }
                //sbpage.Append("<a href=\"testPagination.aspx?Chapter_Id=" + Chapter_Id + "&pageno=0\"><image src=\"images/view_all_img.gif\"></a>");
            }
            else
            {
                sbpage.Append(totproduct + " of " + totproduct + "&nbsp");
            }
            strPage = sbpage.ToString();

            bflag = true;
        }
        return(bflag);
    }
Esempio n. 18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        commonclass objcat               = new commonclass();
        string      strsql               = "";
        int         Parent_Category_id   = 0;
        string      parent_Category_Name = string.Empty;
        string      Category_Id          = "";

        if (Request.QueryString["catid"] != null)
        {
            Category_Id = Request.QueryString["catid"].ToString();
        }


        if (Request.QueryString["catid"] != null)
        {
            strsql = "select Category_id,Category_Name from tblItemCategory_Web_Server where Parent_Category_id=" + Request.QueryString["catid"] + "";

            DataTable dtcat = objcat.Fetchrecords(strsql);

            rptSubcatname.DataSource = dtcat;
            rptSubcatname.DataBind();

            //DataView subname = new DataView(dtcat);
            //subname.RowFilter = "Category_id='" + Category_Id + "'";

            strsql = "select Category_Id,Category_Name from tblItemCategory_Web_Server where Category_id=(select Parent_Category_id from tblItemCategory_Web_Server where Category_Id=" + Request.QueryString["catid"] + ")";


            //  dr = objcat.ExecuteDR(strsql,ref dr);
            DataTable dtParent_Category_id = objcat.Fetchrecords(strsql);

            if (dtParent_Category_id.Rows.Count > 0)
            {
                Parent_Category_id   = Convert.ToInt32(dtParent_Category_id.Rows[0]["Category_Id"]);
                parent_Category_Name = Convert.ToString(dtParent_Category_id.Rows[0]["Category_Name"]);
            }

            if (Parent_Category_id != 0)
            {
                // DataTable dtsubcat = objcat.Fetchrecords(strsql);

                strsql = "select Category_Id,Category_Name from tblItemCategory_Web_Server where Parent_Category_id=" + Parent_Category_id + " and Category_Id!=" + Request.QueryString["catid"] + "";
                DataTable dtsubcat = objcat.Fetchrecords(strsql);
                //  rptSubcatname.HeaderTemplate.ToString() = parent_Category_Name;


                rptSubSubcatname.DataSource = dtsubcat;
                rptSubSubcatname.DataBind();

                foreach (RepeaterItem repeatItem in rptSubSubcatname.Items)
                {
                    // if condition to add HeaderTemplate Dynamically only Once
                    if (repeatItem.ItemIndex == 0)
                    {
                        RepeaterItem       headerItem = new RepeaterItem(repeatItem.ItemIndex, ListItemType.Header);
                        HtmlGenericControl hTag       = new HtmlGenericControl("h4");
                        hTag.InnerHtml = parent_Category_Name;
                        repeatItem.Controls.Add(hTag);
                    }
                }
                //rptSubSubcatname.DataSource = dtsubcat;
                //rptSubSubcatname.DataBind();
            }
        }
        else
        {
        }
    }
Esempio n. 19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        commonclass objcat      = new commonclass();
        string      Category_Id = "";

        if (Request.QueryString["catid"] != null)
        {
            Category_Id = Request.QueryString["catid"].ToString();
        }
        if (Category_Id != null)
        {
            DataTable dtCat = getDatable(Category_Id);

            string        Parent_Category_id = "";
            string        Category_Name      = "";
            StringBuilder sboutput           = new StringBuilder();

            if (getCatName(dtCat, ref Parent_Category_id, ref Category_Name, Category_Id))
            {
                DataView dvCat = new DataView(dtCat);
                //  dvCat.RowFilter = "Parent_Category_id='" + Category_Id + "'";
                dvCat.RowFilter = "Parent_Category_id='" + Category_Id + "'and Category_Id<>'" + Category_Id + "'";

                dvCat.Sort = "Category_Name";

                if (dvCat.ToTable().Rows.Count > 0)
                {
                    sboutput.Append("<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">");
                    sboutput.Append("<tr><td><h1>SubCategories</h1></td></tr>");
                    foreach (DataRow drcat in dvCat.ToTable().Rows)
                    {
                        sboutput.Append("<tr>");
                        sboutput.Append("<td>");
                        if (drcat["Category_Id"].ToString() == Category_Id)
                        {
                            sboutput.Append("<a style=\"background-color:Red\" href=\"category.aspx?catid=" + drcat["Category_Id"].ToString() + "&pageno=1\">" + drcat["Category_Name"].ToString() + "</a>");
                        }
                        else
                        {
                            sboutput.Append("<a href=\"category.aspx?catid=" + drcat["Category_Id"].ToString() + "&pageno=1\">" + drcat["Category_Name"].ToString() + "</a>");
                        }
                        //  sboutput.Append("<a href=\"category.aspx?catid=" + drcat["Category_Id"].ToString() + "&pageno=1\">" + drcat["Category_Name"].ToString() + "</a>");
                        sboutput.Append("</td>");
                        sboutput.Append("</tr>");
                    }
                    sboutput.Append("</table>");
                    sboutput.Append("<br>");
                }


                if (Parent_Category_id != "0")
                {
                    // dvCat.RowFilter = "Parent_Category_id='" + Parent_Category_id + "'";
                    dvCat.RowFilter = "Parent_Category_id='" + Parent_Category_id + "'and Category_id <>'" + Category_Id + "'";

                    dvCat.Sort = "Category_Name";
                    if (getCatName(dtCat, ref Parent_Category_id, ref Category_Name, Parent_Category_id))
                    {
                        //dvCat.RowFilter = "Parent_Category_id='" + Parent_Category_id + "'";
                        //dvCat.Sort = "Category_Name";

                        if (dvCat.ToTable().Rows.Count > 0)
                        {
                            sboutput.Append("<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">");
                            sboutput.Append("<tr><td><h1>" + Category_Name + "</h1></td></tr>");
                            foreach (DataRow drcat in dvCat.ToTable().Rows)
                            {
                                sboutput.Append("<tr>");
                                sboutput.Append("<td>");
                                //  sboutput.Append("<a href=\"category.aspx?catid=" + drcat["Category_Id"].ToString() + "&pageno=1\">" + drcat["Category_Name"].ToString() + "</a>");
                                if (drcat["Category_Id"].ToString() == Category_Id)
                                {
                                    sboutput.Append("<a style=\"background-color:Red\" href=\"category.aspx?catid=" + drcat["Category_Id"].ToString() + "&pageno=1\">" + drcat["Category_Name"].ToString() + "</a>");
                                }
                                else
                                {
                                    sboutput.Append("<a href=\"category.aspx?catid=" + drcat["Category_Id"].ToString() + "&pageno=1\">" + drcat["Category_Name"].ToString() + "</a>");
                                }


                                sboutput.Append("</td>");
                                sboutput.Append("</tr>");
                            }
                            sboutput.Append("</table>");
                            sboutput.Append("<br>");
                        }
                    }
                }



                lblSubCat.Text = sboutput.ToString();
            }
        }
    }
Esempio n. 20
0
    //public void getService_SubService()
    //{
    //    string strSql = " select " +
    //                    " s.service_id ," +
    //                    " s.service_name," +
    //                    " sub.subservice_name,  " +
    //                    " sub.subservice_id  " +
    //                    " from " +
    //                    " tblService_SubService_City_Relation r " +
    //                    " inner join tblSubServiceMaster sub on sub.subservice_id=r.subservice_id " +
    //                    " inner join tblServiceMaster s on s.service_id=r.service_id " +
    //                    " where " +
    //                    " s.service_status=1 and sub.subservice_status=1 ";
    //    commonclass objcommon = new commonclass();
    //    DataTable dtService = new DataTable();
    //    dtService = objcommon.Fetchrecords(strSql);
    //    dlService.DataSource = dtService;
    //    dlService.DataBind();


    //    foreach (DataListItem DataListItem in dlService.Items)
    //    {
    //        // SQL Select Command

    //        string strSqlNew = " select " +

    //                   " sub.subservice_name,  " +
    //                   " sub.subservice_id  " +
    //                   " from " +
    //                   " tblService_SubService_City_Relation r " +
    //                   " inner join tblSubServiceMaster sub on sub.subservice_id=r.subservice_id " +
    //            //  " inner join tblServiceMaster s on s.service_id=r.service_id "+
    //                   " where " +
    //                   " service_id = @service_id and sub.subservice_status=1 ";
    //        SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["connectionString"]);


    //        SqlCommand mySqlSelect = new SqlCommand(strSqlNew, con);

    //        mySqlSelect.CommandType = CommandType.Text;

    //        // Parameter passed as categoryID
    //        // to get products that belong to the passed categoryId
    //        // FindControl HiddenField used to retrieve the value of categoryId
    //        mySqlSelect.Parameters.Add("@service_id", SqlDbType.Int).Value = ((HiddenField)DataListItem.FindControl("hiddenCategoryID")).Value;

    //        SqlDataAdapter mySqlAdapter = new SqlDataAdapter(mySqlSelect);

    //        DataSet myDataSet = new DataSet();

    //        mySqlAdapter.Fill(myDataSet);

    //        DataList dlSubService = (DataList)(DataListItem.FindControl("dlSubService"));

    //        // Databinding with Nested DataList Control
    //        dlSubService.DataSource = myDataSet;

    //        ((DataList)(DataListItem.FindControl("dlSubService"))).DataBind();


    //    }


    //}

    public void getServiceHTML()
    {
        ArrayList sameprod   = new ArrayList();
        int       intcounter = 0;
        string    strSql     = " select " +
                               " s.service_id ," +
                               " s.service_name" +
                               " from " +
                               " tblService_SubService_Relation r " +
                               " inner join tblServiceMaster s on s.service_id=r.service_id " +
                               " where " +
                               " s.service_status=1  ";
        commonclass objcommon = new commonclass();
        DataTable   dtService = new DataTable();

        dtService = objcommon.Fetchrecords(strSql);
        //dlService.DataSource = dtService;
        //dlService.DataBind();
        StringBuilder sbSurvice = new StringBuilder();

        sbSurvice.Append("<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"836\">");
        sbSurvice.Append("<tbody>");



        sbSurvice.Append("<tr>");
        int service_id = 0;

        foreach (DataRow drService in dtService.Rows)
        {
            if (!sameprod.Contains(Convert.ToInt32(drService["service_id"])))
            {
                sbSurvice.Append("<td style=\"height: 178px;\" valign=\"top\" width=\"20%\">");
                sbSurvice.Append(getSub_ServiceHTML(Convert.ToInt32(drService["service_id"]), Convert.ToString(drService["service_name"])));
                sbSurvice.Append("</td>");
                sameprod.Add(Convert.ToInt32(drService["service_id"]));
                intcounter++;
            }


            if (intcounter == 4)
            {
                sbSurvice.Append("</tr>");
                sbSurvice.Append("<tr>");
                sbSurvice.Append("<td style=\"height: 19px;\" width=\"20%\">");
                sbSurvice.Append("&nbsp;");
                sbSurvice.Append("</td>");
                sbSurvice.Append("<td style=\"height: 19px;\" width=\"20%\">");
                sbSurvice.Append("&nbsp;");
                sbSurvice.Append(" </td>");
                sbSurvice.Append("<td style=\"height: 19px;\" width=\"20%\">");
                sbSurvice.Append(" &nbsp;");
                sbSurvice.Append("</td>");
                sbSurvice.Append("<td style=\"height: 19px;\" width=\"20%\">");
                sbSurvice.Append(" &nbsp;");
                sbSurvice.Append(" </td>");
                sbSurvice.Append(" </tr>");

                intcounter = 0;
            }



            //sbSurvice.Append("<td style=\"height: 178px;\" valign=\"top\" width=\"20%\">");
            //sbSurvice.Append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"209\">");
            //sbSurvice.Append("<tbody>");
            //sbSurvice.Append("<tr>");
            //sbSurvice.Append("<td class=\"GoldSection\" style=\"height: 19px;\" bgcolor=\"#f6e08d\">");
            //sbSurvice.Append(Convert.ToString(drService["service_name"]));
            //sbSurvice.Append("</td>");
            //sbSurvice.Append("</tr>");
            //sbSurvice.Append("<tr>");
            //sbSurvice.Append("<td style=\"height: 140px;\" bgcolor=\"#fcf4d6\" valign=\"top\">");
            //sbSurvice.Append(getSub_ServiceHTML(service_id));
            //sameprod.Add(service_id);

            //sbSurvice.Append("</td>");
            //sbSurvice.Append("</tr>");
            //sbSurvice.Append("</tbody>");
            //sbSurvice.Append("</table>");
            //sbSurvice.Append("</td>");
        }



        sbSurvice.Append("</tbody>");
        sbSurvice.Append("</table>");
        divServiceList.InnerHtml = sbSurvice.ToString();
        if (hidSubServId.Value.Length > 0)
        {
            hidSubServId.Value = hidSubServId.Value.Substring(0, hidSubServId.Value.Length - 1);
        }
    }
Esempio n. 21
0
    public void rating(int expert_id, int login_id, int value)
    {
        string      sql       = "";
        commonclass objcommon = new commonclass();

        sql = "select rating from tblRating where expert_id=" + Convert.ToInt32(Request.QueryString["expert_id"]) + " and login_id=" + login_id + "";
        int rating = 0;

        using (SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["connectionString"].ToString()))

            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }



                SqlCommand    CMD = new SqlCommand(sql, con);
                SqlDataReader dr  = CMD.ExecuteReader(CommandBehavior.CloseConnection);
                if (dr.HasRows)
                {
                    if (dr.Read())
                    {
                        rating = Convert.ToInt32(dr["rating"]);
                    }
                }
            }


            catch (Exception ex)
            {
                //strError = ex.Message;
                //bflag = false;
            }

        finally
        {
            // close the Sql Connection
            if (con.State == ConnectionState.Open)
            {
                con.Close();
            }
        }

        if (rating == 0)
        {
            sql = "insert into tblRating(expert_id,login_id,status,rating)values(" + expert_id + "," + login_id + ",4," + value + ")";
            if (objcommon.ReturnExecute(sql) > 0)
            {
            }
        }
        else
        {
            sql = "update  tblRating set rating=" + value + " where expert_id=" + expert_id + " and login_id=" + login_id + " ";
            if (objcommon.ReturnExecute(sql) > 0)
            {
            }
        }
    }
Esempio n. 22
0
    public bool getProduct(string Chapter_Id, int inner, int pagenumber, int numberofProd, ref string strPage)
    {
        bool        bflag      = false;
        int         totproduct = 0;
        commonclass objcat     = new commonclass();

        string strsql = "select count(a.Article_Id) as totproduct" +
                        " from tblArticle_Chapter_Relation r " +
                        " inner join tblArticleMaster a on a.Article_Id=r.Article_Id " +
                        " inner join tblChapter_Master c on c.Chapter_Id=r.Chapter_Id" +
                        " where c.Chapter_Id=" + Chapter_Id + " ";
        DataTable dtAllprod = objcat.Fetchrecords(strsql);

        if (dtAllprod.Rows.Count > 0)
        {
            totproduct = Convert.ToInt32(dtAllprod.Rows[0]["totproduct"]);
        }
        string strSql = "";

        if (pagenumber == 0)
        {
            strSql = "select  a.Article_Id,a.Article_Name," +
                     " a.Article_Matter " +
                     " from tblArticle_Chapter_Relation r " +
                     " inner join tblArticleMaster a on a.Article_Id=r.Article_Id " +
                     " inner join tblChapter_Master c on c.Chapter_Id=r.Chapter_Id " +
                     " where  c.Chapter_Id=" + Chapter_Id + " ";
        }
        else
        {
            strSql = "select top (" + numberofProd + ") a.Article_Id,a.Article_Name," +
                     " a.Article_Matter " +
                     " from tblArticle_Chapter_Relation r " +
                     " inner join tblArticleMaster a on a.Article_Id=r.Article_Id " +
                     " inner join tblChapter_Master c on c.Chapter_Id=r.Chapter_Id " +
                     " where a.Article_Id not in (select top (" + inner + ")a.Article_Id " +
                     " from tblArticle_Chapter_Relation r" +
                     " inner join tblArticleMaster a on a.Article_Id=r.Article_Id " +
                     " inner join tblChapter_Master c on c.Chapter_Id=r.Chapter_Id) " +
                     " and c.Chapter_Id=" + Chapter_Id + " ";
        }


        DataTable dtArticle = objcat.Fetchrecords(strSql);

        if (dtArticle.Rows.Count > 0)
        {
            dtlArticle.DataSource = dtArticle;
            dtlArticle.DataBind();
            StringBuilder sbpage = new StringBuilder();

            if (pagenumber != 0)
            {
                if (totproduct > numberofProd)
                {
                    int intfrompage = (pagenumber - 1) * numberofProd + 1;
                    int inttopage   = pagenumber * numberofProd;
                    if (inttopage > totproduct)
                    {
                        sbpage.Append(intfrompage + "-" + totproduct + " of " + totproduct);
                    }
                    else
                    {
                        sbpage.Append(intfrompage + "-" + inttopage + " of " + totproduct);
                    }

                    int nopages = 0;
                    if (totproduct > numberofProd)
                    {
                        if (totproduct % numberofProd != 0)
                        {
                            nopages = totproduct / numberofProd + 1;
                        }
                        else
                        {
                            nopages = totproduct / numberofProd;
                        }
                    }

                    if (intfrompage == 1)
                    {
                        // btnprev.Enabled = false;
                        sbpage.Append("<image src=\"images/prev_arrow.gif\">");
                    }
                    else
                    {
                        sbpage.Append("<a href=\"chapter.aspx?Chapter_Id=" + Chapter_Id + "&pageno=" + (pagenumber - 1) + "\"><image src=\"images/prev_arrow.gif\">");
                    }



                    for (int i = 0; i < nopages; i++)
                    {
                        if (pagenumber == (i + 1))
                        {
                            sbpage.Append(i + 1);
                        }
                        else
                        {
                            sbpage.Append("<a href=\"chapter.aspx?Chapter_Id=" + Chapter_Id + "&pageno=" + (i + 1) + "\">" + (i + 1) + "</a>");
                        }
                    }
                    if (pagenumber == nopages)
                    {
                        // btnnext.Enabled = false;
                        sbpage.Append("<image src=\"images/next_arrow.gif\">");
                    }
                    else
                    {
                        sbpage.Append("<a href=\"chapter.aspx?Chapter_Id=" + Chapter_Id + "&pageno=" + (pagenumber + 1) + "\"><image src=\"images/next_arrow.gif\">");
                    }
                    //sbpage.Append("<a href=\"chapter.aspx?Chapter_Id=" + Chapter_Id + "&pageno=0\"><image src=\"images/view_all_img.gif\">");
                }
            }
            else
            {
                sbpage.Append(totproduct + " of " + totproduct);
            }
            strPage = sbpage.ToString();

            bflag = true;
        }
        return(bflag);
    }