/// <summary> /// method that creates Voters with details of a given voter. /// </summary> /// <param name="v">Voter whose details are used to create different voters</param> /// <returns> a new voter who is: Voter or Elections Manager or Kalpi Manager, according to permission </returns> public Voter createVoter(Voter v) { Voter tmp = null; switch (v.Permission) { case "0": tmp = new Voter(v); //create casic voter break; case "1": tmp = new ElectionsManager(v); //create voter who is also an elections manager break; case "2": tmp = new KalpiManager(v); //create voter who is also a kalpi manager break; case "3": tmp = new AreaManager(new KalpiManager(v)); //create voter who is also a area manager break; default: tmp = new Voter(v); //create casic voter break; } return(tmp); }
/// <summary> /// method that creates Voters with details from a given datarow. /// </summary> /// <param name="row">datarow from Voter table in database.</param> /// <returns>a new voter who is: Voter or Elections Manager or Kalpi Manager, according to permission</returns> public Voter createVoter(DataRow row) { Voter tmp = null; switch (row["permission"].ToString()) { case "0": tmp = new Voter(row); break; case "1": tmp = new ElectionsManager(row); break; case "2": tmp = new KalpiManager(row); break; case "3": tmp = new AreaManager(row); break; default: tmp = new Voter(row); //create casic voter break; } return(tmp); }
private DataTable kalpies; //will hold kalpis details in area manager area /// <summary> /// constructor /// </summary> /// <param name="mngr">instance of area manager</param> public ElectionsResultArea(AreaManager mngr) { InitializeComponent(); area_manager = mngr; l_area.Text = mngr.Area; con.sqlCommand("ReturnKalpiesInArea"); con.InsertValstring("@area", area_manager.Area); //sending parameters kalpies = con.GetData("ReturnKalpiesInArea"); showPartyResults(); showPrimeResults(); }
public CloseKalpiByAreaManager(AreaManager v) { InitializeComponent(); manager = v; try { //Show the Manager details on the screen textBox1.Text = manager.Id; textBox2.Text = manager.FName; textBox3.Text = manager.LName; textBox4.Text = manager.City; textBox5.Text = manager.Address; textBox6.Text = manager.Area; } catch { MessageBox.Show("Try again"); } }
public RemoveKalpiFromArea(AreaManager areaMan) { InitializeComponent(); areaManager = areaMan; }
public AddKalpiVoter(AreaManager areaManager) { this.areaManager = areaManager; InitializeComponent(); }
public UnblockKalpi(AreaManager areaManager) { this.areaManager = areaManager; InitializeComponent(); }
public UpdateKalpManagerDetails(AreaManager v) { InitializeComponent(); manager = v; }
public PercentageVotersReportByArea(AreaManager area_m) { InitializeComponent(); area_manager = area_m; con = sqlConnection.Instance; }
public ShowKalpiesInArea(AreaManager area_m) { InitializeComponent(); area_manager = area_m; con = sqlConnection.Instance; }
private AreaManager area_manager; //the user of this menu - area Manager // Menu of user Area Manager public AreaManagerMenu(AreaManager a_manager) { InitializeComponent(); area_manager = a_manager; }
public NewKalpiToArea(AreaManager areaMan) { InitializeComponent(); areaManager = areaMan; }
public AddNewKalpiManager(AreaManager area_m) { InitializeComponent(); area_manager = area_m; con = sqlConnection.Instance; }
public RemoveKalpiManager(AreaManager mngr) { InitializeComponent(); area_mngr = mngr; search_success = false; }