import {
    FormControl,
    FormGroup
} from "@angular/forms";
import {
    MagicServices
} from "@magic-xpa/angular";
export enum MgControlName {
    MainRouting = "MainRouting",
        LoginUserID = "LoginUserID",
        V_RoutingProgramName = "V_RoutingProgramName",
        V_RotuingButton = "V_RotuingButton",
        MainOutlet = "MainOutlet",
}
export enum MgCustomProperties {}
export class MgFormControlsAccessor {
    constructor(private fg: FormGroup, private magicServices: MagicServices) {}

    get LoginUserID(): FormControl {
        return this.fg.controls[MgControlName.LoginUserID] as FormControl;
    }

    get V_RoutingProgramName(): FormControl {
        return this.fg.controls[MgControlName.V_RoutingProgramName] as FormControl;
    }

    getTableChildFormControl(name: MgControlName): FormControl {
        return this.magicServices.mgAccessorService.getFormGroupByRow(this.magicServices.tableService.getSelectedRow()).controls[name] as FormControl;
    }
}