コード例 #1
0
    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 ");
        }
    }
コード例 #2
0
    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 ");
            }
        }
    }
コード例 #3
0
    protected void btn_Submit_Click1(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
            {
                Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
                bool cptch_expired = false;
                try
                {
                    Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
                }
                catch { cptch_expired = true; }
                txtCaptcha.Text = "";
                if (!cptch_expired)
                {
                    if (Captcha1.UserValidated)
                    {
                        Captcha1.DataBind();
                        dl_RTI_Registration dl    = new dl_RTI_Registration();
                        bl_RTI_Request      objBL = new bl_RTI_Request();
                        dl_RTI_Request      objDl = new dl_RTI_Request();
                        // set data for rti_request
                        objBL.RTI_Request_id = objDl.Get_unique_RtiRequest_code(); //"<NTC>RTI Request ID from DL";//objDl.GetMaxValue("SELECT IFNULL(MAX(rti_request_id),0) as NO FROM rti_detail ");
                        objBL.UserType       = ddl_usertype.SelectedItem.Value;
                        objBL.NameEnglish    = txtName.Text;
                        objBL.Gender         = DDL_Gender.SelectedItem.Value;
                        objBL.Email          = txtEmailID.Text;
                        objBL.Address        = txtAddress.Text;
                        objBL.Country        = ddl_country.SelectedItem.Value;
                        objBL.Securitycode   = dl.GenOTPString(4);
                        HttpBrowserCapabilities browse = Request.Browser;
                        objBL.UserAgent       = Request.UserAgent.ToString();
                        objBL.Client_os       = Utilities.System_Info(this.Page);
                        objBL.ClientBrowser   = browse.Browser;
                        objBL.IsRTIFileUpload = "N";
                        objBL.IsNew           = "Y";
                        if (objBL.Country == "091")
                        {
                            objBL.State       = DDL_State.SelectedItem.Value;
                            objBL.District    = ddl_district.SelectedItem.Value;
                            objBL.CountryName = null;
                        }
                        else
                        {
                            objBL.CountryName = txtState_Other.Text;
                        }
                        objBL.Pincode            = txtPinCode.Text;
                        objBL.Mobile             = txtMobile.Text;
                        objBL.Rti_Subject        = txt_subject.Text;
                        objBL.RTI_Text           = txt_RequestApplicationText.Text;
                        objBL.RTI_login_userName = userID;
                        //objBL.RTI_request_date = DateTime.Now.ToString("yyyy-MM-dd");
                        Utilities util = new Utilities();
                        objBL.RTI_ipaddress = util.GetClientIpAddress(this.Page);//GetIPAddress();
                        objBL.RTI_Is_bpl    = DDL_BPL.SelectedItem.Value;
                        # region check for BPL
                        if (objBL.RTI_Is_bpl == "Y")
                        {
                            if (FU_BPL.PostedFile == null || FU_BPL.PostedFile.ContentLength < 1)
                            {
                                Utilities.MessageBox_UpdatePanel(update1, "Attach one BPL Supporting Document ");
                                return;
                            }
                            objBL.BPL_Card_No = txtBPLNo.Text;
                            int Current_year = Convert.ToInt32(DateTime.Now.Year);
                            int find_year    = Convert.ToInt32(txtYearOfIssue.Text);

                            if (find_year > Current_year)
                            {
                                // Utilities.MessageBoxShow("Year should not be greater then current year");
                                Utilities.MessageBox_UpdatePanel(update1, "Year should not be greater then current year ");
                                return;
                            }
                            else
                            {
                                objBL.BPL_Issue_Year = txtYearOfIssue.Text;
                            }
                            objBL.BPL_Issuing_Authority = txtIssuingAuthority.Text;
                            //objBL.RTI_Fees = "0";
                        }

                        else
                        {
                            //objBL.RTI_Fees = "10";
                        }
                        #endregion BPL
                        // set data for rti_filed_user
                        // objBL.RTI_filed_user_id = objDl.GetMaxValueRtiFiledUser();//"<NTC>RTI Filed user ID from DL"; //objDl.GetMaxValue("SELECT IFNULL(MAX(rti_FiledUserID),0) as NO FROM rti_filed_user ");
                        # region file submit problem is generating here
                        objBL.RTI_filed_user_id = objBL.RTI_Request_id;
                        objBL.Rti_Status        = "REG"; //Initial status of RTI Filed
                        objBL.Action_id         = "";
                        objBL.IsValid           = "N";
                        objBL.Office_mapping_id = DDL_RTI_Officer.SelectedValue;
                        objBL.Action_date       = DateTime.Now.ToString("yyyy-MM-dd"); // Need to ask
                        //objBL.Rti_Status = "registered"; // initial status
                        //set data for rti_file
                        string RTI_fileID = objDl.GetMaxValueRtiFiles();// "<NTC> file iD";//objDl.GetMaxValue("SELECT IFNULL(MAX(rti_fileID),0) as NO FROM rti_files ");

                        List <bl_RTI_RequestFiles> objList = new List <bl_RTI_RequestFiles>();

                        int maxCountFileID = Convert.ToInt32(RTI_fileID);
                        if (FU_BPL.PostedFile != null && FU_BPL.PostedFile.FileName != "")
                        {
                            if (FU_BPL.PostedFile.ContentLength > 0)
                            {
                                bl_RTI_RequestFiles objBLFile  = new bl_RTI_RequestFiles();
                                HttpPostedFile      postedFile = FU_BPL.PostedFile;

                                objBLFile.FileDescription  = txt_FU_BPL_Disc.Text;
                                objBLFile.RTI_fileID       = maxCountFileID.ToString();
                                objBLFile.RTI_fileName     = Path.GetFileName(postedFile.FileName);
                                objBLFile.RTI_fileType     = postedFile.ContentType;
                                objBLFile.BPL_RTI_FileType = "BPL_DOC";  // it is a BPL Supporting Document
                                objBLFile.RTI_Request_id   = objBL.RTI_Request_id;
                                Stream fs = postedFile.InputStream;

                                if ((objBLFile.RTI_fileType == "application/pdf" || objBLFile.RTI_fileType == "application/x-pdf" || objBLFile.RTI_fileType == "application/x-unknown") && fs.Length < 2097152)
                                {
                                    BinaryReader br    = new BinaryReader(fs);
                                    byte[]       bytes = br.ReadBytes((Int32)fs.Length);
                                    objBLFile.RTI_fileData = bytes;
                                    maxCountFileID         = maxCountFileID + 1;
                                    objList.Add(objBLFile);   // Add into the list
                                }
                                else
                                {
                                    //statusCount = 1;
                                    // Utilities.MessageBoxShow("Only Image File and less then 1000 KB is accepted");
                                    //lbl_status.Text = " Only Image File and less then 1000 KB is accepted ";
                                    Utilities.MessageBox_UpdatePanel(update1, " Only PDF File and less then 2000 KB is accepted for BPL File");
                                    return;
                                }
                            }
                            else
                            {
                                Utilities.MessageBox_UpdatePanel(update1, " BPL File Size Must be great then Zero");
                                return;
                            }
                        }
                        // RTI File Insert in data base
                        if (FU_RTI.PostedFile != null && FU_RTI.PostedFile.FileName != "")
                        {
                            if (FU_RTI.PostedFile.ContentLength > 0)
                            {
                                bl_RTI_RequestFiles objBLFile  = new bl_RTI_RequestFiles();
                                HttpPostedFile      postedFile = FU_RTI.PostedFile;

                                objBLFile.FileDescription  = txt_FU_RTI_Disc.Text;
                                objBLFile.RTI_fileID       = maxCountFileID.ToString();
                                objBLFile.RTI_fileName     = Path.GetFileName(postedFile.FileName);
                                objBLFile.RTI_fileType     = postedFile.ContentType;
                                objBLFile.BPL_RTI_FileType = "RTI_DOC";    // it is RTI Document
                                objBLFile.RTI_Request_id   = objBL.RTI_Request_id;
                                Stream fs = postedFile.InputStream;

                                if ((objBLFile.RTI_fileType == "application/pdf" || objBLFile.RTI_fileType == "application/x-pdf" || objBLFile.RTI_fileType == "application/x-unknown") && fs.Length < 2097152)
                                {
                                    BinaryReader br    = new BinaryReader(fs);
                                    byte[]       bytes = br.ReadBytes((Int32)fs.Length);
                                    objBLFile.RTI_fileData = bytes;
                                    maxCountFileID         = maxCountFileID + 1;
                                    objList.Add(objBLFile);   // Add into the list
                                }
                                else
                                {
                                    //statusCount = 1;
                                    // Utilities.MessageBoxShow("Only Image File and less then 1000 KB is accepted");
                                    //lbl_status.Text = " Only Image File and less then 1000 KB is accepted ";
                                    Utilities.MessageBox_UpdatePanel(update1, " Only PDF File and less then 2000 KB is accepted for RTI File");
                                    return;
                                }
                            }

                            else
                            {
                                Utilities.MessageBox_UpdatePanel(update1, "RTI File Size Must be greater then Zero");
                                return;
                            }
                            objBL.IsRTIFileUpload = "Y";
                        }
                        #endregion
                        if (objBL.Mobile == H_LoginMobileNo.Value)
                        {
                            objBL.IsValid = "Y";
                        }

                        ReturnClass.ReturnBool dt = objDl.Insert_RTI_Info(objBL, objList);
                        if (dt.status == true)
                        {
                            if (objBL.Mobile == H_LoginMobileNo.Value)
                            {      // Directly go to success page No Need OTP
                                string rti_message = "RTI Submition successfull your Registration no. is: " + objBL.RTI_Request_id + "  And  Your Security Code is:  " + objBL.Securitycode + "   please save  details for further Information.";
                                Utilities.MessageBox_UpdatePanel_Redirect(update1, rti_message, "./UserWelcome.aspx");
                            }
                            else
                            {
                                Session["RTI_ID"]            = objBL.RTI_Request_id;
                                Session["VERIFICATION_TYPE"] = "Rti";

                                Utilities.MessageBox_UpdatePanel_Redirect(update1, "Your RTI Request has been submited Need Mobile Verification for Registeration", "./User_Mobile_Varification.aspx");
                            }
                        }
                        else
                        {
                            Utilities.MessageBox_UpdatePanel(update1, "RTI Submition Failed");
                        }
                    }//end of captcha1 validated
                    else
                    {
                        Utilities.MessageBox_UpdatePanel(update1, "Incorrect Security Code");
                    }
                } // If ! captch expired
            }     // End of If checkRefresh