public FrmInputCalon()
 {
     cln    = new Entity.EntCalon();
     login  = new Entity.EntLogin();
     clnDao = Factory.FactLogin.GetInterfaceCalon();
     InitializeComponent();
     AturText(false);
     AturButton(true);
 }
Example #2
0
 public Form3(string userid)
 {
     user   = userid;
     cln    = new Entity.EntCalon();
     clnDao = Factory.FactLogin.GetInterfaceCalon();
     InitializeComponent();
     AturText(false);
     AturButton(true);
 }
Example #3
0
 //Submit Data
 public Boolean submitCalon(Entity.EntCalon e)
 {
     status = false;
     try
     {
         query = "INSERT INTO tb_calon VALUES ('"
                 + e.getNomor() + "','"
                 + e.getNama() + "','"
                 + e.getPartai() + "')";
         koneksi.Open();
         SqlCommand command = koneksi.CreateCommand();
         command.CommandText = query;
         command.ExecuteNonQuery();
         status = true;
         koneksi.Close();
     }
     catch (SqlException ex)
     {
         Console.WriteLine("ERROR" + ex.Message);
     }
     return(status);
 }
Example #4
0
 public Boolean updateCalon(Entity.EntCalon e)
 {
     status = false;
     try
     {
         query = "UPDATE tb_calon SET nama_calon = '" +
                 e.getNama() + "', partai_calon = '" +
                 e.getPartai() + "'" +
                 "' WHERE id_staff = '" +
                 e.getNomor() + "' is not null";
         koneksi.Open();
         SqlCommand command = koneksi.CreateCommand();
         command.CommandText = query;
         command.ExecuteNonQuery();
         status = true;
         koneksi.Close();
     }
     catch (SqlException ex)
     {
         Console.WriteLine("ERROR" + ex.Message);
     }
     return(status);
 }