Exemplo n.º 1
0
        public bool UpdateThue(MucThueDTO dtoMucThue)
        {
            string strQuery = "Update THUE Set ";

            strQuery += "SOTHUE = " + dtoMucThue.SoThue + ",";
            strQuery += "GHICHU = N'" + dtoMucThue.GhiChu + "' ";
            strQuery += "Where MATHUE = N'" + dtoMucThue.MaTH + "'";
            return(dp.ExecuteNonQuery(strQuery));
        }
Exemplo n.º 2
0
        public bool InsertThue(MucThueDTO dtoMucThue)
        {
            string strQuery = "Insert Into THUE Values(";

            strQuery += "N'" + dtoMucThue.MaTH + "',";
            strQuery += dtoMucThue.SoThue + ",";
            strQuery += "N'" + dtoMucThue.GhiChu + "', 1)";
            return(dp.ExecuteNonQuery(strQuery));
        }
Exemplo n.º 3
0
        public string UpdateThue(MucThueDTO dtoMucThue)
        {
            string strError = "";

            if (dtoMucThue.SoThue.Equals("") == true)
            {
                strError = "Mức thuế không được rỗng.";
            }
            if (strError == "")
            {
                bool boolResult = dalMucThue.UpdateThue(dtoMucThue);
                return("ok");
            }
            else
            {
                return(strError);
            }
        }
Exemplo n.º 4
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     try
     {
         MucThueDTO dtoMucThue = new MucThueDTO();
         string     strAction  = btnOK.Tag.ToString();
         if (strAction == "add")
         {
             dtoMucThue.MaTH   = txtMaThue.Text;
             dtoMucThue.SoThue = int.Parse(txtSoThue.Text);
             dtoMucThue.GhiChu = txtGhiChu.Text;
             string strResult = bllMucThue.InsertThue(dtoMucThue);
             if (strResult == "ok")
             {
                 MessageBox.Show("Thêm Thành Công!", "Thêm Mức Thuế", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 this.Close();
             }
             else
             {
                 MessageBox.Show(strResult, "Thêm Mức Thuế", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
         else
         {
             dtoMucThue.MaTH   = txtMaThue.Text;
             dtoMucThue.SoThue = int.Parse(txtSoThue.Text);
             dtoMucThue.GhiChu = txtGhiChu.Text;
             string strResult = bllMucThue.UpdateThue(dtoMucThue);
             if (strResult == "ok")
             {
                 MessageBox.Show("Cập Nhật Thành Công!", "Cập Nhật Mức Thuế", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 this.Close();
             }
             else
             {
                 MessageBox.Show(strResult, "Cập Nhật Mức Thuế", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
     catch { }
 }