コード例 #1
0
    protected void btn_otp_Click(object sender, EventArgs e)
    {
        if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
        {
            Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
            string OTP = Session["OTP"].ToString();
            if (txt_otp.Text == OTP)
            {
                HttpBrowserCapabilities browse = Request.Browser;
                if (Session["VERIFICATION_TYPE"].ToString() == "User")
                {
                    bl.RegistrationID = Session["REGID"].ToString();
                    dt = dl.Select_User_detail(bl);
                    if (dt.table.Rows.Count > 0)
                    {
                        bl.UserID         = dt.table.Rows[0]["UserID"].ToString();
                        bl.RegistrationID = dt.table.Rows[0]["RegistrationID"].ToString();
                        bl.Password       = dt.table.Rows[0]["Password"].ToString();
                        bl.RollID         = "2";
                        bl.PasswordChange = "N";
                        bl.Active         = "Y";
                        bl.IsValid        = "Y";
                        bl.UserIP         = ul.GetClientIpAddress(this.Page);
                        bl.UserAgent      = Request.UserAgent.ToString();
                        bl.UserOS         = Utilities.System_Info(this.Page);
                        bl.User_browser   = browse.Browser;
                        using (TransactionScope ts = new TransactionScope())
                        {
                            rb = dl.Update_registration(bl);
                            if (rb.status == true)
                            {
                                rb = dl.Insert_Login(bl);
                                if (rb.status == true)
                                {
                                    ts.Complete();

                                    string str_msg = "";
                                    if (Session["language"].ToString() == "en-GB")
                                    {
                                        str_msg = "Your Mobile Varification Is successful. Your Userid is " + bl.UserID + " and Password is That You Have selected";
                                    }
                                    else
                                    {
                                        str_msg = "आपके मोबाईल की जाँच सफलतापूर्वक हो गई है| आपका यूजर आई. डी. है " + bl.UserID + "और पासवर्ड वह है जो आपने चुन लिया है |";
                                    }


                                    Utilities.MessageBox_UpdatePanel_Redirect(udp, str_msg, "../LogOut.aspx");
                                }
                            }
                        }
                    }
                }
                else if (Session["VERIFICATION_TYPE"].ToString() == "Rti")
                {
                    bl_rti.RTI_Request_id = Session["RTI_ID"].ToString();
                    dt = dl_rti.GetRtiStatus_detail(bl_rti);
                    if (dt.table.Rows.Count > 0)
                    {
                        bl_rti.IsValid = dt.table.Rows[0]["isvalid"].ToString();
                    }
                    if (bl_rti.IsValid == "N" || bl_rti.IsValid == "")
                    {
                        bl_rti.RTI_Request_id = Session["RTI_ID"].ToString();
                        bl_rti.IsValid        = "Y";
                        rb = dl_rti.update_Rti_status(bl_rti);
                        if (rb.status == true)
                        {
                            bl_rti.RTI_Request_id = Session["RTI_ID"].ToString();
                            dt = dl_rti.GetRtiStatus_detail(bl_rti);
                            if (dt.table.Rows.Count > 0)
                            {
                                bl_rti.Securitycode = dt.table.Rows[0]["seqcode"].ToString();
                                bl_rti.IsValid      = dt.table.Rows[0]["isvalid"].ToString();
                            }
                            string rti_message = "";
                            if (Session["language"].ToString() == "en-GB")
                            {
                                rti_message = "RTI Submission successfull your Registration no. is: " + bl_rti.RTI_Request_id + "  And  Your Security Code is:  " + bl_rti.Securitycode + "   please save  details for further Information.";
                            }
                            else
                            {
                                rti_message = "आपका आर. टी. आई. सफलता पूर्वक सबमिट हो गया, आपका रजिस्ट्रेशन न. है " + bl_rti.RTI_Request_id + " और सुरक्षा कोड है " + bl_rti.Securitycode + "कृपया विवरण को उपयोग के लिए सुरक्षित रखें|";
                            }


                            // string rti_message = "Your Mobile Varification Is successful. Your Rti Has Been Registered with registration no.: " + bl_rti.RTI_Request_id + " AND Your Security Code is " + bl_rti.Securitycode + ". Please Save Both For Details";
                            Utilities.MessageBox_UpdatePanel_Redirect(udp, rti_message, "../user/UserWelcome.aspx");
                        }
                    }
                    else
                    {
                        txt_otp.Text    = "";
                        div_otp.Visible = false;
                        if (Session["language"].ToString() == "en-GB")
                        {
                            Utilities.MessageBox_UpdatePanel_Redirect(udp, "Rti Already Registered", "../user/UserWelcome.aspx");
                        }
                        else
                        {
                            Utilities.MessageBox_UpdatePanel_Redirect(udp, "आर. टी. आई. पहले से ही रजिस्टर्ड है", "../user/UserWelcome.aspx");
                        }
                        //  Utilities.MessageBox_UpdatePanel_Redirect(udp, "Rti Already Registered", "../user/UserWelcome.aspx");
                    }
                }
            }
            else
            {
                if (Session["language"].ToString() == "en-GB")
                {
                    Utilities.MessageBox_UpdatePanel(udp, "Your Mobile Varification Is Unsuccessful. You Entered Wrong OTP");
                }
                else
                {
                    Utilities.MessageBox_UpdatePanel(udp, "गलत ओ. टी. पी. के कारण आपका मोबाईल जाँच असफल हो गया है|");
                }
                //Utilities.MessageBox_UpdatePanel(udp, "Your Mobile Varification Is Unsuccessful. You Entered Wrong OTP");
                txt_otp.Text    = "";
                div_otp.Visible = false;
            }
        }
    }
