示例#1
0
        public void CanCreateStock()
        {
            const string stock2  = "stock2";
            var          wilaya  = new RepositoryWilaya().FindAll().First(w => w.Name == "Tlemcen");
            var          commune = new RepositoryWilaya().FindAll().First(w => w.Name == "Tlemcen").Communes.First(com => com.Name == "Tlemcen");
            const string adresse = "S3 lot Sekkal el Kiffane";
            var          stock   = FactoryStock.CreateStock(stock2, wilaya, commune, adresse);
            var          rs      = new RepositoryStock();

            rs.Save(stock);
            rs.Remove(stock);
        }
示例#2
0
        private void DeleteStock()
        {
            DialogResult result = XtraMessageBox.Show(this, TagResources.DeleteQuestion, Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation);

            if (result != DialogResult.Yes)
            {
                return;
            }
            if (gridViewStock == null)
            {
                return;
            }
            var idstock = (Guid)gridViewStock.GetFocusedRowCellValue("Id");

            _repositoryStock.Remove(idstock);
            var stock = new ModelViewStock();

            Mail_Load(stock, new EventArgs());
        }