示例#1
0
    } // pageLoad End


    protected void btn_submit_Click(object sender, EventArgs e)
    {

        bl_employee_action bl1 = new bl_employee_action();
        dl_employee_action dl1 = new dl_employee_action();
        if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
        {
            Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
            HttpBrowserCapabilities browse = Request.Browser;
            bl.RegistrationID = h_RTI_ID.Value;
            rd = dl.Select_rti_action_detail(bl);
            if (rd.table.Rows.Count > 0)
            {
                 bl1.Rti_id = h_RTI_ID.Value;
                 bl1.Userid = Session["username"].ToString();
                 bl1.Dept_Status = "NREV";
                 bl1.Action_id = dl1.max_action_id(bl1);
                 bl1.Office_mapping_id = rd.table.Rows[0]["officer_mapping_id"].ToString();
                bl1.Ipaddress = ul.GetClientIpAddress(this.Page);
                bl1.Useragent = Request.UserAgent.ToString();
                bl1.Useros = Utilities.System_Info(this.Page);
                bl1.User_browser = browse.Browser;
                bl1.Isnew = "Y";
               // string dtstring = rd.table.Rows[0]["action_date"].ToString();
               // DateTime dt = DateTime.ParseExact(dtstring, "dd/MM/yyyy HH:mm:ss", null);
                string dt1 = DateTime.Now.ToString("yyyy/MM/dd");
                bl1.Action_date = dt1;//dt.ToString("yyyy/MM/dd");
                bl1.Action_discription = rd.table.Rows[0]["action_detail"].ToString() + " :CLARIFICATION: " + txt_RequestApplicationText.Text;
                bl1.Is_file_upload = "N";
                bl1.Rti_status = "PEN";
                bl1.R_office_map_id = bl1.Office_mapping_id;
            }
            else
            {
                // No action record found
            }

            rb = dl1.Insert_Clarification_Action(bl1);

            if (rb.status == true)
            {
                if (Session["language"].ToString() == "en-GB")
                {
                    Utilities.MessageBoxShow_Redirect("Action Submitted Successfully", "../user/UserDashBoard.aspx");
                    
                }
                else
                {
                    Utilities.MessageBoxShow_Redirect("कार्रवाई सफलतापूर्वक सबमिट की गई", "../user/UserDashBoard.aspx");
                   
                }
                
            }
            else
            {
                if (Session["language"].ToString() == "en-GB")
                {
                    Utilities.MessageBoxShow("Action Not Submitted");
                    
                }
                else
                {
                    Utilities.MessageBoxShow("कार्रवाई सबमिट नहीं की गई");
                   
                }
                
            }



        }
       

    }