コード例 #2
0
 protected void btn_otp_Click(object sender, EventArgs e)
 {
     if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
     {
         Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
         string OTP = Session["OTP"].ToString();
         if (txt_otp.Text == OTP)
         {
             HttpBrowserCapabilities browse = Request.Browser;
             if (Session["VERIFICATION_TYPE"].ToString() == "User")
             {
                 bl.RegistrationID = Session["REGID"].ToString();
                 dt = dl.Select_User_detail(bl);
                 if (dt.table.Rows.Count > 0)
                 {
                     bl.UserID         = dt.table.Rows[0]["UserID"].ToString();
                     bl.RegistrationID = dt.table.Rows[0]["RegistrationID"].ToString();
                     bl.Password       = dt.table.Rows[0]["Password"].ToString();
                     bl.RollID         = "2";
                     bl.PasswordChange = "N";
                     bl.Active         = "Y";
                     bl.IsValid        = "Y";
                     bl.UserIP         = ul.GetClientIpAddress(this.Page);
                     bl.UserAgent      = Request.UserAgent.ToString();
                     bl.UserOS         = Utilities.System_Info(this.Page);
                     bl.User_browser   = browse.Browser;
                     using (TransactionScope ts = new TransactionScope())
                     {
                         rb = dl.Update_registration(bl);
                         if (rb.status == true)
                         {
                             rb = dl.Insert_Login(bl);
                             if (rb.status == true)
                             {
                                 ts.Complete();
                                 Utilities.MessageBox_UpdatePanel_Redirect(udp, "Your Mobile Varification Is successful. Your Userid is " + bl.UserID + " and Password is That You Have selected", "../LogOut.aspx");
                             }
                         }
                     }
                 }
             }
             else if (Session["VERIFICATION_TYPE"].ToString() == "Rti")
             {
                 bl_rti.RTI_Request_id = Session["RTI_ID"].ToString();
                 dt = dl_rti.GetRtiStatus_detail(bl_rti);
                 if (dt.table.Rows.Count > 0)
                 {
                     bl_rti.IsValid = dt.table.Rows[0]["isvalid"].ToString();
                 }
                 if (bl_rti.IsValid == "N" || bl_rti.IsValid == "")
                 {
                     bl_rti.RTI_Request_id = Session["RTI_ID"].ToString();
                     bl_rti.IsValid        = "Y";
                     rb = dl_rti.update_Rti_status(bl_rti);
                     if (rb.status == true)
                     {
                         bl_rti.RTI_Request_id = Session["RTI_ID"].ToString();
                         dt = dl_rti.GetRtiStatus_detail(bl_rti);
                         if (dt.table.Rows.Count > 0)
                         {
                             bl_rti.Securitycode = dt.table.Rows[0]["seqcode"].ToString();
                             bl_rti.IsValid      = dt.table.Rows[0]["isvalid"].ToString();
                         }
                         string rti_message = "Your Mobile Varification Is successful. Your Rti Has Been Registered with registration no.: " + bl_rti.RTI_Request_id + " AND Your Security Code is " + bl_rti.Securitycode + ". Please Save Both For Details";
                         Utilities.MessageBox_UpdatePanel_Redirect(udp, rti_message, "../user/UserWelcome.aspx");
                     }
                 }
                 else
                 {
                     txt_otp.Text    = "";
                     div_otp.Visible = false;
                     Utilities.MessageBox_UpdatePanel_Redirect(udp, "Rti Already Registered", "../user/UserWelcome.aspx");
                 }
             }
         }
         else
         {
             Utilities.MessageBox_UpdatePanel(udp, "Your Mobile Varification Is Unsuccessful. You Entered Wrong OTP");
             txt_otp.Text    = "";
             div_otp.Visible = false;
         }
     }
 }