Beispiel #1
0
        //public static ToCheckMaBan(string Ma_Ban)
        //{
        //    string sQuery = string.Format("select")
        //}
        public static void TinhTien(int Ma_HD)
        {
            string sQuery = string.Format("Update Hoa_Don set Tinh_Trang = 'R' where Ma_Hoa_Don = {0}", Ma_HD);

            sProvider = new Provider();
            var u = sProvider.ExcuteData(sQuery);
        }
Beispiel #2
0
        public static bool Add_NV(NhanVien_DTO nv)
        {
            try
            {
                string squery = string.Format("exec proc_AddNV @MaNV='{0}',@TenNV=N'{1}',@GT='{2}',@DiaChi=N'{3}',@SDT='{4}',@Email='{5}',@Ngay_Sinh ='{6}',@Chuc_Vu=N'{7}',@NVL='{8}',@Luong={9}", nv.MaNV, nv.TenNV, nv.GioiTinh, nv.DiaChi, nv.SDT, nv.Email, nv.NgaySinh, nv.ChucVu, nv.NgayVaoLam, nv.Luong);
                sprovider = new Provider();
                var u = sprovider.ExcuteData(squery);
                return(true);
            }
            catch
            {
                return(false);

                throw;
            }
        }
Beispiel #3
0
        public static bool InsertChiTietHoaDon(int MaHD, string MaSP, string TenSP, int SL)
        {
            try
            {
                string sQuery = string.Format("exec proc_InsertCTHD @MaHD={0}, @MaSP='{1}',@TenSP = N'{2}', @SL={3}", MaHD, MaSP, TenSP, SL);
                sprovider = new Provider();
                var u = sprovider.ExcuteData(sQuery);
                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Beispiel #4
0
        //public string GetUncheckBillIDByTableID(string Ma_Ban)
        //{
        //    sProvider = new Provider();
        //    DataTable data = sProvider.ExcuteData.("SELECT * FROM dbo.Bill WHERE idTable = " + Ma_Ban + " AND status = 0");

        //    if (data.Rows.Count > 0)
        //    {
        //        Bill bill = new Bill(data.Rows[0]);
        //        return bill.ID;
        //    }
        //    return ;
        //}

        public static bool InsertHoaDon(string Ma_Ban)
        {
            try
            {
                sProvider = new Provider();
                string Squery = string.Format("exec proc_InsertHD @Ma_Ban='{0}'", Ma_Ban);
                var    u      = sProvider.ExcuteData(Squery);
                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Beispiel #5
0
        public static bool Them_Ban(Ban_DTO Ban_DTO)
        {
            try
            {
                string   sQuery2  = string.Format("Insert into Ban(Ma_Ban,Ten_Ban,Ma_KV,Tinh_Trang,So_TT) Values('{0}',N'{1}',N'{2}','{3}',{4})", Ban_DTO.Ma_Ban, Ban_DTO.Tenn_Ban, Ban_DTO.Ma_KV, Ban_DTO.Tinh_Trang, Ban_DTO.So);
                Provider provider = new Provider();
                var      u        = provider.ExcuteData(sQuery2);
                return(true);

                conn.Close();
            }
            catch (Exception Ex)
            {
                return(false);
            }
        }
Beispiel #6
0
        public static bool Them_Menu_1(Menu_DTO Menu_DTO)
        {
            try
            {
                //string sQuery2 = "Insert into MENU(Ma_SP,Ten_SP,Loai_SP,DVT,Don_Gia) values(@Ma_SP,Ten_SP,Loai_SP,@DVT,@DG)";
                //SqlCommand cmd = conn.CreateCommand();
                //cmd.CommandText = sQuery2;

                //SqlParameter MASP = new SqlParameter("@Ma_SP", SqlDbType.Char);
                //MASP.Value = Menu_DTO.MaSP;
                //cmd.Parameters.Add(MASP);

                //SqlParameter TENSP = new SqlParameter("@Ten_SP", SqlDbType.NVarChar);
                //TENSP.Value = Menu_DTO.TenSP;
                //cmd.Parameters.Add(TENSP);

                //SqlParameter LOAI = new SqlParameter("@Loai_SP", SqlDbType.NVarChar);
                //LOAI.Value = Menu_DTO.LoaiSP;
                //cmd.Parameters.Add(LOAI);

                //SqlParameter DVT = new SqlParameter("@DVT", SqlDbType.NVarChar);
                //DVT.Value = Menu_DTO.LoaiSP;
                //cmd.Parameters.Add(DVT);

                //SqlParameter DG = new SqlParameter("@DG", SqlDbType.Int);
                //DG.Value = Menu_DTO.DonGia;
                //cmd.Parameters.Add(DG);
                //int count = cmd.ExecuteNonQuery();
                string   sQuery2  = string.Format("Insert into MENU(Ma_SP,Ten_SP,Loai_SP,DVT,Don_Gia) Values('{0}',N'{1}',N'{2}',N'{3}',{4})", Menu_DTO.MaSP, Menu_DTO.TenSP, Menu_DTO.LoaiSP, Menu_DTO.DVT, Menu_DTO.DonGia);
                Provider provider = new Provider();
                var      u        = provider.ExcuteData(sQuery2);
                return(true);

                conn.Close();
            }
            catch (Exception Ex)
            {
                return(false);
            }
        }