示例#2
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
        {
            Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
            HttpBrowserCapabilities browse = Request.Browser;
            if (btnSubmit.Text == "Submit")
            {
                #region status
                string    key = System.Configuration.ConfigurationManager.AppSettings["EncKey"].ToString();
                Utilities ut  = new Utilities();
                string    sas = Server.UrlDecode(Request.QueryString["rtiid"].ToString());
                sas = sas.Replace(" ", "+");
                string decrypt_query_string = ut.Decrypt_AES(sas, key);
                bl1.Rti_id = decrypt_query_string;
                //bl1.Rti_id = Request.QueryString["rtiid"];
                bl1.Userid      = Session["username"].ToString();
                bl1.Dept_Status = ddl_status.SelectedValue;
                //bl1.Rti_status = lbl_status.Text;
                bl1.Action_id         = dl1.max_action_id(bl1);
                bl1.Office_mapping_id = Session["EmpMapID"].ToString();
                bl1.Ipaddress         = ul.GetClientIpAddress(this.Page);
                bl1.Useragent         = Request.UserAgent.ToString();
                bl1.Useros            = Utilities.System_Info(this.Page);
                bl1.User_browser      = browse.Browser;
                bl1.Isnew             = "Y";
                bl1.Action_date       = getDate(Txt_Action.Text);
                bl1.Approve_auth      = ddl_forward_auth.SelectedValue;
                #endregion  status update
                bl1.Action_discription = txt_description.Text;
                bl1.S_officemapping_id = Session["EmpMapID"].ToString();
                bl1.Action_date        = getDate(Txt_Action.Text);
                bl1.Is_file_upload     = ddl_fileup.SelectedValue;
                #region Action file upload
                bl1.RTI_fileID = null;
                if (ddl_fileup.SelectedValue == "Y")
                {
                    if (fu_action.HasFile)
                    {
                        if (txt_file_desc.Text != "")
                        {
                            HttpPostedFile file = fu_action.PostedFile;
                            if (file.ContentLength < 2000000)
                            {
                                if (file.ContentType == "application/pdf" || file.ContentType == "application/x-pdf" ||
                                    file.ContentType == "application/x-unknown")
                                {
                                    bl1.RTI_fileID = dl1.max_file_id();
                                    Stream       fs    = file.InputStream;
                                    BinaryReader br    = new BinaryReader(fs);
                                    byte[]       bytes = br.ReadBytes((Int32)fs.Length);
                                    bl1.RTI_fileName    = file.FileName;
                                    bl1.RTI_fileType    = file.ContentType;
                                    bl1.RTI_fileData    = bytes;
                                    bl1.FileDescription = txt_file_desc.Text;
                                }
                                else
                                {
                                    Utilities.MessageBox_UpdatePanel(udp, "Only PDF type File will be accepted");
                                    return;
                                }
                            }
                            else
                            {
                                Utilities.MessageBox_UpdatePanel(udp, "Your file size is greater than 2 MB  ");
                                return;
                            }
                        }
                        else
                        {
                            Utilities.MessageBox_UpdatePanel(udp, "File Description Is Required");
                            return;
                        }
                    }
                    else
                    {
                        Utilities.MessageBox_UpdatePanel(udp, "PDF File required");
                        return;
                    }
                }
                #endregion

                bl1.Rti_status = "PEN";
                switch (bl1.Dept_Status)
                {
                case "NDIS":            // For Disposal
                case "NAPR":            // For Approval
                //case "REV":           // Reviewed
                case "NREV":            //For Review
                    bl1.R_office_map_id = ddl_forward_auth.SelectedValue;
                    // bl1.Review = ddl_review.SelectedValue;
                    break;

                case "NREJ":               //For Rejection
                    bl1.R_office_map_id = ddl_forward_auth.SelectedValue;
                    bl1.Reject          = ddl_reject.SelectedValue;
                    break;

                case "FOR":               // Forward
                    //if (RadioArea.SelectedValue == "OSO") //Forward only outside office
                    //{
                    bl1.R_office_map_id = ddl_officer.SelectedValue;
                    //}
                    //else if (RadioArea.SelectedValue == "WO") //Forward only outside office
                    //{
                    //    bl1.R_office_map_id = ddl_with_ofc.SelectedValue; //Forward only outside office
                    //}
                    break;

                case "REJ":                                      // Rejected
                    bl1.R_office_map_id = bl1.Office_mapping_id; //ddl_forward_auth.SelectedValue;
                    bl1.Reject          = ddl_reject.SelectedValue;
                    break;

                case "DIS":                                       // Dispose
                    bl1.R_office_map_id = bl1.S_officemapping_id; //ddl_forward_auth.SelectedValue;

                    break;
                }// End of Switch
                bl1.IsMeeting = RadioMeeting.SelectedValue;
                if (bl1.IsMeeting != "Y" && bl1.Dept_Status == "DIS" && bl1.IsAdditionalFees != "Y")
                {
                    bl1.Rti_status      = "CLT";
                    bl1.Isnew           = "N";             // If status is CLT then New = 'N'
                    bl1.R_office_map_id = bl1.S_officemapping_id;
                }

                bl1.RTI_data_id = dl1.max_RTI_Data_id();

                bl1.Rti_Discription = txt_result.Text;
                if (RadioMeeting.SelectedValue == "Y")
                {
                    bl1.Meeting_date = txt_meeting.Text;
                    if (bl1.Meeting_date != "")
                    {
                        bl1.Meeting_date = getDate(txt_meeting.Text);
                    }
                    else
                    {
                        bl1.Meeting_date = "";
                    }
                }
                else
                {
                    bl1.Meeting_date = null;
                }
                bl1.IsAdditionalFees = rbl_additional_fees_rti.SelectedValue;
                if (rbl_additional_fees_rti.SelectedValue == "Y")
                {
                    bl1.Additional_fees = txt_amount.Text;
                }
                else
                {
                    bl1.Additional_fees = null;
                }


                #region RTI file upload
                bl1.Is_rti_file_upload = "N";
                if (ddl_rti_file.SelectedValue == "Y")
                {
                    if (FileUploadRTI.HasFile)
                    {
                        if (txt_desc_rti.Text != "")
                        {
                            HttpPostedFile file = FileUploadRTI.PostedFile;
                            if (file.ContentLength < 2000000)
                            {
                                if (file.ContentType == "application/pdf" || file.ContentType == "application/x-pdf" ||
                                    file.ContentType == "application/x-unknown")
                                {
                                    // bl1.RTI_fileID = dl1.max_file_id();
                                    Stream       fs    = file.InputStream;
                                    BinaryReader br    = new BinaryReader(fs);
                                    byte[]       bytes = br.ReadBytes((Int32)fs.Length);
                                    bl1.Data_fileName        = file.FileName;
                                    bl1.Data_fileType        = file.ContentType;
                                    bl1.Data_fileData        = bytes;
                                    bl1.Data_FileDescription = txt_desc_rti.Text;
                                    bl1.Is_rti_file_upload   = "Y";
                                }
                                else
                                {
                                    Utilities.MessageBox_UpdatePanel(udp, "Only PDF type File will be accepted");
                                    return;
                                }
                            }
                            else
                            {
                                Utilities.MessageBox_UpdatePanel(udp, "Your file size is greater than 2 MB  ");
                                return;
                            }
                        }
                        else
                        {
                            Utilities.MessageBox_UpdatePanel(udp, "File Description Is Required");
                            return;
                        }
                    }
                    else
                    {
                        Utilities.MessageBox_UpdatePanel(udp, "PDF File required");
                        return;
                    }
                }
                #endregion


                // If There is RTI data then Update
                if (h_IsRtiData.Value == "Y")
                {
                    bl1.Is_RTI_Data = "Y";
                }
                else
                {
                    bl1.Is_RTI_Data = "N";
                }

                rb = dl1.Insert_Action_Info(bl1);
                if (rb.status == true)
                {
                    Utilities.MessageBox_UpdatePanel_Redirect(udp, "Action Submitted Successfully", "../Employee/EmployeeWelcome_Page.aspx");
                }
                else
                {
                    Utilities.MessageBox_UpdatePanel(udp, "Action Not Submitted");
                }
            }
        }
    }