public static DataSet ShowRole(string UserName)
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.ExecuteQueryDataSet("select Roles.Role from Users inner join Roles on Users.IDRole = Roles.IDRole where Users.UserName = N'" +
                                           UserName + "'", CommandType.Text));
        }
Ejemplo n.º 2
0
        public static bool Register_Seller(string UserName, string UserNameSeller, string PassWord, string PassWordSeller, string FullName, string Gender, DateTime DateofBirth,
                                           string PhoneNumber, string Email, string Image, ref string err)
        {
            Database_VegetableShop _db = new Database_VegetableShop(UserName, PassWord);

            return(_db.MyExecuteNonQuery("execute RegisterSeller N'" + UserNameSeller + "',N'" + PassWordSeller + "',N'" + FullName + "',N'" + Gender + "',N'" + DateofBirth + "',N'" + PhoneNumber + "',N'" + Email + "',N'" + Image + "'", CommandType.Text, ref err));
        }
Ejemplo n.º 3
0
        public static bool Register_Customer(string UserName, string PassWord, string FullName, string Gender, DateTime DateofBirth,
                                             string PhoneNumber, string Email, string Image, string Province, string District, string Ward, string Street, ref string err)
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.MyExecuteNonQuery("execute RegisterCustomer N'" + UserName + "',N'" + PassWord + "',N'" + FullName + "',N'" + Gender + "',N'" + DateofBirth + "',N'" + PhoneNumber + "',N'" + Email + "',N'" + Image + "',N'" + Province + "',N'" + District + "',N'" + Ward + "',N'" + Street + "'", CommandType.Text, ref err));
        }
Ejemplo n.º 4
0
        public static bool AddItem(string UserName, string PassWord, string ItemName, float ImportPrice, float SalePrice, string Description, string Orgin,
                                   string IDCategory, string IDSubcategory, string Image, ref string err)
        {
            Database_VegetableShop _db = new Database_VegetableShop(UserName, PassWord);

            return(_db.MyExecuteNonQuery("exec AddItems N'" + ItemName + "'," + ImportPrice + "," + SalePrice + ",N'" + Description +
                                         "',N'" + Orgin + "',N'" + IDCategory + "',N'" + IDSubcategory + "',N'" + Image + "'", CommandType.Text, ref err));
        }
        public static bool DeleteUser(string UserNameUser, string UserName, string PassWord, ref string err)
        {
            Database_VegetableShop _db = new Database_VegetableShop(UserName, PassWord);

            return(_db.MyExecuteNonQuery("exec DeleteUser N'" + UserNameUser + "'", CommandType.Text, ref err));
        }
        public static DataSet User_Infor(string UserName)
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.ExecuteQueryDataSet("select UserName,FullName,Gender,DateofBirth,PhoneNumber,Email,Image from Users where Users.UserName = N'" + UserName + "'", CommandType.Text));
        }
        public static DataSet Items_Show(string UserName, string PassWord)
        {
            Database_VegetableShop _db = new Database_VegetableShop(UserName, PassWord);

            return(_db.ExecuteQueryDataSet("select Items.ItemName as ItemName from Items", CommandType.Text));
        }
Ejemplo n.º 8
0
        public static DataSet IDProvince_Find(string ProvinceName)
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.ExecuteQueryDataSet("select dbo.IDProvince_Find(N'" + ProvinceName + "')", CommandType.Text));
        }
Ejemplo n.º 9
0
        public static DataSet District_Show(int Id)
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.ExecuteQueryDataSet("select District.Type + ' ' + District.Name as DistrictName from District where District.ProvinceId = N'" + Id + "'", CommandType.Text));
        }
        public static bool ChangePassWord(string UserName, string PassWordOld, string PassWordNew, string err)
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.MyExecuteNonQuery("exec ChangePassWord N'" + UserName + "',N'" + PassWordOld + "',N'" + PassWordNew + "'", CommandType.Text, ref err));
        }
        public static DataSet Top5Customer()
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.ExecuteQueryDataSet("select * from dbo.Top5Customer()", CommandType.Text));
        }
Ejemplo n.º 12
0
        public static DataSet FindItems_SubCategory(string SubCategory)
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.ExecuteQueryDataSet("select * from dbo.FindItems_SubCategory(N'" + SubCategory + "')", CommandType.Text));
        }
        public static DataSet UserManagement()
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.ExecuteQueryDataSet("select * from UserManagement", CommandType.Text));
        }
