protected void btn_save_Click(object sender, EventArgs e) { bl_RTI_Registration bl = new bl_RTI_Registration(); dl_RTI_Registration dl = new dl_RTI_Registration(); ReturnClass.ReturnDataTable rd = new ReturnClass.ReturnDataTable(); HttpBrowserCapabilities browse = Request.Browser; bl.UserID = txt_user_name.Text; rd = dl.CheckUserID(bl); if (rd.table.Rows.Count == 0) { bl.Password = util.GenerateMd5Hash(txt_password.Text.Trim()); bl.LoginID = ddl_employee.SelectedValue; bl.RegistrationID = bl.LoginID; bl.PasswordChange = ddl_change_pass.SelectedValue; bl.Active = ddl_active.SelectedValue; bl.UserIP = util.GetClientIpAddress(this.Page); bl.UserAgent = Request.UserAgent.ToString(); bl.UserOS = Utilities.System_Info(this.Page); bl.User_browser = browse.Browser; rb = dl.Insert_Login(bl); if (rb.status == true) { ddl_employee.SelectedValue = "0"; txt_user_name.Text = ""; Utilities.MessageBox_UpdatePanel(UpdatePanel1, "Record Saved Successfully"); grid_bind(); clear(); } else { Utilities.MessageBox_UpdatePanel(UpdatePanel1, "User Id For this Employee Already exist "); } } else { Utilities.MessageBox_UpdatePanel(UpdatePanel1, "User ID Not Available Please Choose Another UserID "); } }
protected void btn_submit_Click(object sender, EventArgs e) { if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString()) { Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString()); if (Page.IsValid) { Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim()); if (Captcha1.UserValidated) { if (btn_submit.Text == "Submit") { bl.UserID = txt_Userid.Text; rd = dl.CheckUserID(bl); if (rd.table.Rows.Count == 0) { HttpBrowserCapabilities browse = Request.Browser; bl.RegistrationID = dl.Get_unique_Registration_code(); bl.Password = ul.GenerateMd5Hash(txt_password.Text); bl.NameHindi = ""; bl.NameEnglish = txt_first_name.Text; bl.Gender = ddl_gender.SelectedValue; bl.MobileNo = txt_mobile.Text; bl.EmailID = txt_email.Text; bl.Address = txt_Address.Text; if (ddl_country.SelectedValue == "091") { bl.Country_name = txtState_Other.Text; bl.Country = ddl_country.SelectedValue; bl.Statecode = ddl_state.SelectedValue; bl.DistrictCode = ddl_district.SelectedValue; bl.DistrictName = txt_Districtname.Text; } else { bl.Country_name = txtState_Other.Text; bl.Statecode = ""; bl.Country = ddl_country.SelectedValue; bl.DistrictCode = ""; } bl.PinCode = txt_pincode.Text; bl.IsValid = "N"; bl.UserType = ddl_usertype.SelectedValue; bl.Registration_Year = DateTime.Now.Year.ToString(); bl.UserIP = ul.GetClientIpAddress(this.Page); bl.UserAgent = Request.UserAgent.ToString(); bl.UserOS = Utilities.System_Info(this.Page); bl.User_browser = browse.Browser; rb = dl.Insert_user_Registration(bl); if (rb.status == true) { Session["username"] = bl.UserID; Session["REGID"] = bl.RegistrationID; // Response.Redirect("User_Mobile_Varification.aspx?mobile=" + bl.MobileNo + "&RegistrationID=" + bl.RegistrationID + ""); Utilities.MessageBox_UpdatePanel_Redirect(udp_farm, "You Are Registered In Our Server You Need To Varify Your Mobile To activate Yor Login ID, We Are Redirecting To Our Varification Page", "user/User_Mobile_Varification.aspx"); } else { Utilities.MessageBoxShow("registration Unsuccessful"); } } else { Utilities.MessageBoxShow("User ID Not Available Please Choose Another UserID"); } } } else { Utilities.MessageBox_UpdatePanel(udp_farm, "Invalid Captcha"); } } } }
protected void btn_save_Click(object sender, EventArgs e) { if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString()) { Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString()); bl_RTI_Registration bl = new bl_RTI_Registration(); dl_RTI_Registration dl = new dl_RTI_Registration(); ReturnClass.ReturnDataTable rd = new ReturnClass.ReturnDataTable(); HttpBrowserCapabilities browse = Request.Browser; bl.UserID = txt_user_name.Text; rd = dl.CheckUserID(bl); if (rd.table.Rows.Count == 0) { bl.UserID = txt_user_name.Text; bl.Password = util.GenerateMd5Hash(txt_password.Text.Trim()); bl.LoginID = ddl_employee.SelectedValue; bl.RegistrationID = bl.LoginID; bl.PasswordChange = ddl_change_pass.SelectedValue; bl.Active = ddl_active.SelectedValue; bl.UserIP = util.GetClientIpAddress(this.Page); bl.UserAgent = Request.UserAgent.ToString(); bl.UserOS = Utilities.System_Info(this.Page); bl.User_browser = browse.Browser; rb = dl.Insert_Login(bl); if (rb.status == true) { ddl_employee.SelectedValue = "0"; txt_user_name.Text = ""; if (Session["language"].ToString() == "en-GB") { Utilities.MessageBox_UpdatePanel_Redirect(UpdatePanel1, "Record Saved Successfully", "user_login_entry.aspx"); } else { Utilities.MessageBox_UpdatePanel_Redirect(UpdatePanel1, "रिकॉर्ड सफलतापूर्वक सुरक्षित रखा गया", "user_login_entry.aspx"); } //Utilities.MessageBox_UpdatePanel_Redirect(UpdatePanel1, "Record Saved Successfully", "user_login_entry.aspx"); grid_bind(); clear(); } else { if (Session["language"].ToString() == "en-GB") { Utilities.MessageBox_UpdatePanel(UpdatePanel1, "User Id For this Employee Already exist "); } else { Utilities.MessageBox_UpdatePanel(UpdatePanel1, "इस कर्मचारी के लिए उपयोगकर्ता आईडी पहले से मौजूद है "); } // Utilities.MessageBox_UpdatePanel(UpdatePanel1, "User Id For this Employee Already exist "); } } else { if (Session["language"].ToString() == "en-GB") { Utilities.MessageBox_UpdatePanel(UpdatePanel1, "User ID Not Available Please Choose Another UserID "); } else { Utilities.MessageBox_UpdatePanel(UpdatePanel1, "उपयोगकर्ता आईडी उपलब्ध नहीं है कृपया अन्य यूजरआईडी चुनें "); } // Utilities.MessageBox_UpdatePanel(UpdatePanel1, "User ID Not Available Please Choose Another UserID "); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString()); try { if (Session["username"].ToString() != null) { bl.UserID = Session["username"].ToString(); dt = dl.CheckUserID(bl); if (dt.table.Rows.Count == 0) { bl.RegistrationID = Session["REGID"].ToString(); dt = dl.Select_User_detail(bl); if (dt.table.Rows.Count > 0) { bl.MobileNo = dt.table.Rows[0]["MobileNo"].ToString(); bl.UserID = dt.table.Rows[0]["UserID"].ToString(); Session["VERIFICATION_TYPE"] = "User"; } } else if (dt.table.Rows.Count > 0) { if (Session["VERIFICATION_TYPE"].ToString() == "Rti") // For Rti { bl.RegistrationID = dt.table.Rows[0]["LoginID"].ToString(); Session["REGID"] = bl.RegistrationID; bl_rti.RTI_Request_id = Session["RTI_ID"].ToString(); dt = dl_rti.GetMobileNumForVerification(bl_rti); if (dt.table.Rows.Count > 0) { bl.MobileNo = dt.table.Rows[0]["Mobile_No"].ToString(); bl.UserID = dt.table.Rows[0]["User_ID"].ToString(); } } else { bl.RegistrationID = dt.table.Rows[0]["LoginID"].ToString(); Session["REGID"] = bl.RegistrationID; dt = dl.Select_User_detail(bl); if (dt.table.Rows.Count > 0) { bl.MobileNo = dt.table.Rows[0]["MobileNo"].ToString(); bl.UserID = dt.table.Rows[0]["UserID"].ToString(); } } // VERIFICATION_TYPE ==User } } else { Response.Redirect("../LogOut.aspx"); } } catch (NullReferenceException ex) { Response.Redirect("../LogOut.aspx"); } txt_mobile.Text = bl.MobileNo; ////btn_send.Text = "Send"; // moved this line to pre_render event } }