Ejemplo n.º 1
0
 private void caidat()
 {
     if (kt() == false)
     {
         this.Visible = false;
         Form frm = new KPBT.Forms.frmXNBQ();
         frm.ShowDialog();
     }
     else
     {
         Settings1.Default.dc = "Dc";
         Settings1.Default.Save();
         this.Visible = false;
         Form frm = new frmmain();
         frm.ShowDialog();
     }
 }
Ejemplo n.º 2
0
 private void Luu()
 {
     try
     {
         string sql = "Update ttdv Set dcdv=@dcdv,nlb=@nlb,nnhanhang=@nnhanhang,thukho=@thukho," +
                      " ketoan=@ketoan,kttruong=@kttruong,ttdv=@ttdv,thuquy=@thuquy,MA=@MA,nkxtu=@nkxtu," +
                      " nkxden=@nkxden,mqhns=@mqhns,diadanh=@diadanh,MASANG=@MASANG,MATOI=@MATOI,MUCHT=@MUCHT,Namhoc=@Namhoc";
         OleDbCommand cmd = new OleDbCommand();
         cmd.CommandText = sql;
         cmd.Parameters.Add("@dcdv", OleDbType.VarChar).Value      = txtdcdv.Text;
         cmd.Parameters.Add("@nlb", OleDbType.VarChar).Value       = txtnlb.Text;
         cmd.Parameters.Add("@nnhanhang", OleDbType.VarChar).Value = txtnnhanhang.Text;
         cmd.Parameters.Add("@thukho", OleDbType.VarChar).Value    = txtthukho.Text;
         cmd.Parameters.Add("@ketoan", OleDbType.VarChar).Value    = txtketoan.Text;
         cmd.Parameters.Add("@kttruong", OleDbType.VarChar).Value  = txtkttruong.Text;
         cmd.Parameters.Add("@ttdv", OleDbType.VarChar).Value      = txtttdv.Text;
         cmd.Parameters.Add("@thuquy", OleDbType.VarChar).Value    = txtthuquy.Text;
         cmd.Parameters.Add("@MA", OleDbType.Double).Value         = classdc.dungchung.kieudouble(txtMA.Text);
         cmd.Parameters.Add("@nkxtu", OleDbType.Date).Value        = classdc.dungchung.thaydoi(Mtbnkxtu.Text);
         cmd.Parameters.Add("@nkxden", OleDbType.Date).Value       = classdc.dungchung.thaydoi(Mtbnkxden.Text);
         cmd.Parameters.Add("@mqhns", OleDbType.VarChar).Value     = txtmqhns.Text;
         cmd.Parameters.Add("@diadanh", OleDbType.VarChar).Value   = txtdiadanh.Text;
         cmd.Parameters.Add("@MASANG", OleDbType.Double).Value     = classdc.dungchung.kieudouble(txtMASANG.Text);
         cmd.Parameters.Add("@MATOI", OleDbType.Double).Value      = classdc.dungchung.kieudouble(txtMATOI.Text);
         cmd.Parameters.Add("@MUCHT", OleDbType.Double).Value      = classdc.dungchung.kieudouble(txtMUCHT.Text);
         cmd.Parameters.Add("@Namhoc", OleDbType.VarChar).Value    = cboNamhoc.Text;
         Connect.LuuDL(cmd);
         thongtinketxuat.Default.diadanh = txtdiadanh.Text;
         thongtinketxuat.Default.Save();
         thongtinketxuat.Default.nlb = txtnlb.Text;
         thongtinketxuat.Default.Save();
         thongtinketxuat.Default.ttdv = txtttdv.Text;
         thongtinketxuat.Default.Save();
         thongtinketxuat.Default.ptkt = txtketoan.Text;
         thongtinketxuat.Default.Save();
         thongtinketxuat.Default.NTT = Mtbnkxtu.Text;
         thongtinketxuat.Default.Save();
         thongtinketxuat.Default.NTD = Mtbnkxden.Text;
         thongtinketxuat.Default.Save();
         thongtinketxuat.Default.thukho = txtthukho.Text;
         thongtinketxuat.Default.Save();
         thongtinketxuat.Default.thuquy = txtthuquy.Text;
         thongtinketxuat.Default.Save();
         thongtinketxuat.Default.namhoc = cboNamhoc.Text;
         thongtinketxuat.Default.Save();
         Settings1.Default.mucan = txtMA.Text;
         Settings1.Default.Save();
         Settings1.Default.mucansang = txtMASANG.Text;
         Settings1.Default.Save();
         Settings1.Default.mucantoi = txtMATOI.Text;
         Settings1.Default.Save();
         Settings1.Default.mucanht = txtMUCHT.Text;
         Settings1.Default.Save();
         Settings1.Default.dc = "Dc";
         Settings1.Default.Save();
         MessageBox.Show("Bạn đã cập nhật thành công!", "Thông báo");
         this.Visible = false;
         Form frm = new frmmain();
         frm.ShowDialog();
         this.Close();
     }
     catch
     {
         MessageBox.Show("Lấy lại bảng hệ thống!", "Thống báo");
     }
 }