Ejemplo n.º 14
0
        public static DataSet FindItems_ItemName(string ItemName)
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.ExecuteQueryDataSet("select * from dbo.FindItems_ItemName(N'" + ItemName + "')", CommandType.Text));
        }
Ejemplo n.º 15
0
        public static DataSet PriceItem(string ItemName)
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.ExecuteQueryDataSet("select SalePrice from Items where Items.ItemName = N'" + ItemName + "'", CommandType.Text));
        }
Ejemplo n.º 16
0
        public static DataSet ShowItem(string UserName)
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.ExecuteQueryDataSet("select ItemName, SalePrice, Image from Items", CommandType.Text));
        }
        public static DataSet ShowTotalPrice(string UserName, string PassWord)
        {
            Database_VegetableShop _db = new Database_VegetableShop(UserName, PassWord);

            return(_db.ExecuteQueryDataSet("select dbo.ShowTotalPrice(N'" + UserName + "')", CommandType.Text));
        }
        public static DataSet ShowCart(string UserName)
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.ExecuteQueryDataSet("select * from dbo.ShowCart(N'" + UserName + "')", CommandType.Text));
        }
        public static DataSet Statistic_Revenue(string UserName, string PassWord, DateTime DateStart, DateTime DateEnd)
        {
            Database_VegetableShop _db = new Database_VegetableShop(UserName, PassWord);

            return(_db.ExecuteQueryDataSet("select * from dbo.Statistic_Revenue('" + DateStart + "','" + DateEnd + "')", CommandType.Text));
        }
        public static DataSet ImportDetailsManagement(string UserName, string PassWord)
        {
            Database_VegetableShop _db = new Database_VegetableShop(UserName, PassWord);

            return(_db.ExecuteQueryDataSet("select * from ImportDetailsManagement", CommandType.Text));
        }
Ejemplo n.º 21
0
        public static DataSet Province_Show()
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.ExecuteQueryDataSet("select Province.Type + ' ' + Province.Name as ProvinceName from Province", CommandType.Text));
        }
        public static DataSet OrderManagementDetail(string UserName, string PassWord, string IDBill)
        {
            Database_VegetableShop _db = new Database_VegetableShop(UserName, PassWord);

            return(_db.ExecuteQueryDataSet("select * from dbo.OrderManagementDetail (N'" + IDBill + "')", CommandType.Text));
        }
Ejemplo n.º 23
0
        public static DataSet IDDistrict_Find(string DistrictName)
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.ExecuteQueryDataSet("select District.Id from District where District.Name = N'" + DistrictName + "'", CommandType.Text));
        }
        public static bool ChangeState(string UserName, string PassWord, string IDBill, string OrderStateName, ref string err)
        {
            Database_VegetableShop _db = new Database_VegetableShop(UserName, PassWord);

            return(_db.MyExecuteNonQuery("exec ChangeState N'" + UserName + "', N'" + IDBill + "',N'" + OrderStateName + "'", CommandType.Text, ref err));
        }
Ejemplo n.º 25
0
        public static DataSet Ward_Show(int Id)
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.ExecuteQueryDataSet("select Ward.Type + ' ' + Ward.Name as WardName from Ward where Ward.DistrictID = N'" + Id + "'", CommandType.Text));
        }
        public static DataSet ShowCountOrder(string UserName, string PassWord, string OrderStateName)
        {
            Database_VegetableShop _db = new Database_VegetableShop(UserName, PassWord);

            return(_db.ExecuteQueryDataSet("select dbo.CountOrder(N'" + UserName + "',N'" + OrderStateName + "')", CommandType.Text));
        }
        public static DataSet SignIn(string UserName, string PassWord)
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.ExecuteQueryDataSet("select dbo.SignIn(N'" + UserName + "',N'" + PassWord + "')", CommandType.Text));
        }
        public static bool DeleteItem(string UserName, string PassWord, string ItemName, ref string err)
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.MyExecuteNonQuery("exec DeleteItems N'" + ItemName + "'", CommandType.Text, ref err));
        }
        public static bool ImportItems(string ItemName, string UserName, string PassWord, float Quantity, ref string err)
        {
            Database_VegetableShop _db = new Database_VegetableShop(UserName, PassWord);

            return(_db.MyExecuteNonQuery("exec ImportItems N'" + ItemName + "',N'" + UserName + "'," + Quantity, CommandType.Text, ref err));
        }
        public static DataSet ImageUser(string UserName)
        {
            Database_VegetableShop _db = new Database_VegetableShop();

            return(_db.ExecuteQueryDataSet("select Users.Image from Users where Users.UserName = N'" + UserName + "'", CommandType.Text));
        }