Ejemplo n.º 1
0
        public void addproduct()
        {
            ObjProduct objproduct = new ObjProduct(myManager);

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element pgtitle = objproduct.addpgtitle;

            Assert.IsTrue(pgtitle.InnerText.Contains("Create New Product"));

            Thread.Sleep(1000);

            HtmlInputText name    = objproduct.nametxt.As <HtmlInputText>();
            HtmlInputText variant = objproduct.varianttxt.As <HtmlInputText>();
            HtmlInputText freetxt = objproduct.freetexttxt.As <HtmlInputText>();

            name.Text    = _productname;
            variant.Text = _variant;
            freetxt.Text = _freetext;

            Element savebutton = objproduct.savebtn;

            myManager.ActiveBrowser.Actions.Click(savebutton);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifyexisting = objproduct.existingmsg;

            Assert.IsTrue(verifyexisting.InnerText.Contains("Product Name already exist"));

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
        public void TextMethod_addInvalidProduct()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjProduct objproduct = new ObjProduct(myManager);

            Element addproductbutton = objproduct.addproductbtn;

            myManager.ActiveBrowser.Actions.Click(addproductbutton);

            addinvalidprod();
        }
Ejemplo n.º 3
0
        private void btnMove_Click(object sender, EventArgs e)
        {
            LapDonHangBLL lapDonHangBLL = new LapDonHangBLL();

            if (check) // là combo
            {
                ObjCombo obj = new ObjCombo();
                obj.Combo = lapDonHangBLL.GetCombo(id);
                if (arr_combo.Count != 0)
                {
                    foreach (ObjCombo a in arr_combo)
                    {
                        if (a.Combo.Id == id)
                        {
                            a.Quantity++;
                            flagfind = true;
                        }
                    }
                    if (flagfind == false)
                    {
                        obj.Quantity = 1;
                        arr_combo.Add(obj);
                    }
                    flagfind = false;
                }
                else
                {
                    obj.Quantity = 1;
                    arr_combo.Add(obj);
                }
            }
            else
            {
                ObjProduct obj = new ObjProduct();
                obj.Product = lapDonHangBLL.GetProduct(id);;
                if (arr_product.Count != 0)
                {
                    foreach (ObjProduct a in arr_product)
                    {
                        if (a.Product.id == id)
                        {
                            a.Quantity++;
                            flagfind = true;
                        }
                    }
                    if (flagfind == false)
                    {
                        obj.Quantity = 1;
                        arr_product.Add(obj);
                    }
                    flagfind = false;
                }
                else
                {
                    obj.Quantity = 1;
                    arr_product.Add(obj);
                }
            }
            LoadListViewSelect();
        }
