Exemple #1
0
 protected override void OnRunStarted()
 {
     base.OnRunStarted();
     Items.AddNew <MainController>();
     ProcessCommandMap();
     Activate();
 }
Exemple #2
0
        protected override void OnRunStarted()
        {
            base.OnRunStarted();
            IWorkspace workspace = Workspaces["MainWorkspace"];

            workspace.Show(Items.AddNew <GPSView>());
        }
        public void ShowEntityDetails <T>(EntityDetailWorkingMode workingMode, string entityName, Guid id) where T : AbstractDetailView
        {
            string key = id + entityName + ":DetailWorkItem";

            var detailWorkItem = Items.Get <EnityDetailController <T> >(key);

            if (detailWorkItem == null)
            {
                detailWorkItem            = Items.AddNew <EnityDetailController <T> >(key);
                detailWorkItem.EntityName = entityName;
                detailWorkItem.Initialize();
            }
            if (workingMode == EntityDetailWorkingMode.Convert)
            {
                detailWorkItem.State["ConvertEntiy"] = _entityListView.SelectedEntity;
                detailWorkItem.State["ConvertName"]  = EntityName;
            }
            detailWorkItem.State["EntityId"]    = id;
            detailWorkItem.State["WorkingMode"] = workingMode;
            detailWorkItem.Run();
            if (detailWorkItem.View == null)
            {
                return;
            }
            detailWorkItem.View.Context = _entityListView.Context;
        }
        public void Show(IWorkspace parentWorkspace)
        {
            customerSummaryView = customerSummaryView ?? Items.AddNew <CustomerSummaryView>();

            AddMenuItems();

            var customer = (BankTellerCommon.Customer)State[WorkItemStates.Customer];

            OnStatusTextUpdate(string.Format("Editing {0}, {1}", customer.LastName, customer.FirstName));
            var smartPartInfo = new XtraWindowSmartPartInfo
            {
                Title = (customer.LastName + " " + customer.FirstName)
            };

            //customerSummaryView.Dock = DockStyle.Fill;
            parentWorkspace.Show(customerSummaryView, smartPartInfo);

            UpdateUserAddressLabel(customer);

            Activate();
            parentWorkspace.SmartPartActivated += new EventHandler <WorkspaceEventArgs>(parentWorkspace_SmartPartActivated);

            // When activating, force focus on the first tab in the view.
            // Extensions may have added stuff at the end of the tab.
            customerSummaryView.FocusFirstTab();
        }
        private void CreateCommentsView()
        {
            commentsView = commentsView ?? Items.AddNew <CustomerCommentsView>();
            ISmartPartInfo info = new TabSmartPartInfo();

            info.Title = "Comments";
            RegisterSmartPartInfo(commentsView, info);
        }
Exemple #6
0
        public string AddNewMessage(string notifyTime, string channelName, string machineName, string appDomainFriendlyName, string parentEntryID, string message, bool showTime, bool showMachine, bool showAppDomain)
        {
            string newEntryID = Items.AddNew(channelName, machineName, appDomainFriendlyName, notifyTime, message, parentEntryID);

            if (Host.IsCurrentlyVisible(this))
            {
                UpdateDisplayContent(showTime, showMachine, showAppDomain);
            }
            return(newEntryID);
        }
Exemple #7
0
        protected override void OnRunStarted()
        {
            var key  = "OpportunityReportView";
            var view = Items.Get <OpportunityReportView>(key);

            if (view == null)
            {
                view = Items.AddNew <OpportunityReportView>(key);
            }
            Workspaces[WorkspaceNames.ShellContentWorkspace].Show(view);
        }
Exemple #8
0
 public void Show(IWorkspace parentWorkspace)
 {
     m_smartPart            = new WindowSmartPartInfo();
     m_smartPart.ControlBox = true;
     m_smartPart.Location   = pos;
     m_smartPart.Title      = "Registration form";
     pos = Point.Add(pos, new Size(100, 100));
     m_RegisterFormView = Items.AddNew <RegistrationViewForm>();
     parentWorkspace.Show(m_RegisterFormView, m_smartPart);
     this.Activate();
 }
