protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["UserId"].ToString() == null || Session["UserId"].ToString() == "")
                {
                    Response.Redirect("Main.aspx");
                }
                else
                {
                    if (!IsPostBack)
                    {
                        if (Session["UserId"] != null)
                        {
                            NSDataPasser dp = new NSDataPasser();
                            dp.sesid = Session["UserId"].ToString().TrimStart().TrimEnd();
                        }
                        else
                        {
                            Response.Redirect("Login.aspx");
                        }

                        load();
                        IMPDepartmentNameView();
                    }
                }
            }
            catch (Exception)
            {
                Response.Redirect("Login.aspx", false);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["UserId"].ToString() == null || Session["UserId"].ToString() == "")
                {
                    Response.Redirect("Main.aspx");
                }
                else
                {
                    if (!IsPostBack)
                    {
                        ProclainPIMSMaster.AdminMaster admaster = (ProclainPIMSMaster.AdminMaster) this.Master;
                        admaster.ChangeTitle("New Suggestion - Employee");

                        if (Session["UserId"] != null)
                        {
                            NSDataPasser dp = new NSDataPasser();
                            dp.sesid = Session["UserId"].ToString().TrimStart().TrimEnd();
                        }
                        else
                        {
                            Response.Redirect("Login.aspx");
                        }
                        SuggestionDepartmentNameView();
                        Time();
                        // IdeaIdAutoGeneretion();
                    }
                }
            }
            catch (Exception)
            {
                Response.Redirect("Login.aspx");
            }
        }
        public void headerValues(string userid)
        {
            AddSuggestion      A   = new AddSuggestion();
            NewSuggestionModel NSM = new NewSuggestionModel();
            Employee           E   = new Employee();
            NSDataPasser       tdp = new NSDataPasser();

            //Console.Write(emp);
            //Console.Write("My first ASP script!");

            try
            {
                if (userid != "" && userid != null)
                {
                    NSM.IEmpId = userid;//tdp.sesid.ToString();

                    DataSet DS = new DataSet();
                    DS = NSM.search(NSM);



                    /* tdp.empname = DS.Tables[0].Rows[0].ItemArray[0].ToString();
                     * SIDepID = DS.Tables[0].Rows[0].ItemArray[1].ToString();
                     * tdp.Department = DS.Tables[0].Rows[0].ItemArray[2].ToString();
                     * SIDesID = DS.Tables[0].Rows[0].ItemArray[3].ToString();
                     * tdp.Designation = DS.Tables[0].Rows[0].ItemArray[4].ToString();
                     */
                    EmployeeIdTextBox.Text = userid;
                    tdp.ErrorLabel         = "0";
                    EmployeeTextBox.Text   = DS.Tables[0].Rows[0].ItemArray[0].ToString();
                    SIDepID = DS.Tables[0].Rows[0].ItemArray[1].ToString();
                    DepartmentTextBox.Text = DS.Tables[0].Rows[0].ItemArray[2].ToString();
                    SIDesID = DS.Tables[0].Rows[0].ItemArray[3].ToString();
                    DesignationTextBox.Text = DS.Tables[0].Rows[0].ItemArray[4].ToString();
                }

                else if (userid == "")
                {
                    tdp.ErrorLabel = "Check the Employee ID ";
                }
                else
                {
                    tdp.ErrorLabel = "1";
                }
            }
            catch (Exception ex)
            {
                tdp.ErrorLabel = "alert ('The Employee Record Does Not Exist')";
                ScriptManager.RegisterClientScriptBlock(A, A.GetType(), "alertMessage", "alert('The Employee Record Does Not Exist')", true);
            }
        }
        public static NSDataPasser Checking(string emp)
        {
            AddSuggestion      A   = new AddSuggestion();
            NewSuggestionModel NSM = new NewSuggestionModel();
            Employee           E   = new Employee();
            NSDataPasser       tdp = new NSDataPasser();

            //Console.Write(emp);
            //Console.Write("My first ASP script!");

            try
            {
                if (emp != "" && emp != "System.Data.DataRowView")
                {
                    Console.Write(emp);

                    NSM.IEmpId = tdp.sesid.ToString();

                    DataSet DS = new DataSet();
                    DS = NSM.search(NSM);



                    tdp.empname     = DS.Tables[0].Rows[0].ItemArray[0].ToString();
                    SIDepID         = DS.Tables[0].Rows[0].ItemArray[1].ToString();
                    tdp.Department  = DS.Tables[0].Rows[0].ItemArray[2].ToString();
                    SIDesID         = DS.Tables[0].Rows[0].ItemArray[3].ToString();
                    tdp.Designation = DS.Tables[0].Rows[0].ItemArray[4].ToString();

                    tdp.ErrorLabel = "0";
                }

                else if (emp == "")
                {
                    tdp.ErrorLabel = "Check the Employee ID ";
                }
                else
                {
                    tdp.ErrorLabel = "1";
                }


                return(tdp);
            }
            catch (Exception ex)
            {
                tdp.ErrorLabel = "alert ('The Employee Record Does Not Exist')";
                ScriptManager.RegisterClientScriptBlock(A, A.GetType(), "alertMessage", "alert('The Employee Record Does Not Exist')", true);
                return(tdp);
            }
        }