Ejemplo n.º 4
0
        public void invalidProduct()
        {
            ObjProduct objproduct = new ObjProduct(myManager);

            HtmlInputText variant = objproduct.batchvarianttxt.As <HtmlInputText>();
            HtmlInputText freetxt = objproduct.batchfreetexttxt.As <HtmlInputText>();

            variant.Text = _invalidvariant;
            freetxt.Text = _batcheditfreetext;

            Thread.Sleep(3000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element update = objproduct.batchupdatebtn;

            myManager.ActiveBrowser.Actions.Click(update);

            Thread.Sleep(3000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifymsg = objproduct.variantinvalidmsg;

            Assert.IsTrue(verifymsg.InnerText.Contains("The VariantString(s) (G1) entered is invalid"));

            Element pgverify2 = objproduct.batcheditpgtitle;

            Assert.IsTrue(pgverify2.InnerText.Contains("Batch Edit Products"));
        }
Ejemplo n.º 5
0
        public void TestMethod_AddProductPage()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjProduct objproduct = new ObjProduct(myManager);

            Element addproductbutton = objproduct.addproductbtn;

            myManager.ActiveBrowser.Actions.Click(addproductbutton);

            // Verify Page contents

            Element pgtitle = objproduct.addpgtitle;

            Assert.IsTrue(pgtitle.InnerText.Contains("Create New Product"));

            Element namelbl = objproduct.namelabel;

            Assert.IsTrue(namelbl.InnerText.Contains("Product Name *"));

            Element variantlbl = objproduct.variantlabel;

            Assert.IsTrue(variantlbl.InnerText.Contains("Variant String *"));

            Element freetxtlbl = objproduct.freetextlabel;

            Assert.IsTrue(freetxtlbl.InnerText.Contains("Free Text"));

            Thread.Sleep(1000);
        }
        public void TextMethod_addProductMandatoryFields()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjProduct objproduct = new ObjProduct(myManager);

            Element addproductbutton = objproduct.addproductbtn;

            myManager.ActiveBrowser.Actions.Click(addproductbutton);

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlInputText productnm = objproduct.nametxt.As <HtmlInputText>();
            HtmlInputText variant   = objproduct.varianttxt.As <HtmlInputText>();

            productnm.Text = _prodnamemandatory;
            variant.Text   = _variantmandatory;

            Element prodname = objproduct.prodnamemandatorymsg;

            Assert.IsTrue(prodname.InnerText.Contains("Product Name is mandatory"));

            Element variantname = objproduct.variantmandatorymsg;

            Assert.IsTrue(variantname.InnerText.Contains("Variant String is mandatory"));

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
Ejemplo n.º 7
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            DialogResult res = MessageBox.Show("Bạn có chắc muốn xóa loại sản phẩm này?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            button = "Delete";
            if (res == DialogResult.Yes)
            {
                client = new ObjProduct(txtProductCode.Text, txtTypeCode.Text, txtProviderCode.Text, txtProductName.Text, txtImportPrice.Text, txtSalePrice.Text, txtUnit.Text);
                server = new LogicProduct();
                server.setDataBase(client, button);
                DataSet dataset_AfterDeleting = server.getDataBase("SanPham");
                dataGridView.DataSource = dataset_AfterDeleting.Tables[0];
            }
        }
Ejemplo n.º 8
0
        public void TestMethod_AddProduct()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element bottomcontent = myManager.ActiveBrowser.Find.ByXPath("//*[@id='body']/div/div/div[4]/table/thead/tr[1]/th[1]/button/span");

            myManager.ActiveBrowser.Actions.ScrollToVisible(bottomcontent);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjProduct objproduct = new ObjProduct(myManager);

            Element addproductbutton = objproduct.addproductbtn;

            myManager.ActiveBrowser.Actions.Click(addproductbutton);

            addproduct();

            //Thread.Sleep(2000);
            //myManager.ActiveBrowser.RefreshDomTree();

            //verifyproduct();

            Thread.Sleep(3000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
Ejemplo n.º 9
0
        public void TestMethod_AddProductBackbtn()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjProduct objproduct = new ObjProduct(myManager);

            Element addproductbutton = objproduct.addproductbtn;

            myManager.ActiveBrowser.Actions.Click(addproductbutton);

            Thread.Sleep(4000);

            Element back = objproduct.backbtn;

            myManager.ActiveBrowser.Actions.Click(back);

            Thread.Sleep(1000);

            Element pagetitle = objproduct.producttabletitle;

            Assert.IsTrue(pagetitle.InnerText.Contains("Products"));
        }
Ejemplo n.º 10
0
        public void addproduct()
        {
            ObjProduct objproduct = new ObjProduct(myManager);

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element pgtitle = objproduct.addpgtitle;

            Assert.IsTrue(pgtitle.InnerText.Contains("Create New Product"));

            Thread.Sleep(1000);

            HtmlInputText name    = objproduct.nametxt.As <HtmlInputText>();
            HtmlInputText variant = objproduct.varianttxt.As <HtmlInputText>();
            HtmlInputText freetxt = objproduct.freetexttxt.As <HtmlInputText>();

            name.Text    = _productname;
            variant.Text = _variant;
            freetxt.Text = _freetext;

            Element savebutton = objproduct.savebtn;

            myManager.ActiveBrowser.Actions.Click(savebutton);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifysave = objproduct.savesuccessMsg;

            Assert.IsTrue(verifysave.InnerText.Contains("Product has been created successfully"));

            //Element verifysave = objproduct.savesuccessMsg;
            //Assert.IsTrue(verifysave.InnerText.Contains("zzz"), "Product has been created successfullyaaaaaaaaaaaaaaaaaaaa aaaa");

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element bottomcontent = myManager.ActiveBrowser.Find.ByXPath("//*[@id='body']/div/div/div[4]/table/thead/tr[1]/th[1]/button/span");

            myManager.ActiveBrowser.Actions.ScrollToVisible(bottomcontent);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
Ejemplo n.º 11
0
        public void verifybatchedit()
        {
            ObjProduct objproduct = new ObjProduct(myManager);

            HtmlInputText searchnm = objproduct.namesearch.As <HtmlInputText>();

            searchnm.Text = _searchproduct;

            myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, searchnm.GetRectangle());
            myManager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlTable producttbl = objproduct.producttable.As <HtmlTable>();

            Assert.AreEqual(producttbl.BodyRows[0].Cells[3].InnerText, _batcheditvariant);
            Assert.AreEqual(producttbl.BodyRows[0].Cells[4].InnerText, _batcheditfreetext);
        }
Ejemplo n.º 12
0
        public void batchedit()
        {
            ObjProduct objproduct = new ObjProduct(myManager);

            HtmlInputText variant  = objproduct.batchvarianttxt.As <HtmlInputText>();
            HtmlInputText freetext = objproduct.batchfreetexttxt.As <HtmlInputText>();

            variant.Text  = _batcheditvariant;
            freetext.Text = _batcheditfreetext;

            Element update = objproduct.batchupdatebtn;

            myManager.ActiveBrowser.Actions.Click(update);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifysuccess = objproduct.batchupdatesuccess;

            Assert.IsTrue(verifysuccess.InnerText.Contains("Product changes saved successfully"));
        }
Ejemplo n.º 13
0
        public void verifyproduct()
        {
            ObjProduct objproduct = new ObjProduct(myManager);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlInputText searchnm = objproduct.namesearch.As <HtmlInputText>();

            searchnm.Text = _productname;

            myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, searchnm.GetRectangle());
            myManager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element pagetitle = objproduct.producttabletitle;

            Assert.IsTrue(pagetitle.InnerText.Contains("Products"));

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlTable prodtbl = objproduct.producttable.As <HtmlTable>();

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            //Assert.AreEqual(prodtbl.BodyRows[0].Cells[2].InnerText, _productname);

            //Thread.Sleep(2000);
            //myManager.ActiveBrowser.RefreshDomTree();

            //Assert.AreEqual(prodtbl.BodyRows[0].Cells[2].InnerText, _freetext);
            //Assert.AreEqual(prodtbl.BodyRows[0].Cells[3].InnerText, _variant);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
Ejemplo n.º 14
0
        public void addinvalidprod()
        {
            ObjProduct objproduct = new ObjProduct(myManager);

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element pgtitle = objproduct.addpgtitle;

            Assert.IsTrue(pgtitle.InnerText.Contains("Create New Product"));

            Thread.Sleep(1000);

            HtmlInputText name    = objproduct.nametxt.As <HtmlInputText>();
            HtmlInputText variant = objproduct.varianttxt.As <HtmlInputText>();
            HtmlInputText freetxt = objproduct.freetexttxt.As <HtmlInputText>();

            name.Text    = _productname2;
            variant.Text = _invalidvariant;
            freetxt.Text = _freetext;

            Thread.Sleep(2000);

            Element savebutton = objproduct.savebtn;

            myManager.ActiveBrowser.Actions.Click(savebutton);

            Thread.Sleep(3000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element invalidmsg = objproduct.varianterrormsg;

            Assert.IsTrue(invalidmsg.InnerText.Contains("The VariantString(s) (G1) entered is invalid"));

            Element pgverify = objproduct.addpgtitle;

            Assert.IsTrue(pgverify.InnerText.Contains("Create New Product"));
        }
Ejemplo n.º 15
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (button == "Add")
            {
                client = new ObjProduct(txtProductCode.Text, txtTypeCode.Text, txtProviderCode.Text, txtProductName.Text, txtImportPrice.Text, txtSalePrice.Text, txtUnit.Text);
                server = new LogicProduct();
                DataSet dataset_Check = server.getDataBase(client);

                if (dataset_Check.Tables[0].Rows.Count > 0)
                {
                    MessageBox.Show("Sản phẩm này đã tồn tại trong danh sách", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    server.setDataBase(client, button);
                    dataset_Check           = server.getDataBase("SanPham");
                    dataGridView.DataSource = dataset_Check.Tables[0];
                }

                enable_button(0);
                button = "";
                return;
            }

            if (button == "Edit")
            {
                client_edited = new ObjProduct(txtProductCode.Text, txtTypeCode.Text, txtProviderCode.Text, txtProductName.Text, txtImportPrice.Text, txtSalePrice.Text, txtUnit.Text);
                server        = new LogicProduct();
                server.editDataBase(client, client_edited);
                DataSet dataset_edit = server.getDataBase("SanPham");
                dataGridView.DataSource = dataset_edit.Tables[0];
                enable_button(0);
                button = "";
                return;
            }
        }
Ejemplo n.º 16
0
        public void setDataBase(ObjProduct client, string button)
        {
            if (button == "Add")
            {
                bool ok = Connection.Instance.setData("INSERT INTO" + nameOfTable + "VALUES('" + client.Productcode + "', '" + client.Typecode + "', '" + client.Providercode + "', N'" + client.Name + "', " + client.Importprice + ", " + client.Saleprice + ", N'" + client.Unit + "');");

                if (ok)
                {
                    MessageBox.Show("Thêm thông tin thành công", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("Danh mục loại sản phẩm chưa tồn tại mã loại này hoặc danh mục nguồn cung cấp chưa tồn tại mã nguồn này! Vui lòng cập nhật các thông tin trên trước khi thêm sản phẩm ! ", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                return;
            }

            if (button == "Delete")
            {
                Connection.Instance.setData("DELETE FROM" + nameOfTable + "WHERE MaSP = '" + client.Productcode + "'");
                return;
            }
        }
Ejemplo n.º 17
0
        public void TestMethod_batchEditProdPage()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---

            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjProduct objproduct = new ObjProduct(myManager);

            HtmlInputText search = objproduct.namesearch.As <HtmlInputText>();

            search.Text = _searchproduct;

            myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, search.GetRectangle());
            myManager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            // Select multiple Products

            HtmlTable producttbl = objproduct.producttable.As <HtmlTable>();

            if (producttbl.BodyRows.Count > 0)
            {
                HtmlInputCheckBox firstrowcheck = objproduct.row1.As <HtmlInputCheckBox>();
                firstrowcheck.Check(true);

                HtmlInputCheckBox secondrowcheck = objproduct.row2.As <HtmlInputCheckBox>();
                secondrowcheck.Check(true);

                // click on Edit button
                HtmlButton editbtn = objproduct.editproductbtn.As <HtmlButton>();
                editbtn.Click();
            }
            else
            {
                throw new Exception("no matching data to edit");
            }

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element pgverify = objproduct.batcheditpgtitle;

            Assert.IsTrue(pgverify.InnerText.Contains("Batch Edit Products"));

            Element variant = objproduct.variantstringlabel;

            Assert.IsTrue(variant.InnerText.Contains("Variant String"));

            Element freetxt = objproduct.freetextlabel;

            Assert.IsTrue(freetxt.InnerText.Contains("Free Text"));

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
Ejemplo n.º 18
0
        public void TextMethod_productPage()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjProduct objproduct = new ObjProduct(myManager);

            // Verify buttons

            Element add = objproduct.addproductbtn;

            Assert.IsTrue(add.InnerText.Contains("Add Product"));

            Element edit = objproduct.editproductbtn;

            Assert.IsTrue(edit.InnerText.Contains("Edit Product/s"));

            Element savefilter = objproduct.savefilterbtn;

            Assert.IsTrue(savefilter.InnerText.Contains("Save"));

            Element delete = objproduct.deleteproductbtn;

            Assert.IsTrue(delete.InnerText.Contains("Delete Product/s"));

            Element export = objproduct.exportproductbtn;

            Assert.IsTrue(export.InnerText.Contains("Excel Export"));


            // Verify table Headings
            Element title = objproduct.producttabletitle;

            Assert.IsTrue(title.InnerText.Contains("Products"));

            Element id = objproduct.prodidheading;

            Assert.IsTrue(id.InnerText.Contains("ID"));

            Element name = objproduct.prodnameheading;

            Assert.IsTrue(name.InnerText.Contains("Name"));

            Element variant = objproduct.prodvariantheading;

            Assert.IsTrue(variant.InnerText.Contains("Variant String"));

            Element freetxt = objproduct.prodfreetxtheading;

            Assert.IsTrue(freetxt.InnerText.Contains("Free Text"));

            Element created = objproduct.prodcreatedheading;

            Assert.IsTrue(created.InnerText.Contains("Created"));

            Element updated = objproduct.produpdatedheading;

            Assert.IsTrue(updated.InnerText.Contains("Updated"));
        }
Ejemplo n.º 19
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     enable_button(1);
     button = "Edit";
     client = new ObjProduct(txtProductCode.Text, txtTypeCode.Text, txtProviderCode.Text, txtProductName.Text, txtImportPrice.Text, txtSalePrice.Text, txtUnit.Text);
 }
Ejemplo n.º 20
0
 public DataSet getDataBase(ObjProduct client)
 {
     return(Connection.Instance.getData("SELECT * FROM" + nameOfTable + "WHERE MaSP = '" + client.Productcode + "'"));
 }
Ejemplo n.º 21
0
 public void editDataBase(ObjProduct client_initial, ObjProduct client_edited)
 {
     Connection.Instance.setData("UPDATE" + nameOfTable + "SET MaSP = '" + client_edited.Productcode + "', MaLoai = '" + client_edited.Typecode + "', MaNguon = '" + client_edited.Providercode + "', TenSP = N'" + client_edited.Name + "', GiaNhap = " + client_edited.Importprice + ", " + "GiaBan = " + client_edited.Saleprice + ", DonViTinh = '" + client_edited.Unit + "' WHERE MaSP = '" + client_initial.Productcode + "';");
     return;
 }