Exemple #1
0
 public Form1()
 {
     InitializeComponent();
     TypesRegistry = new IOC.TypesResgistry();
 }
Exemple #2
0
        public MainForm()
        {
            InitializeComponent();
            Setstatus("وضعیت : در حال بار گذاری");
            TypesRegistry = new IOC.TypesResgistry();
            var menu = addmenu("اطلاعات پایه", null, Keys.None, null);


            var menuBaseInfo = menu.addmenu("شرکت", null, Keys.None, (obj, e) => viewEngine.ViewInForm <view.Corporation.List>(null, true));

            menuBaseInfo = menu.addmenu("انبار", null, Keys.None, (obj, e) => viewEngine.ViewInForm <view.Inventory.List>(null, true));

            var menuProdocut = menu.addmenu("محصولات", null, Keys.None, null);

            menuProdocut.addmenu("محصولات", null, Keys.None, (obj, e) => viewEngine.ViewInForm <view.Product.List>(null, true));
            menuProdocut.addSeparator();
            menuProdocut.addmenu("واحداندازه گیری", null, Keys.None, (obj, e) => viewEngine.ViewInForm <view.ProductUnit.List>(null, true));
            menuProdocut.addmenu("دسته بندی محصولات", null, Keys.None, (obj, e) => viewEngine.ViewInForm <view.Category.List>(null, true));

            var menuRepoType = menu.addmenu("رسید", null, Keys.None, null);

            menuRepoType.addmenu("تعریف نوع رسید ورودی", null, Keys.None, (obj, e) =>
            {
                viewEngine.ViewInForm <view.InventoryInsType.List>(null, true);
            });
            menuRepoType.addmenu("تعریف نوع رسید خروجی", null, Keys.None, (obj, e) =>
            {
                viewEngine.ViewInForm <view.InventoryOutsType.List>(null, true);
            });

            menu.addSeparator();
            menu.addmenu("خروج", null, Keys.None, (obj, e) => Application.Exit());


            var menu1 = addmenu("عملیات", null, Keys.None, null);

            menu1.addmenu("ورودکالا", null, Keys.None, (obj, e) =>
            {
                view.InventoryInsHeader.InventoryInsHeader IH = new view.InventoryInsHeader.InventoryInsHeader();
                if (IH.ShowDialog() == DialogResult.OK)
                {
                    grid.AddItem(new QueueDetials()
                    {
                        InventoryInsHeaderId = IH._InventoryInsHeader.InventoryInsHeaderId,
                        InventoryType        = 0,
                        Date        = DateTime.Now,
                        Title       = IH._InventoryInsHeader.Title,
                        TypeId      = IH._InventoryInsHeader.TypeId,
                        InventoryId = IH._InventoryInsHeader.InventoryId,
                    });
                    grid.ResetBindings();
                }
            });

            menu1.addmenu("خروج کالا", null, Keys.None, (obj, e) =>
            {
                view.InventoryOutsHeader.InventoryOutsHeader IH = new view.InventoryOutsHeader.InventoryOutsHeader();
                if (IH.ShowDialog() == DialogResult.OK)
                {
                    var entity = new QueueDetials()
                    {
                        InventoryInsHeaderId = IH._InventoryOutsHeader.InventoryOutsHeaderId,
                        InventoryType        = 1,
                        Date        = DateTime.Now,
                        Title       = IH._InventoryOutsHeader.Title,
                        TypeId      = IH._InventoryOutsHeader.TypeId,
                        InventoryId = IH._InventoryOutsHeader.InventoryId,
                    };
                    grid.AddItem(entity);
                    grid.ResetBindings();
                }
            });

            var menu2 = addmenu("گزارش", null, Keys.None, null);

            menu2.addmenu("انبار", null, Keys.None, (obj, e) =>
            {
                view.Inventory.InventoryReport ir = new view.Inventory.InventoryReport();
                ir.ShowDialog();
            });
            menu2.addmenu("ورود کالا", null, Keys.None, (obj, e) => viewEngine.ViewInForm <view.InventoryInsHeader.List>(null, true));
            menu2.addmenu("خروج کالا", null, Keys.None, (obj, e) => viewEngine.ViewInForm <view.InventoryOutsHeader.List>(null, true));
        }