Esempio n. 1
0
 public InventoryInsHeader()
 {
     pro    = new Repositories.ProductRepository();
     invs   = new Repositories.InventoryRepository();
     type   = new Repositories.InventoryInsTypeRepository();
     invh   = new Repositories.InventoryInsHeaderRepository();
     invd   = new Repositories.InventoryInsDeatilRepository();
     ProCat = new Repositories.ProductCategoryRepository();
     InitializeComponent();
 }
Esempio n. 2
0
        public ListDeatil(int id, int IsOut)
        {
            InitializeComponent();
            this.Id    = id;
            this.IsOut = IsOut;

            pro  = new Repositories.ProductRepository();
            inv  = new Repositories.InventoryRepository();
            ind  = new Repositories.InventoryInsDeatilRepository();
            inh  = new Repositories.InventoryInsHeaderRepository();
            outd = new Repositories.InventoryOutsDeatilRepository();
            outh = new Repositories.InventoryOutsHeaderRepository();
            inT  = new Repositories.InventoryInsTypeRepository();
            outT = new Repositories.InventoryOutsTypeRepository();
        }
Esempio n. 3
0
        public InventoryInsHeaderRepositoryTests()
        {
            var contaxt     = new DataLayer.InventoryDBContext();
            var relateduser = contaxt.Users.FirstOrDefault(u => u.Username.Equals("admin"));
            var identity    = new GenericIdentity(relateduser.Username);
            var roles       = relateduser.Roles.Select(p => p.Title).ToArray();
            var principal   = new GenericPrincipal(identity, roles);

            System.Threading.Thread.CurrentPrincipal = principal;
            _InventoryInsHeader = new Repositories.InventoryInsHeaderRepository();
            EInventoryInsHeader = new Entities.InventoryInsHeader()
            {
                InventoryId = 1,
                TypeId      = 1,
                Title       = "Title",
                Description = "Description",
            };
        }
Esempio n. 4
0
 public List(RepositortAbstracts.IInventoryInsHeader InventoryInsHeaderRepository, RepositortAbstracts.IInventoryInsDeatil invd)
 {
     this.Invs = InventoryInsHeaderRepository;
     this.invd = invd;
 }
Esempio n. 5
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            inh  = new Repositories.InventoryInsHeaderRepository();
            outh = new Repositories.InventoryOutsHeaderRepository();
            grid = new Framwork.GirdControl <QueueDetials>(_panel);
            grid.AddTextBoxColumn(p => p.InventoryInsHeaderId, "شناسه");
            grid.AddTextBoxColumn(p => p.Title, "عنوان");
            grid.AddTextBoxColumn(p => p.TypeId, "نوع رسید");
            grid.AddTextBoxColumn(p => p.InventoryType, "ورودی / خروجی");
            grid.AddTextBoxColumn(p => p.Date, "تاریخ");
            grid.AddButtonColumn("جزییات", row =>
            {
                Setstatus("وضعیت : در حال پردازش");
                view.InventoryInsDeatil.ListDeatil ld = new view.InventoryInsDeatil.ListDeatil((int)row.Cells[0].Value, (int)row.Cells[3].Value);
                ld.ShowDialog();
                Setstatus("وضعیت : آماده استفاده");
            });
            grid.AddButtonColumn("تایید", row =>
            {
                Setstatus("وضعیت : در حال پردازش");
                switch ((int)row.Cells[3].Value)
                {
                case 0:
                    {
                        if (inh.Accept((int)row.Cells[0].Value))
                        {
                            grid.RemoveCurrent();
                            grid.ResetBindings();
                            MessageBox.Show("با موفقیت انجام شد", "پیام سیستم");
                        }
                        else
                        {
                            MessageBox.Show("مشکل در تایید", "پیام سیستم");
                        }
                        break;
                    }

                case 1:
                    {
                        if (outh.Accept((int)row.Cells[0].Value))
                        {
                            grid.RemoveCurrent();
                            grid.ResetBindings();
                            MessageBox.Show("با موفقیت انجام شد", "پیام سیستم");
                        }
                        else
                        {
                            MessageBox.Show("مشکل در تایید", "پیام سیستم");
                        }
                        break;
                    }

                default:
                    {
                        MessageBox.Show("مشکل در تایید", "پیام سیستم");
                        break;
                    }
                }

                Setstatus("وضعیت : آماده استفاده");
            });
            load();
            Setstatus("وضعیت : آماده استفاده");
        }