public void SessionSaving()
        {
            try
            {
                objUserplantype = new Userplantype();
                objBL_PlanType = new BL_PlanType();
                lstUserPlanType = new List<Userplantype>();

                int PlanID = Convert.ToInt32(Request.QueryString["PlanID"].ToString());
                lstUserPlanType = objBL_PlanType.SelectUserplantypeforcampid(PlanID);

                if (lstUserPlanType.Count > 0)
                {
                    string[] UPtype = new string[3];
                    UPtype[0] = Convert.ToString(lstUserPlanType[0].IsSingleUser);
                    UPtype[1] = Convert.ToString(lstUserPlanType[0].NOC);
                    UPtype[2] = Convert.ToString(lstUserPlanType[0].AllowedMails);
                    Session["lstUserPlanType"] = UPtype;
                }
            }
            catch (Exception ex)
            {
                New_EmailCampaign.App_Code.GlobalFunction.StoreLog("UserPlanSuccess.aspx:SessionSaving() - " + ex.Message);
            }
        }
        public void RetrieveUserplantype()
        {
            try
            {
                objUserplantype = new Userplantype();
                objBL_PlanType = new BL_PlanType();
                lstUserplantype = new List<Userplantype>();
                lstUserplantype = objBL_PlanType.SelectUserplantypeforcampid(Convert.ToInt32(HttpUtility.UrlDecode(Request.QueryString["PlantypId"]).ToString()));

                if (lstUserplantype.Count > 0)
                {
                    txtCampaignName.Value = lstUserplantype[0].PlanName;

                    if (lstUserplantype[0].IsSingleUser == true)
                        rbuserselect.SelectedValue = "1";
                    else
                        rbuserselect.SelectedValue = "0";

                    txtPlanRate.Value = lstUserplantype[0].Planrate.ToString();
                    txtnosubscribers.Value = lstUserplantype[0].NOC.ToString();
                    txtnomails.Value = lstUserplantype[0].AllowedMails.ToString();

                    if (lstUserplantype[0].IsActive == true)
                        chkactive.Checked = true;

                }
                lstUserplantype = null;
                objBL_PlanType = null;
                objUserplantype = null;
            }
            catch (Exception ex)
            {
                New_EmailCampaign.App_Code.GlobalFunction.StoreLog("UserPlanType.aspx:RetrieveUserplantype() - " + ex.Message);
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                objUserplantype = new Userplantype();
                lstUserplantype = new List<Userplantype>();

                if (Request.QueryString["PlantypId"] != null)
                {
                    objUserplantype = new Userplantype();
                    lstUserplantype = new List<Userplantype>();
                    objBL_PlanType = new BL_PlanType();
                    lstUserplantype = objBL_PlanType.SelectUserplantypeforcampid(Convert.ToInt32(HttpUtility.UrlDecode(Request.QueryString["PlantypId"]).ToString()));

                    if (lstUserplantype.Count > 0)
                    {
                        objBL_Common.AccessUpdateAllCampaign("EC_PlanType", "PlanName= '" + txtCampaignName.Value + "', IsSingleUser= "******", Planrate= " + txtPlanRate.Value + ", NOC= " + txtnosubscribers.Value + ", AllowedMails = " + txtnomails.Value + ", UpdatedBy = " + Convert.ToInt32(Session["UserID"].ToString()) + ", UpdatedOn = '" + DateTime.Now + "' ", "PK_PlanID =" + Convert.ToInt32(HttpUtility.UrlDecode(Request.QueryString["PlantypId"]).ToString()) + "");
                    }
                    lstUserplantype = null;
                    objUserplantype = null;
                    objBL_PlanType = null;
                }
                else
                {
                    objUserplantype.PlanName = txtCampaignName.Value;

                    if (Convert.ToInt32(rbuserselect.SelectedValue) == 1)
                        objUserplantype.IsSingleUser = true;
                    else
                        objUserplantype.IsSingleUser = false;

                    objUserplantype.Planrate = Convert.ToInt32(txtPlanRate.Value);
                    objUserplantype.NOC = Convert.ToInt32(txtnosubscribers.Value);
                    objUserplantype.AllowedMails = Convert.ToInt32(txtnomails.Value);

                    if (chkactive.Checked == true)
                        objUserplantype.IsActive = true;
                    else
                        objUserplantype.IsActive = false;

                    objUserplantype.Plandate = DateTime.Now;
                    objUserplantype.CreatedOn = DateTime.Now;
                    objUserplantype.CreatedBy = Convert.ToInt32(Session["UserID"].ToString());
                    objBL_PlanType.AccessInsertUserplantype(objUserplantype);

                }
                ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "Clearuserinput2();", true);
            }
            catch (Exception ex)
            {
                New_EmailCampaign.App_Code.GlobalFunction.StoreLog("UserPlanType.aspx:btnSubmit_Click() - " + ex.Message);
            }
        }
        private void BindGrid()
        {
            try
            {
                lstUserplantype = new List<Userplantype>();
                objBL_PlanType = new BL_PlanType();
                objUserplantype = new Userplantype();
                lstUserplantype = objBL_PlanType.SelectAllUserplantypebasedonisactive();
                string PlanName = "";
                string Planprice = "";
                int NoSubscribers = 0;
                int AllowdMails = 0;
                lblUsrPlan.Text = string.Empty;

                if (lstUserplantype.Count > 1)
                {
                    lblUsrPlan.Text = "<section id='pricePlans'><ul id='plans'>";
                    for (int i = 0; i < lstUserplantype.Count; i++)
                    {
                        PlanName = lstUserplantype[i].PlanName;

                        if (lstUserplantype[i].Planrate != null)
                            Planprice = lstUserplantype[i].Planrate.ToString();

                        NoSubscribers = lstUserplantype[i].NOC;
                        AllowdMails = lstUserplantype[i].AllowedMails;

                        if (i == 0)
                            lblUsrPlan.Text += "<li class='plan'> <ul class='planContainer'> <li class='title'><h2><span id='RepDetails_lblSubject_0'>";
                        else
                            lblUsrPlan.Text += "<li class='plan'> <ul class='planContainer'> <li class='title'><h2><span id='RepDetails_lblSubject_0'>";

                        lblUsrPlan.Text += PlanName + "</h2></li><li class='price'><h1 class='bestPlanPrice'><span>$";
                        lblUsrPlan.Text += Planprice + " / month</span> <small>No FREE trial</small> </h1></li><li><ul class='options'><li>Number of Subscribers:<span id='RepDetails_lblnos_0'>";
                        lblUsrPlan.Text += NoSubscribers + "</span> </li><li>Allowed Mails:<span id='RepDetails_lblComment_0'>";
                        lblUsrPlan.Text += AllowdMails + "</span> </li><li>Is Single User";

                        if (lstUserplantype[i].IsSingleUser == true)
                            lblUsrPlan.Text += "<img id='img" + lstUserplantype[i].PK_PlanID.ToString() + "'  src='images/Tick_inside_a_circle_24(1).png' border='0' style='width:30px;height:30px;'/>";

                        lblUsrPlan.Text += "</li><li> Is Multiple User";

                        if (lstUserplantype[i].IsSingleUser == false)
                            lblUsrPlan.Text += "<img id='img" + lstUserplantype[i].PK_PlanID.ToString() + "'  src='images/Tick_inside_a_circle_24(1).png' border='0' style='width:30px;height:30px;'/>";

                        lblUsrPlan.Text += "</li><li>Masss Email </li></ul></li><li class='button'><input name='btnCo" + i.ToString() + "' type='button' value='TRY THIS PLAN' ";

                        if (Convert.ToInt64(Session["Usertype"]) != 10)
                            lblUsrPlan.Text += "onclick=location.href='UserPlanSuccess.aspx?PlanID=" + lstUserplantype[i].PK_PlanID + "'>";

                        lblUsrPlan.Text += " </li></ul>";//<a href='#' class='btn btn-success' role='button' name='RepDetails$ctl01$email' id='RepDetails_email_0' type='submit'>TRY THIS PLAN</a>

                        PlanName = "";
                        Planprice = "";
                        NoSubscribers = 0;
                        AllowdMails = 0;
                    }
                    lblUsrPlan.Text += "</ul></section>";
                }

            }
            catch (Exception ex)
            {
                New_EmailCampaign.App_Code.GlobalFunction.StoreLog("UserPlanView.aspx:BindGrid() - " + ex.Message);
            }
        }