예제 #1
0
        public int delProductTest([PexAssumeUnderTest] BusinessPlayer target, string id)
        {
            int result = target.delProduct(id);

            return(result);
            // TODO: add assertions to method BusinessPlayerTest.delProductTest(BusinessPlayer, String)
        }
예제 #2
0
        private void editProduct_Load(object sender, EventArgs e)
        {
            business = new BusinessPlayer(Login.UserName, Login.Password);
            DataTable dataTable = new DataTable();

            business.queryProductsByID(Id, dataTable);

            getColor();
            getSize();
            getCatogories();
            getMadeIn();

            name.Text        = dataTable.Rows[0]["Name"].ToString();
            price.Text       = dataTable.Rows[0]["Price"].ToString();
            quantity.Text    = dataTable.Rows[0]["Quantity"].ToString();
            content.Text     = dataTable.Rows[0]["Content"].ToString();
            colorsBox.Text   = dataTable.Rows[0]["Color"].ToString();
            sizeBox.Text     = dataTable.Rows[0]["Size"].ToString();
            CatogoryBox.Text = dataTable.Rows[0]["Category"].ToString();
            Countrybox.Text  = dataTable.Rows[0]["MadeIn"].ToString();
            img = dataTable.Rows[0]["Image"].ToString();
            try
            {
                pictureBox.Image = Image.FromFile(img);
            }
            catch (Exception ex) { Console.WriteLine(ex.ToString()); }
        }
예제 #3
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            String         input    = colorsBox.Text;
            BusinessPlayer business = new BusinessPlayer(Login.UserName, Login.Password);

            if (input.Equals(""))
            {
                MessageBox.Show("Vui lòng nhập màu sắc!");
                return;
            }

            if (business.getColor(input) > 0)
            {
                MessageBox.Show("Màu đã tồn tại. Vui lòng nhập màu khác!");
                return;
            }

            if (business.addColor(input) > 0)
            {
                MessageBox.Show("Thêm thành công!");
                this.DialogResult = DialogResult.OK;
                this.color        = input;
                this.Close();
            }
            else
            {
                MessageBox.Show("Thêm thất bại!");
            }
        }
public void SetUserPassTest650()
{
    BusinessPlayer businessPlayer;
    businessPlayer = new BusinessPlayer((string)null, (string)null);
    this.SetUserPassTest(businessPlayer, (string)null, (string)null);
    Assert.IsNotNull((object)businessPlayer);
}
예제 #5
0
        public BusinessPlayer ConstructorTest01(string username, string password)
        {
            BusinessPlayer target = new BusinessPlayer(username, password);

            return(target);
            // TODO: add assertions to method BusinessPlayerTest.ConstructorTest01(String, String)
        }
예제 #6
0
        public List <string> GetCategoriesTest([PexAssumeUnderTest] BusinessPlayer target)
        {
            List <string> result = target.GetCategories();

            return(result);
            // TODO: add assertions to method BusinessPlayerTest.GetCategoriesTest(BusinessPlayer)
        }
예제 #7
0
        public int delWarrantyTest([PexAssumeUnderTest] BusinessPlayer target, string data)
        {
            int result = target.delWarranty(data);

            return(result);
            // TODO: add assertions to method BusinessPlayerTest.delWarrantyTest(BusinessPlayer, String)
        }
예제 #8
0
        public List <string> getWarrantyTest([PexAssumeUnderTest] BusinessPlayer target)
        {
            List <string> result = target.getWarranty();

            return(result);
            // TODO: add assertions to method BusinessPlayerTest.getWarrantyTest(BusinessPlayer)
        }
예제 #9
0
        public BusinessPlayer ConstructorTest()
        {
            BusinessPlayer target = new BusinessPlayer();

            return(target);
            // TODO: add assertions to method BusinessPlayerTest.ConstructorTest()
        }
예제 #10
0
        public List <string> GetDistrictsTest([PexAssumeUnderTest] BusinessPlayer target, string province)
        {
            List <string> result = target.GetDistricts(province);

            return(result);
            // TODO: add assertions to method BusinessPlayerTest.GetDistrictsTest(BusinessPlayer, String)
        }
예제 #11
0
        public string MD5HashTest(string input)
        {
            string result = BusinessPlayer.MD5Hash(input);

            return(result);
            // TODO: add assertions to method BusinessPlayerTest.MD5HashTest(String)
        }
예제 #12
0
        public int getWarrantyTest01([PexAssumeUnderTest] BusinessPlayer target, string input)
        {
            int result = target.getWarranty(input);

            return(result);
            // TODO: add assertions to method BusinessPlayerTest.getWarrantyTest01(BusinessPlayer, String)
        }
예제 #13
0
        public int InsertOrdersTest([PexAssumeUnderTest] BusinessPlayer target, string customerID)
        {
            int result = target.InsertOrders(customerID);

            return(result);
            // TODO: add assertions to method BusinessPlayerTest.InsertOrdersTest(BusinessPlayer, String)
        }
예제 #14
0
        public List <string> GetProvincesTest([PexAssumeUnderTest] BusinessPlayer target, string Country)
        {
            List <string> result = target.GetProvinces(Country);

            return(result);
            // TODO: add assertions to method BusinessPlayerTest.GetProvincesTest(BusinessPlayer, String)
        }
예제 #15
0
        public int GetProvinceTest([PexAssumeUnderTest] BusinessPlayer target, string input)
        {
            int result = target.GetProvince(input);

            return(result);
            // TODO: add assertions to method BusinessPlayerTest.GetProvinceTest(BusinessPlayer, String)
        }
