Пример #1
0
        public bool insertBill(string userid, string tableid)
        {
            string sql = "insert into tblHoadon (sMaNV, sMaban,dThoigianthanhtoan,sTrangthai,fToongtien) values(" + userid + "," + tableid + ",GETDATE(),0,0)";

            try
            {
                conn.ExcuteNonQuery(sql);
                return(true);
            }
            catch (Exception exp)
            {
                return(false);
            }
        }
        public bool insertTable(string name)
        {
            String sql = "insert into tblBan (sName,sStatus) values (N'" + name + "', '0');";

            try
            {
                conn.ExcuteNonQuery(sql);
                return(true);
            }
            catch (Exception exp)
            {
                return(false);
            }
        }
        public bool insertDrinks(string name, String typeDrink, String fDongia)
        {
            String sql = "insert into tblMenu (sTendouong,sLoaidouong,fDongia) values(N'" + name + "'," + typeDrink + "," + fDongia + ")";

            try
            {
                conn.ExcuteNonQuery(sql);
                return(true);
            }
            catch (Exception exp)
            {
                return(false);
            }
        }
        public bool insertTypeDrinks(string name)
        {
            String sql = "insert into tblLoaidouong (sName) values (N'" + name + "');";

            try
            {
                conn.ExcuteNonQuery(sql);
                return(true);
            }
            catch (Exception exp)
            {
                return(false);
            }
        }
        public bool insertUser(string sHoten, string sGioitinh, string iType_user, string iSdt, string dNgaysinh, string iCMND, string sUsername, string sPassword, string sDiachi)
        {
            string sql = "insert into tblUser(sHoten,sGioitinh,iType_user,iSdt,dNgaysinh,iCMND,sUsername,sPassword,sDiaChi) values" +
                         "(N'" + sHoten + "', N'" + sGioitinh + "', " + iType_user + ", '" + iSdt + "', '" + dNgaysinh + "', '" + iCMND + "', N'" + sUsername + "', N'" + sPassword + "', N'" + sDiachi + "')";

            try
            {
                conn.ExcuteNonQuery(sql);
                return(true);
            }
            catch (Exception exp)
            {
                return(false);
            }
        }
Пример #6
0
        public bool insertBillinfor(string bill_id, string drinks_id, string soluong)
        {
            string sql = "insert into tblChitietHD(sMaHD,sMadouong,iSoluong) values (" + bill_id + "," + drinks_id + "," + soluong + ")";

            try
            {
                conn.ExcuteNonQuery(sql);
                return(true);
            }
            catch (Exception exp)
            {
                return(false);
            }
        }