public void FillGrid() { BA_Merchants mer = new BA_Merchants(); DataSet ds = new DataSet(); ds = mer.GetPostingJobs(ViewState["FunAreaLoc"].ToString(), ViewState["Type"].ToString(), ViewState["orderby"].ToString(), Session["maincatJ"].ToString(), Session["maintypeJ"].ToString()); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { pnlMain.Visible = true; pnlSub.Visible = false; _PageDataSource.DataSource = ds.Tables[0].DefaultView; _PageDataSource.AllowPaging = true; _PageDataSource.PageSize = PageSize; _PageDataSource.CurrentPageIndex = CurrentPage; ViewState["TotalPages"] = _PageDataSource.PageCount; this.lblPageInfo.Text = "Page " + (CurrentPage + 1) + " of " + _PageDataSource.PageCount; this.lbtnPrevious.Enabled = !_PageDataSource.IsFirstPage; this.lbtnNext.Enabled = !_PageDataSource.IsLastPage; this.lbtnFirst.Enabled = !_PageDataSource.IsFirstPage; dlPostedJobs.DataSource = _PageDataSource; dlPostedJobs.DataBind(); this.doPaging(); } else { pnlMain.Visible = false; pnlSub.Visible = true; } } }
protected void btnsearch_Click(object sender, EventArgs e) { string companyname = ddlindustry.SelectedItem.Text; string location = ddlstate.SelectedItem.Text; if (ddlindustry.SelectedIndex == 0) { companyname = ""; } if (ddlstate.SelectedIndex == 0) { location = ""; } DataSet ds = new DataSet(); BA_Merchants mer = new BA_Merchants(); ds = mer.GetSearchMerchantsList(1, ViewState["orderby"].ToString(), companyname, location); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { pnlMain.Visible = true; pnl.Visible = true; pnlSub.Visible = false; _PageDataSource.DataSource = ds.Tables[0].DefaultView; _PageDataSource.AllowPaging = true; _PageDataSource.PageSize = PageSize; _PageDataSource.CurrentPageIndex = CurrentPage; ViewState["TotalPages"] = _PageDataSource.PageCount; this.lblPageInfo.Text = "Page " + (CurrentPage + 1) + " of " + _PageDataSource.PageCount; this.lbtnPrevious.Enabled = !_PageDataSource.IsFirstPage; this.lbtnNext.Enabled = !_PageDataSource.IsLastPage; this.lbtnFirst.Enabled = !_PageDataSource.IsFirstPage; dlMerchantList.DataSource = _PageDataSource; dlMerchantList.DataBind(); this.doPaging(); } else { //ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert(' Search Criteria Not Found')", true); pnlMain.Visible = true; pnlSub.Visible = true; pnl.Visible = false; } } else { pnlMain.Visible = true; pnlSub.Visible = true; pnl.Visible = false; } }
protected void FillGrid() { DataSet ds = new DataSet(); BA_Merchants mer = new BA_Merchants(); ds = mer.GetMerchantsList(1, ViewState["orderby"].ToString()); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { pnlMain.Visible = true; pnlSub.Visible = false; _PageDataSource.DataSource = ds.Tables[0].DefaultView; _PageDataSource.AllowPaging = true; _PageDataSource.PageSize = PageSize; _PageDataSource.CurrentPageIndex = CurrentPage; ViewState["TotalPages"] = _PageDataSource.PageCount; this.lblPageInfo.Text = "Page " + (CurrentPage + 1) + " of " + _PageDataSource.PageCount; this.lbtnPrevious.Enabled = !_PageDataSource.IsFirstPage; this.lbtnNext.Enabled = !_PageDataSource.IsLastPage; this.lbtnFirst.Enabled = !_PageDataSource.IsFirstPage; dlMerchantList.DataSource = _PageDataSource; dlMerchantList.DataBind(); this.doPaging(); } else { pnlMain.Visible = false; pnlSub.Visible = true; } } else { pnlMain.Visible = false; pnlSub.Visible = true; } //mnrstring = "select top 1000 ROW_NUMBER() over(order by id desc) as Sno,id, userid,firstname,lastname,companyname,phone,email,typeofenquiry from tblMerchantReg"; //da = new SqlDataAdapter(mnrstring, conn); //da.Fill(ds); // dlMerchantList.DataSource = ds; //dlMerchantList.DataBind(); }
protected void lnkbtnDResume_Click(object sender, EventArgs e) { try { BA_Merchants bamer = new BA_Merchants(); if (ViewState["jsid"].ToString() != "") { DataSet ds = new DataSet(); string filename = ViewState["jsid"].ToString(); ds = bamer.GetFileName(filename); string fname = ds.Tables[0].Rows[0][0].ToString(); if (filename != "") { string path = conn1 + ViewState["jsid"].ToString() + ".doc"; string path1 = conn1 + ViewState["jsid"].ToString() + ".docx"; string path2 = conn1 + fname; System.IO.FileInfo filed = new System.IO.FileInfo(path); System.IO.FileInfo filed1 = new System.IO.FileInfo(path1); System.IO.FileInfo filed2 = new System.IO.FileInfo(path2); if (filed.Exists) { try { Response.Redirect("~/ploutos/dummy.aspx?fName=" + path + "&id2=" + Convert.ToString(Session["MemName"]) + "_" + ViewState["jsid"].ToString(), false); HttpContext.Current.ApplicationInstance.CompleteRequest(); Response.Flush(); } catch (Exception ex) { } } else if (filed1.Exists) { FileStream sourceFile = null; try { //Response.Redirect("~/ploutos/dummy.aspx?fName=" + path1 + "&id2=" + ViewState["jsid"].ToString(), false); Response.Redirect("~/ploutos/dummy.aspx?fName=" + path1 + "&id2=" + Convert.ToString(Session["MemName"]) + "_" + ViewState["jsid"].ToString(), false); HttpContext.Current.ApplicationInstance.CompleteRequest(); Response.Flush(); } catch (Exception ex) { } } if (filed2.Exists) { FileStream sourceFile = null; try { //Response.Redirect("~/ploutos/dummy.aspx?fName=" + path1 + "&id2=" + ViewState["jsid"].ToString(), false); Response.Redirect("~/ploutos/dummy.aspx?fName=" + path2 + "&id2=" + Convert.ToString(Session["MemName"]) + "_" + ViewState["jsid"].ToString(), false); HttpContext.Current.ApplicationInstance.CompleteRequest(); Response.Flush(); } catch (Exception ex) { } } else { lblresumeMsg.Visible = true; lblresumeMsg.Text = "Resume Unavailable"; } } } else { lblresumeMsg.Visible = true; lblresumeMsg.Text = "Resume Unavailable"; } } catch (Exception ex) { } }