Ejemplo n.º 1
0
        private void btnadd_Click(object sender, EventArgs e)
        {
            _InventoryOutsHeader = new Entities.InventoryOutsHeader
            {
                InventoryId = (int)comboInventory.SelectedValue,
                TypeId      = (int)combotype.SelectedValue,
                Title       = txttitle.Text,
                Description = txtdsc.Text,
                Date        = DateTime.Now,
            };
            int result = invh.AddReturnId(_InventoryOutsHeader);

            if (result == 0)
            {
                MessageBox.Show("مشکل در ثبت به وجود امد", "پیام سیستم");
            }
            else
            {
                foreach (var item in ListDeatil)
                {
                    item.InventoryOutsHeaderId = result;
                    if (!invd.Add(item))
                    {
                        MessageBox.Show("مشکل در ثبت به وجود امد", "پیام سیستم");
                        break;
                    }
                }
                MessageBox.Show("با موفقیت ثبت شد", "پیام سیستم");
            }
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 2
0
        public void AddInventoryOutsDeatilTest()
        {
            var result = _InventoryOutsDeatil.Add(EInventoryOutsDeatil);

            Assert.AreEqual(false, result);
        }