private void Page_Load(object sender, System.EventArgs e)
        {
            Salaries.Business.Luni luni;
            Salaries.Data.LunaData lunaData;

            if (objAngajat.IsLichidat)
            {
                btnGenerati.Enabled = false;
                drpInspectorResurseUmane.Enabled = false;

                lblEroare.Text = "Angajatul selectat este lichidat!";
            }

            // Este aflata luna activa
            luni     = new Salaries.Business.Luni(objAngajat.AngajatorId);
            lunaData = luni.GetLunaActiva();

            // DataSet-ul cu numele tuturor angajatilor.
            objAngajat.CategorieId = -1;
            DataSet dsAngajati = objAngajat.GetAllAngajati();

            drpInspectorResurseUmane.DataSource     = dsAngajati;
            drpInspectorResurseUmane.DataTextField  = "NumeIntregCuTitlu";
            drpInspectorResurseUmane.DataValueField = "AngajatID";
            drpInspectorResurseUmane.DataBind();

            Salaries.Business.AdminAngajator adminAng = new Salaries.Business.AdminAngajator();
            adminAng.AngajatorId = Int32.Parse(Session["AngajatorId"].ToString());
            DataSet ds = adminAng.GetReprezLegali();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                // Numele managerului general.
                if (dr["NumeFunctie"].ToString().Equals("Manager general"))
                {
                    txtManagerGeneral.Text = dr["NumeReprez"].ToString() + " " + dr["PrenumeReprez"].ToString();
                }
                // Numele directorului economic.
                if (dr["NumeFunctie"].ToString().Equals("Director economic"))
                {
                    txtDirectorEconomic.Text = dr["NumeReprez"].ToString() + " " + dr["PrenumeReprez"].ToString();
                }
            }
            //header de tabel
            Utilities.CreateTableHeader(Table2, "Adeverinta pentru medicul de familie", "", "normal");
        }
        /// <summary>
        /// Angajatii care apar in dropdown-urile de la departamente sa contina toti angajatii( indiferent daca sunt lichidati sau nu, activi sau nu, sau daca data angajarii e ulterioara)
        /// </summary>
        /// <param name="listObj">Lista care va contine departamentele</param>
        /// <param name="angajatorID">Id-ul angajatorului</param>
        /// <remarks>
        /// Adaugat:	Ionel Popa
        /// </remarks>
        public void CreateDepartamentAngajatiSelectBox(DropDownList listObj, int angajatorID)
        {
            Salaries.Business.Angajat angajat = new Salaries.Business.Angajat();
            angajat.AngajatorId = angajatorID;
            angajat.CategorieId = -2;
            DataSet ds = angajat.GetAllAngajati();

            DataTable myTable = new DataTable();

            myTable = ds.Tables[0];
            listObj.Items.Clear();
            for (int i = 0; i < myTable.Rows.Count; i++)
            {
                DataRow  myRow  = myTable.Rows[i];
                ListItem myItem = new ListItem(myRow["NumeIntreg"].ToString(), myRow["AngajatID"].ToString());
                listObj.Items.Add(myItem);
            }
        }
        /// <summary>
        /// Initializeaza ore lucrate ale unui angajat
        /// </summary>
        private void InitializeOreLucrateLunaAngajati()
        {
            ErrHandler.MyErrHandler.WriteError("InitializareLuna.ascx - start - initializeOreLucrateLuna()");
            Salaries.Business.Angajat angajat = new Salaries.Business.Angajat();
            angajat.CategorieId = int.Parse(lstCategorii.SelectedValue);
            angajat.AngajatorId = GetAngajator();
            //Modificat:Muntean Raluca Cristina  - am adaugat ca parametru si id-ul angajatorului
            DataSet ds = angajat.GetAllAngajati();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                IntervaleAngajat ia = new IntervaleAngajat(long.Parse(dr["AngajatID"].ToString()));
                //Modified: Ionel Popa
                //Description: In loc de DataPanaLa se transmite DataLichidare ( pentru ca e posibil ca prelungirea contractului sa se faca mai greu )
                ia.InitializeOreLucrateLunaAngajat(this.SelectedDate, (DateTime)dr["DataDeLa"], dr["DataLichidare"]);
            }
            ErrHandler.MyErrHandler.WriteError("InitializareLuna.ascx - end - initializeOreLucrateLuna()");
        }
        /// <summary>
        /// Genereaza situatia lunara pentru toti angajatii
        /// </summary>
        private void SituatieLunaraTotiAngajatii()
        {
            SiemensTM.Classes.SituatieAngajat situatieLunaraAng;
            //Modificat:Muntean Raluca Cristina  - am adaugat ca parametru si id-ul angajatorului
            Salaries.Business.Angajat angajat = new Salaries.Business.Angajat();
            angajat.CategorieId = -1;
            angajat.AngajatorId = GetAngajator();
            DataSet ds = angajat.GetAllAngajati();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                //Modified: Cristina Raluca Muntean
                //se genereaza situatia lunara a unui angajat
                //se apeleaza aceasta metoda pentru ca in cazul in care nu a fost initializata luna, sa se faca si aceasta operatie
                situatieLunaraAng = new SiemensTM.Classes.SituatieAngajat(long.Parse(dr["AngajatID"].ToString()));
                situatieLunaraAng.GenerareSituatieLunaraAngajat();
            }
        }
        /// <summary>
        /// Procedura creaza lista cu angajati
        /// </summary>
        /// <param name="listObj">Lista care va contine angajatii</param>
        /// <param name="angajatorID">Id-ul angajatorului</param>
        public void CreateAngajatiSelectBox(DropDownList listObj, int angajatorID)
        {
            /*Modificat:Muntean Raluca Cristina
             * DataSet-ul contine numele intregi si id-urile angajatilor activi, care au fost angajati
             * in luna curenta sau intr-o luna anterioara acesteia, angajatii apartin de angajatorul
             * cu id-ul trimis ca parametru*/
            Salaries.Business.Angajat angajat = new Salaries.Business.Angajat();
            angajat.AngajatorId = angajatorID;
            angajat.CategorieId = -1;
            DataSet   ds      = angajat.GetAllAngajati();
            DataTable myTable = new DataTable();

            myTable = ds.Tables[0];
            listObj.Items.Clear();
            for (int i = 0; i < myTable.Rows.Count; i++)
            {
                DataRow  myRow  = myTable.Rows[i];
                ListItem myItem = new ListItem(myRow["NumeIntreg"].ToString(), myRow["AngajatID"].ToString());
                listObj.Items.Add(myItem);
            }
        }