Exemple #9
0
 public void Show(IWorkspace parentWorkspace)
 {
     m_smartPart            = new WindowSmartPartInfo();
     m_smartPart.ControlBox = true;
     m_smartPart.Location   = pos;
     m_smartPart.Title      = "List Screen";
     pos            = Point.Add(pos, new Size(100, 100));
     m_ListFormView = Items.AddNew <ListViewScreen>();
     parentWorkspace.Show(m_ListFormView, m_smartPart);
     this.Activate();
 }
        protected virtual void InitViewList()
        {
            if (_entityListView == null)
            {
                _entityListView = Items.AddNew <TListView>();
                _entityListView.InitEntityView(EntityName);
            }

            object startView = GetStartView();

            Workspaces[WorkspaceNames.ShellContentWorkspace].Show(startView);
        }
        private void CreateCommentsView()
        {
            commentsView = commentsView ?? Items.AddNew <CustomerCommentsView>();
            var info = new XtraTabSmartPartInfo
            {
                Title          = "Title",
                Text           = "Comments",
                PageHeaderFont = new Font("Comic Sans MS", 11.25F, FontStyle.Regular)
            };

            RegisterSmartPartInfo(commentsView, info);
        }
        public void OnFormat(object sender, EventArgs e)
        {
            string key = EntityName + ":FormatConditionList";
            var    formatConditionListView = Items.Get <FormatConditionList>(key);

            if (formatConditionListView == null)
            {
                formatConditionListView = Items.AddNew <FormatConditionList>(key);
            }
            formatConditionListView.EntityTypeName = EntityName;
            formatConditionListView.SetGridView(_entityListView.EntityGridView);
            formatConditionListView.ShowDialog();
        }
Exemple #13
0
 protected override object GetStartView()
 {
     if (_isShowChart)
     {
         ProjectTaskChartView chartView = Items.Get <ProjectTaskChartView>("ChartView");
         if (chartView == null)
         {
             chartView         = Items.AddNew <ProjectTaskChartView>("ChartView");
             chartView.Context = _entityListView.Context;
         }
         return(chartView);
     }
     return(base.GetStartView());
 }
Exemple #14
0
        public void OnNewProjectTaskEffort(object sender, EventArgs e)
        {
            string key = Guid.Empty + ":DetailWorkItem";

            var detailWorkItem = Items.Get <RecordDetailController <NewTaskEffortDetailView> >(key);

            if (detailWorkItem == null)
            {
                detailWorkItem            = Items.AddNew <RecordDetailController <NewTaskEffortDetailView> >(key);
                detailWorkItem.EntityName = "NewProjectTaskEffort";
                detailWorkItem.Initialize();
            }
            detailWorkItem.State["EntityId"]    = Guid.Empty;
            detailWorkItem.State["WorkingMode"] = EntityDetailWorkingMode.Edit;
            detailWorkItem.Run();
        }
Exemple #15
0
        private void ShowDetailView()
        {
            const string key = "Details";

            _view = Items.Get <TView>(key);
            if (_view == null)
            {
                _view = Items.AddNew <TView>(key);
                _view.TurnOnChangeTracker();
            }
            var info = new XtraTabSmartPartInfo {
                Title = EntityName
            };

            Workspaces[WorkspaceNames.DetailContentWorkspace].Show(_view, info);
        }
Exemple #16
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Items itm = new Items();

            if (_itemId != 0)
            {
                itm.LoadByPrimaryKey(_itemId);
            }
            else
            {
                itm.AddNew();
                itm.IsInHospitalList = true;
            }
            itm.IINID = Convert.ToInt32(cboIIN.EditValue);
            //itm.StockCode = txtCatCode.Text + "-" + txtStockCode.Text;
            itm.StockCode    = txtStockCode.Text;
            itm.Strength     = txtStrength.Text;
            itm.DosageFormID = Convert.ToInt32(cboDosageForm.EditValue);
            //itm.IsDiscontinued = false;
            //itm.IsFree = ckIsFree.Checked;
            //itm.EDL = ckIsEDL.Checked;
            itm.UnitID          = Convert.ToInt32(cboUnit.EditValue);
            itm.NeedExpiryBatch = ckNeedExp.Checked;
            //itm.Pediatric = ckIsPedatric.Checked;
            //itm.Refrigeratored = ckIsRefrigerated.Checked;

            itm.Save();

            ItemSupplyCategory prodCate = new ItemSupplyCategory();

            //int catId = Convert.ToInt32(lstC.Tag);
            if (_categoryId != 0)
            {
                if (!prodCate.CategoryExists(itm.ID, _categoryId))
                {
                    prodCate.AddNew();
                    prodCate.ItemID     = itm.ID;
                    prodCate.CategoryID = _categoryId;
                    prodCate.Save();
                }
            }

            XtraMessageBox.Show("Supply is Saved Successfully!", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Close();
        }
        public void Show(IWorkspace parentWorkspace)
        {
            customerSummaryView = customerSummaryView ?? Items.AddNew <CustomerSummaryView>();
            parentWorkspace.Show(customerSummaryView);

            AddMenuItems();

            Customer customer = (Customer)State[StateConstants.CUSTOMER];

            OnStatusTextUpdate(string.Format("Editing {0}, {1}", customer.LastName, customer.FirstName));

            UpdateUserAddressLabel(customer);

            this.Activate();

            // When activating, force focus on the first tab in the view.
            // Extensions may have added stuff at the end of the tab.
            customerSummaryView.FocusFirstTab();
        }
