当前位置: 首页>>代码示例>>C#>>正文


C# Constants.Sql类代码示例

本文整理汇总了C#中Common.Constants.Sql的典型用法代码示例。如果您正苦于以下问题:C# Constants.Sql类的具体用法?C# Constants.Sql怎么用?C# Constants.Sql使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Constants.Sql类属于Common命名空间,在下文中一共展示了Constants.Sql类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Delete

        /// <summary>
        /// Deleted Update Bảng
        /// </summary>
        public bool Delete(Entities.ChiTietXuatHuy ctxh1)
        {
            try
            {
                bool kt = false;
                ctxh = new Constants.ChiTietXuatHuy();
                Sql = new Constants.Sql();
                string sql = Sql.DeleteChiTietXuatHuy;
                Connection conn = new Connection();
                SqlConnection cn = conn.openConnection();
                SqlCommand cmd = new SqlCommand(sql, cn);

                cmd.Parameters.Add(ctxh.HanhDong, SqlDbType.VarChar, 20).Value = ctxh1.HanhDong;
                cmd.Parameters.Add(ctxh.MaPhieuXuatHuy, SqlDbType.VarChar, 20).Value = ctxh1.MaPhieuXuatHuy;
                cmd.Parameters.Add(ctxh.MaHangHoa, SqlDbType.VarChar, 50).Value = ctxh1.MaHangHoa;

                int i = cmd.ExecuteNonQuery();
                if (i == 1)
                    kt = true;
                else
                    kt = false;
                cmd.Connection.Dispose();
                cn.Close();
                conn.closeConnection();
                cn = null;
                conn = null;
                return kt;
            }
            catch (Exception ex)
            {
                string s = ex.Message;
                return false;
            }
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:37,代码来源:ChiTietXuatHuy.cs

示例2: InsertUpdate

        public int InsertUpdate(Entities.TKNganHang tk1)
        {
            TKNH = new Constants.TKNganHang();
            Sql = new Constants.Sql();
            string sql = Sql.InsertUpdateTKNganHang;
            Connection conn = new Connection();
            SqlConnection cn = conn.openConnection();
            SqlCommand cmd = new SqlCommand(sql, cn);
            cmd.Parameters.Add(TKNH.HanhDong, SqlDbType.NVarChar, 20).Value = tk1.HanhDong;
            cmd.Parameters.Add(TKNH.TKNganHangID, SqlDbType.Int).Value = tk1.TKNganHangID;
            cmd.Parameters.Add(TKNH.MaTKNganHang, SqlDbType.NVarChar, 20).Value = tk1.MaTKNganHang;
            cmd.Parameters.Add(TKNH.SoTK, SqlDbType.NVarChar, 20).Value = tk1.SoTK;
            cmd.Parameters.Add(TKNH.MaTienTe, SqlDbType.NVarChar, 200).Value = tk1.MaTienTe;
            cmd.Parameters.Add(TKNH.SoDu, SqlDbType.Int).Value = tk1.SoDu;
            cmd.Parameters.Add(TKNH.SoSecKeTiep, SqlDbType.NVarChar, 20).Value = tk1.SoSecKeTiep;
            cmd.Parameters.Add(TKNH.NguoiLienHe, SqlDbType.NVarChar, 200).Value = tk1.NguoiLienHe;
            cmd.Parameters.Add(TKNH.DiaChi, SqlDbType.NVarChar, 200).Value = tk1.DiaChi;
            cmd.Parameters.Add(TKNH.DienThoai, SqlDbType.NVarChar, 20).Value = tk1.DienThoai;
            cmd.Parameters.Add(TKNH.Email, SqlDbType.NVarChar, 20).Value = tk1.Email;
            cmd.Parameters.Add(TKNH.Website, SqlDbType.NVarChar, 20).Value = tk1.Website;
            cmd.Parameters.Add(TKNH.GhiChu, SqlDbType.NVarChar, 200).Value = tk1.Ghichu;
            cmd.Parameters.Add(TKNH.Laisuat, SqlDbType.Float).Value = tk1.Laisuat;
            cmd.Parameters.Add(TKNH.Deleted, SqlDbType.Bit).Value = tk1.Deleted;

            int i = cmd.ExecuteNonQuery();
            cmd.Connection.Dispose();
            cn.Close();
            conn.closeConnection();
            cn = null;
            conn = null;
            return i;
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:32,代码来源:TKNganHang.cs

示例3: Delete

 /// <summary>
 /// Delete Bảng
 /// </summary>
 public bool Delete(Entities.SoDuCongNo pxh)
 {
     try
     {
         bool kt = false;
         pt = new Constants.CongNo();
         Sql = new Constants.Sql();
         string sql = Sql.DeleteSoDuCongNo;
         Connection conn = new Connection();
         SqlConnection cn = conn.openConnection();
         SqlCommand cmd = new SqlCommand(sql, cn);
         cmd.Parameters.Add(pt.MaSoDuCongNo, SqlDbType.VarChar, 20).Value = pxh.MaSoDuCongNo;
         int i = cmd.ExecuteNonQuery();
         if (i == 1)
             kt = true;
         else
             kt = false;
         cmd.Connection.Dispose();
         cn.Close();
         conn.closeConnection();
         cn = null;
         conn = null;
         return kt;
     }
     catch
     {
         return false;
     }
 }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:32,代码来源:CongNo.cs

示例4: Delete

        public int Delete(Entities.TheGiamGia pb1)
        {
            try
            {
                pb = new Constants.TheGiamGia();
                Sql = new Constants.Sql();
                string sql = Sql.DeleteTheGiamGia;
                Connection conn = new Connection();
                SqlConnection cn = conn.openConnection();
                SqlCommand cmd = new SqlCommand(sql, cn);
                cmd.Parameters.Add(pb.MaTheGiamGia, SqlDbType.VarChar, 50).Value = pb1.MaTheGiamGia;

                int i = cmd.ExecuteNonQuery();
                cmd.Connection.Dispose();
                cn.Close();
                conn.closeConnection();
                cn = null;
                conn = null;
                return i;
            }
            catch (Exception ex)
            {
                string s = ex.Message;
                return 0;
            }
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:26,代码来源:TheGiamGia.cs

示例5: InsertUpdate

        public int InsertUpdate(Entities.PhieuDieuChuyenKhoNoiBo PhieuDCK)
        {
            try
            {
                pdcknb = new Constants.PhieuDieuChuyenKhoNoiBo();
                Sql = new Constants.Sql();
                string sql = Sql.InsertUpdatePhieuDieuChuyenKhoNoiBo;
                Connection conn = new Connection();
                SqlConnection cn = conn.openConnection();
                SqlCommand cmd = new SqlCommand(sql, cn);
                cmd.Parameters.Add(pdcknb.HanhDong, SqlDbType.NVarChar, 20).Value = PhieuDCK.HanhDong;
                cmd.Parameters.Add(pdcknb.PhieuDieuChuyenKhoID, SqlDbType.Int).Value = PhieuDCK.PhieuDieuChuyenKhoID;
                cmd.Parameters.Add(pdcknb.MaPhieuDieuChuyenKho, SqlDbType.NVarChar, 20).Value = PhieuDCK.MaPhieuDieuChuyenKho;
                cmd.Parameters.Add(pdcknb.NgayDieuChuyen, SqlDbType.DateTime).Value = PhieuDCK.NgayDieuChuyen;
                cmd.Parameters.Add(pdcknb.TuKho, SqlDbType.VarChar, 20).Value = PhieuDCK.TuKho;
                cmd.Parameters.Add(pdcknb.DenKho, SqlDbType.VarChar, 20).Value = PhieuDCK.DenKho;
                cmd.Parameters.Add(pdcknb.MaHoaDonNhap, SqlDbType.VarChar, 20).Value = PhieuDCK.MaHoaDonNhap;
                cmd.Parameters.Add(pdcknb.XacNhan, SqlDbType.Bit).Value = PhieuDCK.XacNhan;
                cmd.Parameters.Add(pdcknb.GhiChu, SqlDbType.NVarChar, 100).Value = PhieuDCK.GhiChu;
                cmd.Parameters.Add(pdcknb.Deleted, SqlDbType.Bit).Value = PhieuDCK.Deleted;

                int i = cmd.ExecuteNonQuery();
                cmd.Connection.Dispose();
                cn.Close();
                conn.closeConnection();
                cn = null;
                conn = null;
                return i;
            }
            catch (Exception ex)
            {
                string s = ex.Message;
                return 0;
            }
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:35,代码来源:PhieuDieuChuyenKhoNoiBo.cs

示例6: InsertUpdate

        //insert update
        public int InsertUpdate(Entities.CapNhatGia cng1)
        {
            cng = new Constants.CapNhatGia();
            Sql = new Constants.Sql();
            string sql = Sql.InsertUpdateCapNhatGia;
            Connection conn = new Connection();
            SqlConnection cn = conn.openConnection();
            SqlCommand cmd = new SqlCommand(sql, cn);
            cmd.Parameters.Add(cng.HanhDong, SqlDbType.NVarChar, 20).Value = cng1.HanhDong;
            cmd.Parameters.Add(cng.CapNhatGiaID, SqlDbType.Int).Value = cng1.CapNhatGiaID;
            cmd.Parameters.Add(cng.MaCapNhatGia, SqlDbType.NVarChar, 20).Value = cng1.MaCapNhatGia;
            cmd.Parameters.Add(cng.NgayBatDau, SqlDbType.DateTime).Value = cng1.NgayBatDau;
            cmd.Parameters.Add(cng.NgayKetThuc, SqlDbType.DateTime).Value = cng1.NgayKetThuc;
            cmd.Parameters.Add(cng.MaHangHoa, SqlDbType.NVarChar,20).Value = cng1.MaHangHoa;
            cmd.Parameters.Add(cng.PhanTramGiaBanBuon, SqlDbType.Float).Value = cng1.PhanTramGiaBanBuon;
            cmd.Parameters.Add(cng.PhanTramGiaBanLe, SqlDbType.Float).Value = cng1.PhanTramGiaBanLe;
            cmd.Parameters.Add(cng.GiaNhap, SqlDbType.Float).Value = cng1.GiaNhap;
            cmd.Parameters.Add(cng.Trangthai, SqlDbType.Bit).Value = cng1.Trangthai;
            cmd.Parameters.Add(cng.GhiChu, SqlDbType.NVarChar, 100).Value = cng1.GhiChu;
            cmd.Parameters.Add(cng.Deleted, SqlDbType.Bit).Value = cng1.Deleted;

            int i = cmd.ExecuteNonQuery();
            cmd.Connection.Dispose();
            cn.Close();
            conn.closeConnection();
            cn = null;
            conn = null;
            return i;
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:30,代码来源:CapNhatGia.cs

示例7: InsertUpdate

        public int InsertUpdate(Entities.PhongBan pb1)
        {
            try
            {
                pb = new Constants.PhongBan();
                Sql = new Constants.Sql();
                string sql = Sql.InsertUpdatePhongBan;
                Connection conn = new Connection();
                SqlConnection cn = conn.openConnection();
                SqlCommand cmd = new SqlCommand(sql, cn);
                cmd.Parameters.Add(pb.HanhDong, SqlDbType.NVarChar, 20).Value = pb1.HanhDong;
                cmd.Parameters.Add(pb.PhongBanID, SqlDbType.Int).Value = pb1.PhongBanID;
                cmd.Parameters.Add(pb.MaPhongBan, SqlDbType.NVarChar, 20).Value = pb1.MaPhongBan;
                cmd.Parameters.Add(pb.TenPhongBan, SqlDbType.NVarChar, 200).Value = pb1.TenPhongBan;
                cmd.Parameters.Add(pb.GhiChu, SqlDbType.NVarChar, 100).Value = pb1.GhiChu;
                cmd.Parameters.Add(pb.Deleted, SqlDbType.Bit).Value = pb1.Deleted;

                int i = cmd.ExecuteNonQuery();
                cmd.Connection.Dispose();
                cn.Close();
                conn.closeConnection();
                cn = null;
                conn = null;
                return i;
            }
            catch (Exception ex)
            {
                string s = ex.Message;
                return 0;
            }
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:31,代码来源:PhongBan.cs

示例8: Insert

 /// <summary>
 /// Insert Update Bảng
 /// </summary>
 public bool Insert(Entities.SoDuSoQuy pxh)
 {
     try
     {
         bool kt = false;
         pt = new Constants.SoQuy();
         Sql = new Constants.Sql();
         string sql = Sql.InsertSoDuSoQuy;
         Connection conn = new Connection();
         SqlConnection cn = conn.openConnection();
         SqlCommand cmd = new SqlCommand(sql, cn);
         cmd.Parameters.Add(pt.MaSoDuSoQuy, SqlDbType.VarChar, 20).Value = pxh.MaSoDuSoQuy;
         cmd.Parameters.Add(pt.SoDuDauKy, SqlDbType.Float).Value = pxh.SoDuDauKy;
         cmd.Parameters.Add(pt.NgayKetChuyen, SqlDbType.DateTime).Value = pxh.NgayKetChuyen;
         cmd.Parameters.Add(pt.SoDuCuoiKy, SqlDbType.Float).Value = pxh.SoDuCuoiKy;
         cmd.Parameters.Add(pt.TrangThai, SqlDbType.Bit).Value = pxh.TrangThai;
         int i = cmd.ExecuteNonQuery();
         if (i == 1)
             kt = true;
         else
             kt = false;
         cmd.Connection.Dispose();
         cn.Close();
         conn.closeConnection();
         cn = null;
         conn = null;
         return kt;
     }
     catch
     {
         return false;
     }
 }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:36,代码来源:SoQuy.cs

示例9: Delete

        //delete
        public bool Delete(Entities.NhomHang NhomHang)
        {
            bool kt = false;
            try
            {
                nhh = new Constants.NhomHangHoa();
                Entities.NhomHang nhomhanghoa = new Entities.NhomHang();
                Sql = new Constants.Sql();
                string sql = Sql.DeleteNhomHangHoa;
                Connection conn = new Connection();
                SqlConnection cn = conn.openConnection();
                SqlCommand cmd = new SqlCommand(sql, cn);
                cmd.Parameters.Add(nhh.HanhDong, SqlDbType.NVarChar, 20).Value = NhomHang.HanhDong;
                cmd.Parameters.Add(nhh.NhomHangID, SqlDbType.Int).Value = NhomHang.NhomHangID;

                int i = cmd.ExecuteNonQuery();
                if (i == 1)
                    kt = true;
                else
                    kt = false;
                cmd.Connection.Dispose();
                cn.Close();
                conn.closeConnection();
                cn = null;
                conn = null;
                return kt;
            }
            catch
            {
                return kt;
            }
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:33,代码来源:NhomHang.cs

示例10: Insert

        public int Insert(Entities.TheGiamGia pb1)
        {
            try
            {
                pb = new Constants.TheGiamGia();
                Sql = new Constants.Sql();
                string sql = Sql.InsertTheGiamGia;
                Connection conn = new Connection();
                SqlConnection cn = conn.openConnection();
                SqlCommand cmd = new SqlCommand(sql, cn);
                cmd.Parameters.Add(pb.HanhDong, SqlDbType.NVarChar, 50).Value = pb1.HanhDong;
                cmd.Parameters.Add(pb.MaTheGiamGia, SqlDbType.VarChar, 50).Value = pb1.MaTheGiamGia;
                cmd.Parameters.Add(pb.MaKhachHang, SqlDbType.VarChar, 50).Value = pb1.MaKhachHang;
                cmd.Parameters.Add(pb.GiaTriThe, SqlDbType.Float).Value = pb1.GiaTriThe;
                cmd.Parameters.Add(pb.NgayBatDau, SqlDbType.DateTime).Value = pb1.NgayBatDau;
                cmd.Parameters.Add(pb.NgayKetThuc, SqlDbType.DateTime).Value = pb1.NgayKetThuc;
                cmd.Parameters.Add(pb.Deleted, SqlDbType.Bit).Value = pb1.Deleted;

                int i = cmd.ExecuteNonQuery();
                cmd.Connection.Dispose();
                cn.Close();
                conn.closeConnection();
                cn = null;
                conn = null;
                return i;
            }
            catch (Exception ex)
            {
                string s = ex.Message;
                return 0;
            }
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:32,代码来源:TheGiamGia.cs

示例11: InsertUpdate

        public int InsertUpdate(Entities.ChiTietPhieuDieuChuyenKho CTPhieuDCK)
        {
            try
            {
                ctpdck = new Constants.ChiTietPhieuDieuChuyenKho();
                Sql = new Constants.Sql();
                string sql = Sql.InsertUpdateChiTietPhieuDieuChuyenKho;
                Connection conn = new Connection();
                SqlConnection cn = conn.openConnection();
                SqlCommand cmd = new SqlCommand(sql, cn);
                cmd.Parameters.Add(ctpdck.HanhDong, SqlDbType.NVarChar, 20).Value = CTPhieuDCK.HanhDong;
                cmd.Parameters.Add(ctpdck.MaPhieuDieuChuyenKho, SqlDbType.NVarChar, 20).Value = CTPhieuDCK.MaPhieuDieuChuyenKho;
                cmd.Parameters.Add(ctpdck.MaHangHoa, SqlDbType.NVarChar, 50).Value = CTPhieuDCK.MaHangHoa;
                cmd.Parameters.Add(ctpdck.SoLuong, SqlDbType.Int).Value = CTPhieuDCK.SoLuong;
                cmd.Parameters.Add(ctpdck.GhiChu, SqlDbType.NVarChar, 100).Value = CTPhieuDCK.GhiChu;
                cmd.Parameters.Add(ctpdck.Deleted, SqlDbType.Bit).Value = CTPhieuDCK.Deleted;

                int i = cmd.ExecuteNonQuery();
                cmd.Connection.Dispose();
                cn.Close();
                conn.closeConnection();
                cn = null;
                conn = null;
                return i;
            }
            catch (Exception ex)
            {
                string s = ex.Message;
                return 0;
            }
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:31,代码来源:ChiTietPhieuDieuChuyenKho.cs

示例12: deleteNhomQuyen

        public bool deleteNhomQuyen(Entities.NhomQuyen nq1)
        {
            try
            {
                bool kt = false;
                nq = new Constants.NhomQuyen();
                Sql = new Constants.Sql();
                string sql = Sql.deleteNhomQuyen;
                Connection conn = new Connection();
                SqlConnection cn = conn.openConnection();
                SqlCommand cmd = new SqlCommand(sql, cn);

                cmd.Parameters.Add(nq.TenNhomQuyen, SqlDbType.VarChar, 50).Value = nq1.TenNhomQuyen;

                int i = cmd.ExecuteNonQuery();
                if (i >= 0)
                    kt = true;
                else
                    kt = false;
                cmd.Connection.Dispose();
                cn.Close();
                conn.closeConnection();
                cn = null;
                conn = null;
                return kt;
            }
            catch (Exception ex)
            {
                string s = ex.Message;
                return false;
            }
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:32,代码来源:NhomQuyen.cs

示例13: Delete

 //delete
 public int Delete(Entities.KhoHang kh1)
 {
     int tra = 0;
     try
     {
         kh = new Constants.KhoHang();
         Entities.KhoHang khohang = new Entities.KhoHang();
         Sql = new Constants.Sql();
         string sql = Sql.DeleteKhoHang;
         Connection conn = new Connection();
         SqlConnection cn = conn.openConnection();
         SqlCommand cmd = new SqlCommand(sql, cn);
         cmd.Parameters.Add(kh.HanhDong, SqlDbType.NVarChar, 20).Value = kh1.HanhDong;
         cmd.Parameters.Add(kh.KhoHangID, SqlDbType.Int).Value = kh1.KhoHangID;
         tra = cmd.ExecuteNonQuery();
         cmd.Connection.Dispose();
         cn.Close();
         conn.closeConnection();
         cn = null;
         conn = null;
     }
     catch (Exception ex)
     { string s = ex.Message; tra = 0; }
     return tra;
 }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:26,代码来源:KhoHang.cs

示例14: Delete

 /// <summary>
 /// Delete Bảng
 /// </summary>
 public int Delete(Entities.NhomKH nkh2)
 {
     int Trave = 0;
     try
     {
         nkh = new Constants.NhomKH();
         Sql = new Constants.Sql();
         string sql = Sql.DeleteNhomKH;
         conn = new Connection();
         cn = conn.openConnection();
         cmd = new SqlCommand(sql, cn);
         cmd.Parameters.Add(nkh.HanhDong, SqlDbType.NVarChar, 20).Value = nkh2.Hanhdong.ToString();
         cmd.Parameters.Add(nkh.NhomKHID, SqlDbType.Int).Value = nkh2.NhomKHID;
         Trave = cmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     { string s = ex.Message.ToString(); }
     finally
     {
         cmd.Connection.Dispose();
         cn.Close();
         conn.closeConnection();
     }
     return Trave;
 }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:28,代码来源:NhomKH.cs

示例15: Delete

        /// <summary>
        /// Delete Bảng
        /// </summary>
        public bool Delete(Entities.PhieuTTCuaKH pttckh)
        {
            try
            {
                bool kt = false;
                pt = new Constants.PhieuTTCuaKH();
                Sql = new Constants.Sql();
                string sql = Sql.DeletePhieuTTCuaKH;
                Connection conn = new Connection();
                SqlConnection cn = conn.openConnection();
                SqlCommand cmd = new SqlCommand(sql, cn);
                cmd.Parameters.Add(pt.HanhDong, SqlDbType.NVarChar, 20).Value = pttckh.HanhDong;
                cmd.Parameters.Add(pt.PhieuTTCuaKHID, SqlDbType.Int).Value = pttckh.PhieuTTCuaKHID;

                int i = cmd.ExecuteNonQuery();
                if (i == 1)
                    kt = true;
                else
                    kt = false;
                cmd.Connection.Dispose();
                cn.Close();
                conn.closeConnection();
                cn = null;
                conn = null;
                return kt;
            }
            catch
            {
                return false;
            }
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:34,代码来源:PhieuTTCuaKH.cs


注:本文中的Common.Constants.Sql类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。