예제 #16
0
        public int getCategoriesTest([PexAssumeUnderTest] BusinessPlayer target, string input)
        {
            int result = target.getCategories(input);

            return(result);
            // TODO: add assertions to method BusinessPlayerTest.getCategoriesTest(BusinessPlayer, String)
        }
예제 #17
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            String user = username.Text;
            String pass = password.Text;

            BusinessPlayer business = new BusinessPlayer();

            business.SetUserPass(user, pass);

            try
            {
                business.Connection();
                UserName = user;
                Password = pass;
                Main main = new Main();
                this.Hide();
                main.ShowDialog();
                if (main.DialogResult == DialogResult.OK)
                {
                    this.Show();
                }
                else
                {
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Tài khoản, mật khẩu không đúng hoặc máy chủ không phản hổi!", "Kết nối lỗi");
                Console.WriteLine("Loi cmnr: " + ex.ToString());
            }
        }
예제 #18
0
        public void SetPasswordTest958()
        {
            BusinessPlayer businessPlayer;

            businessPlayer = new BusinessPlayer((string)null, "");
            this.SetPasswordTest(businessPlayer, "");
            Assert.IsNotNull((object)businessPlayer);
        }
예제 #19
0
 public void queryProductsByIDTest(
     [PexAssumeUnderTest] BusinessPlayer target,
     string id,
     DataTable data
     )
 {
     target.queryProductsByID(id, data);
     // TODO: add assertions to method BusinessPlayerTest.queryProductsByIDTest(BusinessPlayer, String, DataTable)
 }
예제 #20
0
 public void queryOrdersDetailTest(
     [PexAssumeUnderTest] BusinessPlayer target,
     string idOrder,
     DataTable data
     )
 {
     target.queryOrdersDetail(idOrder, data);
     // TODO: add assertions to method BusinessPlayerTest.queryOrdersDetailTest(BusinessPlayer, String, DataTable)
 }
예제 #21
0
 public void queryCustomerWithAccountByIDTest(
     [PexAssumeUnderTest] BusinessPlayer target,
     DataTable data,
     string ID
     )
 {
     target.queryCustomerWithAccountByID(data, ID);
     // TODO: add assertions to method BusinessPlayerTest.queryCustomerWithAccountByIDTest(BusinessPlayer, DataTable, String)
 }
예제 #22
0
 public void querOrdersByYearTest(
     [PexAssumeUnderTest] BusinessPlayer target,
     DataTable data,
     DateTime time
     )
 {
     target.querOrdersByYear(data, time);
     // TODO: add assertions to method BusinessPlayerTest.querOrdersByYearTest(BusinessPlayer, DataTable, DateTime)
 }
예제 #23
0
 public void SetUserPassTest(
     [PexAssumeUnderTest] BusinessPlayer target,
     string username,
     string password
     )
 {
     target.SetUserPass(username, password);
     // TODO: add assertions to method BusinessPlayerTest.SetUserPassTest(BusinessPlayer, String, String)
 }
예제 #24
0
        private void getMadeIn()
        {
            BusinessPlayer business = new BusinessPlayer(Login.UserName, Login.Password);
            List <String>  MadeIns  = business.GetMadeIn();

            foreach (String Country in MadeIns)
            {
                Countrybox.Items.Add(Country);
            }
        }
예제 #25
0
        private void getSize()
        {
            BusinessPlayer business = new BusinessPlayer(Login.UserName, Login.Password);
            List <String>  sizes    = business.getSize();

            foreach (String size in sizes)
            {
                sizeBox.Items.Add(size);
            }
        }
예제 #26
0
        private void getColor()
        {
            BusinessPlayer business = new BusinessPlayer(Login.UserName, Login.Password);
            List <String>  colors   = business.getColor();

            foreach (String color in colors)
            {
                colorsBox.Items.Add(color);
            }
        }
예제 #27
0
        public void AddAccount541()
        {
            BusinessPlayer businessPlayer;
            int            i;

            businessPlayer = new BusinessPlayer((string)null, (string)null);
            i = this.AddAccount(businessPlayer, "", "", (string)null);
            Assert.AreEqual <int>(0, i);
            Assert.IsNotNull((object)businessPlayer);
        }
public void SetUserPassTest33()
{
    BusinessPlayer businessPlayer;
    businessPlayer =
      new BusinessPlayer("Data Source=Trung-tin-it;Initial Catalog=ShopOnline;", 
                         "Data Source=Trung-tin-it;Initial Catalog=ShopOnline;");
    this.SetUserPassTest(businessPlayer, 
                         "Data Source=Trung-tin-it;Initial Catalog=ShopOnline;", (string)null);
    Assert.IsNotNull((object)businessPlayer);
}
예제 #29
0
        private void getCatogories()
        {
            BusinessPlayer business   = new BusinessPlayer(Login.UserName, Login.Password);
            List <String>  Catogories = business.GetCategories();

            foreach (String Catogory in Catogories)
            {
                CatogoryBox.Items.Add(Catogory);
            }
        }
예제 #30
0
        public int addProvinceTest(
            [PexAssumeUnderTest] BusinessPlayer target,
            string provice,
            string country
            )
        {
            int result = target.addProvince(provice, country);

            return(result);
            // TODO: add assertions to method BusinessPlayerTest.addProvinceTest(BusinessPlayer, String, String)
        }