Exemple #18
0
        public virtual void Initialize()
        {
            _userDataPersistenceService = new UserDataPersistenceService(EntityName + "Detail");
            Services.Add(_userDataPersistenceService);
            _detailLayoutView            = Items.AddNew <DetailLayoutView>();
            _detailLayoutView.EntityName = EntityName;

            var homePage =
                UIExtensionSites[ExtensionSiteNames.DetailRibbon].Add(new RibbonPage(GetLocalizedCaption("Home")));

            UIExtensionSites.RegisterSite("DetailHomePage", homePage);
            var generalGroup =
                UIExtensionSites["DetailHomePage"].Add(new RibbonPageGroup(GetLocalizedCaption("General")));

            UIExtensionSites.RegisterSite("DetailGeneralPageGroup", generalGroup);
            RegisterGenearlCommand("SaveAndClose", "Save", "Exit");
            RegisterGenearlCommand("Save", "Save", null);
            RegisterGenearlCommand("DetailGeneralPageGroup", "EditMode", "Edit", null, "Edit");
        }
Exemple #19
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Items itm = new Items();

            if (_itemId != 0)
            {
                itm.LoadByPrimaryKey(_itemId);
            }
            else
            {
                itm.AddNew();
                itm.IsInHospitalList = true;

                Items itms = new Items();
                itm.ID                = itms.GetNextItemID();
                itm.StorageTypeID     = 1;
                itm.NearExpiryTrigger = 0;
            }
            itm.IINID = Convert.ToInt32(cboIIN.SelectedValue);

            //itm.StockCode = txtCatCode.Text + "-" + txtStockCode.Text;
            itm.StockCode       = txtStockCode.Text;
            itm.Code            = txtStock2.Text;
            itm.StockCodeDACA   = txtStock3.Text;
            itm.Strength        = txtStrength.Text;
            itm.DosageFormID    = Convert.ToInt32(cboDosageForm.SelectedValue);
            itm.IsDiscontinued  = ckIsDiscontinued.Checked;
            itm.IsFree          = ckIsFree.Checked;
            itm.EDL             = ckIsEDL.Checked;
            itm.UnitID          = Convert.ToInt32(cboUnit.SelectedValue);
            itm.Pediatric       = ckIsPedatric.Checked;
            itm.Refrigeratored  = ckIsRefrigerated.Checked;
            itm.NeedExpiryBatch = true;
            itm.Save();

            ProductsCategory prodCate = new ProductsCategory();

            foreach (ListViewItem lstC in lstCat.Items)
            {
                int catId = Convert.ToInt32(lstC.Tag);

                if (prodCate.CategoryExists(itm.ID, catId))
                {
                    continue;
                }

                prodCate.AddNew();
                prodCate.ItemId        = itm.ID;
                prodCate.SubCategoryID = catId;
                prodCate.Save();
            }

            if (itm.IsColumnNull("StockCode"))
            {
                // Update the Stock Code

                prodCate.Rewind();
                SubCategory sc = new SubCategory();
                sc.LoadByPrimaryKey(prodCate.SubCategoryID);

                if (sc.RowCount > 0)
                {
                    itm.StockCode = string.Format("{0}.{1}.{2}.{3}", sc.SubCategoryCode, 1, itm.DosageFormID, 1);
                    itm.Save();
                }
            }
            XtraMessageBox.Show("Item is Saved Successfully!", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);

            this.Close();
        }
