/// <summary> /// Procedura genereaza situatia lunara unui angajat care a fost lichidat /// </summary> public void GenerareSituatieLunaraAngajatLichidat() { Salaries.Business.Angajat angajat = new Salaries.Business.Angajat(); angajat.AngajatId = AngajatID; angajat.LoadAngajat(); //este obtinuta prima zi a lunii active Salaries.Business.Luni luna = new Salaries.Business.Luni(angajat.AngajatorId, settings); Salaries.Data.LunaData lunaActiva = luna.GetLunaActiva(); Salaries.Business.PontajAngajat pontajAngajat = new Salaries.Business.PontajAngajat(this.AngajatID, settings); DataSet dsIntervaleAngajat = pontajAngajat.GetIntervaleAngajat(lunaActiva.LunaId); //daca nu au fost initializate orele unui angajat, se face aceasta initializare if (dsIntervaleAngajat.Tables[0].Rows.Count == 0) { //intervale angajat IntervaleAngajat intervAng = new IntervaleAngajat(AngajatID, settings); //sunt intializate orele lucrate de catre angajat intervAng.InitializeOreLucrateLunaAngajat(lunaActiva.Data, angajat.DataDeLa, angajat.DataLichidare); } //situatia lunara a unui angajat Salaries.Business.SituatieLunaraAngajat situatieLunaraAng = new Salaries.Business.SituatieLunaraAngajat(AngajatID, settings); //se genereaza situatia lunara a angajatului situatieLunaraAng.GenerareSituatieLunaraAngajatLichidat(lunaActiva.LunaId, angajat.AngajatorId); }
/// <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()"); }