void FillGridLMS(string plannercode)
    {
        if ((string)Session["AdminSessionID"] != null)
        {
            string xCode           = Session["AdminSessionID"].ToString();
            string xSearchRes      = "";
            string xCB             = "";
            string xPlannerAssign  = "";
            string xOperatorAssign = "";
            string xCustomer       = "";
            string xLeadType       = "";

            if (DDLeadType.SelectedValue.ToString() != "-1")
            {
                xLeadType = " and LeadType='" + DDLeadType.SelectedValue + "' ";
            }

            xOperatorAssign = " and PlannerCode=" + plannercode + " ";
            string sr = " " +
                        " select Code, PlannerCode=isnull(PlannerCode,-1),  Name, Gender, Age=(year(getdate())-year(DOB)), " +
                        " OperatorCode=isnull(OperatorCode,-1), Mobile1, Email1, City, " +
                        " Source1=isnull((Select Name from fp_ComboDetail where Code=p.Source1 ),'N/A'), " +
                        " Source2=isnull((Select Name from fp_ComboDetail where Code=p.Source2 ),'N/A')," +
                        " Source3=isnull((Select C_Name from fp_Campaign where C_ClientSatusCode=p.ClientStatus ),'N/A')," +
                        " OPType1, OPType2, SiteAC, TxnAC, " +
                        " Remarks,EntryDate=Convert(varchar(11), SystemDate, 105), LeadType=isnull(LeadType,-1), " +
                        " AllocateDate=convert(varchar(11),allocateDate,105)," +
                        " LastActivityDate=isnull((select convert(varchar(11), max(ActionDate), 105) " +
                        " from fp_ActivityMonitor where ClientCode=p.Code),'Create'), PlannerLock=isnull(PLock,'X')  " +
                        " from fp_prospects p where Name like '%" + xSearchRes + "%' " + xCB + " " + xPlannerAssign + " " +
                        " " + xOperatorAssign + " " + xCustomer + " " + xLeadType + " order by SystemDate desc " +
                        "  ";
            SqlDataAdapter GDA = new SqlDataAdapter(sr, Con);

            DataSet GDS = new DataSet();
            Con.Open();
            GDA.Fill(GDS);
            Con.Close();

            GridViewLMS.DataSource = GDS;
            GridViewLMS.DataBind();
            GridViewLMS_excel.DataSource = GDS;
            GridViewLMS_excel.DataBind();
        }
        else
        {
            Response.Redirect("SessionExpired.aspx");
        }
    }
    void FillGridLMS(string searchres)
    {
        if ((string)Session["AdminSessionID"] != null)
        {
            string xCode           = Session["AdminSessionID"].ToString();
            string xSearchRes      = searchres;
            string xCB             = "";
            string xPlannerAssign  = "";
            string xOperatorAssign = "";
            string xCustomer       = "";
            string xLeadType       = "";

            if (ViewState["xPRole"].ToString() == "Planner" || ViewState["xPRole"].ToString() == "BDM" || ViewState["xPRole"].ToString() == "Management")
            {
                //xPlannerAssign = " and isnull(PlannerCode,'-1')='-1' ";
                xOperatorAssign = " and PlannerCode=" + ViewState["xSessionCode"] + " ";
            }


            SqlDataAdapter GDA = new SqlDataAdapter(" " +

                                                    " select Code, PlannerCode=isnull(PlannerCode,-1),  Name, Gender, Age=(year(getdate())-year(DOB)), " +
                                                    " OperatorCode=isnull(OperatorCode,-1), Mobile1, Email1, City, " +
                                                    " Source1=(Select Name from fp_ComboDetail where Code=p.Source1 ), " +
                                                    " Source2=(Select Name from fp_ComboDetail where Code=p.Source2 )," +
                                                    " OPType1, OPType2, SiteAC, TxnAC, " +
                                                    " Remarks,EntryDate=Convert(varchar(11), SystemDate, 105), LeadType=isnull(LeadType,-1), " +
                                                    " AllocateDate=convert(varchar(11),allocateDate,105)," +
                                                    " LastActivityDate=isnull((select convert(varchar(11), max(ActionDate), 105) " +
                                                    " from fp_ActivityMonitor where ClientCode=p.Code),'Create'), PlannerLock=isnull(PLock,'X')  " +
                                                    " from fp_Prospects_Trash p where Name like '%" + xSearchRes + "%' " + xCB + " " + xPlannerAssign + " " +
                                                    " " + xOperatorAssign + " " + xCustomer + " " + xLeadType + " order by SystemDate desc " +
                                                    "  ", Con);

            DataSet GDS = new DataSet();
            Con.Open();
            GDA.Fill(GDS);
            Con.Close();

            GridViewLMS.DataSource = GDS;
            GridViewLMS.DataBind();
        }
        else
        {
            Response.Redirect("SessionExpired.aspx");
        }
    }
Example #3
0
 void FillGridLMS(string searchres)
 {
     if ((string)Session["AdminSessionID"] != null)
     {
         string         qry = "select Code, Name, Mobile1, Email1, Pwd from fp_Prospects where userid in (" + searchres + ")";
         SqlDataAdapter GDA = new SqlDataAdapter(qry, Con);
         DataSet        GDS = new DataSet();
         Con.Open();
         GDA.Fill(GDS);
         Con.Close();
         GridViewLMS.DataSource = GDS;
         GridViewLMS.DataBind();
     }
     else
     {
         Response.Redirect("SessionExpired.aspx");
     }
 }
Example #4
0
 protected void OnPaging(object sender, GridViewPageEventArgs e)
 {
     GridViewLMS.PageIndex = e.NewPageIndex;
     GridViewLMS.DataBind();
     FillGridLMS(ViewState["xSItem"].ToString());
 }
 protected void OnPaging(object sender, GridViewPageEventArgs e)
 {
     GridViewLMS.PageIndex = e.NewPageIndex;
     GridViewLMS.DataBind();
     FillGridLMS("");
 }