Exemple #20
0
        /// <summary>
        /// See <see cref="M:Microsoft.Practices.ObjectBuilder.IBuilderAware.OnBuiltUp(System.String)"/> for more information.
        /// </summary>
        public override void OnBuiltUp(string id)
        {
            base.OnBuiltUp(id);

            controller = Items.AddNew <TController>();
        }
Exemple #21
0
        /// <summary>
        /// Saves the item policy
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            var itm    = new Items();
            var itmSup = new ItemSupplier();

            if (_itemId != 0)
            {
                itm.LoadByPrimaryKey(_itemId);
            }
            else
            {
                itm.AddNew();
                var prodCate = new ProductsCategory();
                prodCate.AddNew();
                prodCate.ItemId        = itm.ID;
                prodCate.SubCategoryID = Convert.ToInt32(_categoryId);
                prodCate.Save();
            }
            //if (rdA.Checked || rdB.Checked || rdC.Checked)
            //    itm.ABC = ((rdA.Checked) ? 1 : (rdB.Checked) ? 2 : 3);

            //if (rdV.Checked || rdE.Checked || rdN.Checked)
            //    itm.VEN = ((rdV.Checked) ? 1 : (rdE.Checked) ? 2 : 3);

            itm.IsInHospitalList = ckExculed.Checked;
            //itm.NeedExpiryBatch = chkNeedExpiryBatch.Checked;

            string valid = ValidateFields();

            if (valid == "true")
            {
                itm.NeedExpiryBatch = chkNeedExpiryBatch.Checked;
                itm.Pediatric       = chkIsVaccine.Checked; //wrong coulmn name but used to identify the vaccine items
                itm.StockCodeDACA   = txtText.Text;
                itm.Cost            = txtQuantityPerPack.Text;
                itm.Save();
            }

            else
            {
                XtraMessageBox.Show(valid, "Validation", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }


            //TODO: To add categories
            //Needs some modification on edit


            // this will only add the suppliers
            //do some thing on edit

            itmSup.DeleteAllSupForItem(itm.ID);
            Supplier sup = new Supplier();

            foreach (object t in lstSuppliers.CheckedItems)
            {
                sup.GetSupplierByName(t.ToString());
                itmSup.AddNew();
                itmSup.ItemID     = itm.ID;
                itmSup.SupplierID = sup.ID;
                itmSup.Save();
            }

            var progItm = new ProgramProduct();

            progItm.DeleteAllProgramsForItem(_itemId);

            var prog = new Programs();

            //prog.AddNew();
            //prog.Name = cboPrograms.Text;
            //prog.Save();

            //foreach (object t in lstPrograms.CheckedItems)
            //{
            //    prog.GetProgramByName(t.ToString());
            //    progItm.AddNew();
            //    progItm.ItemID = itm.ID;
            //    progItm.ProgramID = prog.ID;
            //    progItm.StoreID = (progItm.ProgramID == 1000) ? 8 : 9;
            //    progItm.Save();
            //}
            if (rdSubProgram.EditValue != null)
            {
                progItm.AddNew();
                progItm.ItemID    = itm.ID;
                progItm.ProgramID = Convert.ToInt32(rdSubProgram.EditValue);
                progItm.StoreID   = 9;
                progItm.Save();
            }


            var duItem = new DUsItemList();
            var dus    = new ReceivingUnits();

            foreach (object t in lstDUs.CheckedItems)
            {
                dus.GetDUByName(t.ToString());
                duItem.AddNew();
                duItem.DUID   = dus.ID;
                duItem.ItemID = _itemId;
                try
                {
                    duItem.Save();
                }
                catch
                {
                }
            }

            XtraMessageBox.Show("Item Detail is Saved Successfully!", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Close();
        }
        private void InitLoginUser(RibbonControl Ribbon)
        {
            //??CLEAR SET
            if (RootWorkItem.State["hasAddBarStaticItem"] == null)
            {
                RootWorkItem.State["hasAddBarStaticItem"] = true;
                var clearSettingButton = new BarButtonItem();
                clearSettingButton.Caption    = Resources.ClearSetting;
                clearSettingButton.Glyph      = (Bitmap)Resources.ResourceManager.GetObject("ri_clear");
                clearSettingButton.ItemClick += delegate
                {
                    string message = Resources.ClearSettingConfirm;
                    var    result  = XtraMessageBox.Show(message, Properties.Resources.Katrin, MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                    if (result == DialogResult.OK)
                    {
                        var stateFiles = Directory.GetFiles(Application.StartupPath, "*.state");
                        foreach (var stateFile in stateFiles)
                        {
                            File.Delete(stateFile);
                        }
                    }
                };
                Ribbon.Items.Add(clearSettingButton);
                ApplicationMenu pmAppMain = Ribbon.ApplicationButtonDropDownControl as ApplicationMenu;
                if (pmAppMain != null)
                {
                    pmAppMain.ItemLinks.Add(clearSettingButton);
                }

                //set logined user full name
                var _fullNameItem = new BarStaticItem();
                _fullNameItem.Caption = AuthorizationManager.FullName;
                Ribbon.Items.Add(_fullNameItem);
                _fullNameItem.ItemClick += (s, e) => ShowRelatedEntityDetail("User", AuthorizationManager.CurrentUserId);
                _fullNameItem.Glyph      = (System.Drawing.Bitmap)Properties.Resources.ResourceManager.GetObject("userinfo");
                Ribbon.PageHeaderItemLinks.AddRange(new BarItem[] { _fullNameItem });

                var notificationItem = new BarStaticItem();
                notificationItem.Caption = Properties.Resources.Notification;
                Ribbon.Items.Add(notificationItem);
                notificationItem.ItemClick += (s, e) =>
                {
                    string notificationKey = "NotificationListView";
                    var    detailWorkItem  = Items.Get <WorkItem>(notificationKey);
                    if (detailWorkItem == null)
                    {
                        detailWorkItem = Items.AddNew <WorkItem>(notificationKey);
                    }
                    detailWorkItem.Run();
                    var notificationListView = detailWorkItem.Items.Get <NotificationList>(notificationKey);
                    if (notificationListView != null)
                    {
                        detailWorkItem.Items.Remove(notificationListView);
                    }
                    notificationListView = detailWorkItem.Items.AddNew <NotificationList>(notificationKey);
                    var info = new XtraWindowSmartPartInfo {
                        Size = new Size(850, 400), StartPosition = FormStartPosition.CenterParent, Icon = Properties.Resources.ri_Katrin, Modal = true, Title = Properties.Resources.Notification + "   "
                    };
                    detailWorkItem.Workspaces[WorkspaceNames.ModalWindows].Show(notificationListView, info);
                };
                notificationItem.Glyph = (System.Drawing.Bitmap)Properties.Resources.ResourceManager.GetObject("notificationb");
                Ribbon.PageHeaderItemLinks.AddRange(new BarItem[] { notificationItem });

                //send sys msg
                var sysMsgItem = new BarStaticItem();
                sysMsgItem.Caption = Properties.Resources.SendSysMessage;
                Ribbon.Items.Add(sysMsgItem);
                sysMsgItem.ItemClick += (s, e) =>
                {
                    string sysMsgKey      = "SendSysMsg";
                    var    detailWorkItem = Items.Get <WorkItem>(sysMsgKey);
                    if (detailWorkItem == null)
                    {
                        detailWorkItem = Items.AddNew <WorkItem>(sysMsgKey);
                    }
                    detailWorkItem.Run();
                    var sysMsgView = detailWorkItem.Items.Get <SendSysNotification>(sysMsgKey);
                    if (sysMsgView != null)
                    {
                        detailWorkItem.Items.Remove(sysMsgView);
                    }
                    sysMsgView = detailWorkItem.Items.AddNew <SendSysNotification>(sysMsgKey);
                    var info = new XtraWindowSmartPartInfo {
                        StartPosition = FormStartPosition.CenterParent, Icon = Properties.Resources.ri_Katrin, Modal = true, Title = Properties.Resources.SendSysMessage
                    };
                    detailWorkItem.Workspaces[WorkspaceNames.ModalWindows].Show(sysMsgView, info);
                };
                sysMsgItem.Glyph = (System.Drawing.Bitmap)Properties.Resources.ResourceManager.GetObject("sendsysmsg");
                Ribbon.PageHeaderItemLinks.AddRange(new BarItem[] { sysMsgItem });
            }
        }