コード例 #1
0
ファイル: IntegrationManager.cs プロジェクト: leonchen09/poc
        /// <summary>
        /// remove internal bookmark item out of internal bookmark object
        /// </summary>
        /// <param name="key"></param>
        public void RemoveInternalBookmarkItem(string key)
        {
            ManagerProfile mgrPro = Wkl.MainCtrl.ManagerCtrl.GetProfile(key);

            GetInternalBookmark(key);
            CurrentTemplateInfo.InternalBookmark.RemoveInternalBookmarkItem(mgrPro.WbmKey);
        }
コード例 #2
0
        public ActionResult RegisterManager(RegisterModel model)
        {
            if (ModelState.IsValid)
            {
                string          userRole = "manager";
                ApplicationRole role     = RoleManager.FindByName(userRole);
                ApplicationUser user     = new ApplicationUser {
                    Email = model.Email, UserName = model.UserName
                };
                Microsoft.AspNet.Identity.IdentityResult result = UserManager.Create(user, model.Password);
                if (result.Succeeded)
                {
                    UserManager.AddToRole(user.Id, role.Name);
                    ManagerProfile profile = new ManagerProfile {
                        Id = user.Id
                    };
                    _managerProfileDataSource.AddManagerProfileAsync(profile);

                    logger.Info("Был зарегистрирован новый менеджер");

                    return(RedirectToAction("Index", "Home"));
                }
                else
                {
                    foreach (string error in result.Errors)
                    {
                        ModelState.AddModelError("", error);
                    }
                }
            }
            return(View(model));
        }
コード例 #3
0
        /// <summary>
        /// Delete a bookmark with name in current document
        /// </summary>
        /// <param name="name">Name of bookmark</param>
        /// <returns></returns>
        public bool DeleteBookmark(string key)
        {
            ManagerProfile mgrProfile = Wkl.MainCtrl.ManagerCtrl.GetProfile(key);

            try
            {
                foreach (Bookmark bookmark in Wkl.MainCtrl.CommonCtrl.CommonProfile.Bookmarks)
                {
                    if (bookmark.Name.Equals(mgrProfile.DeletedBookmarkName))
                    {
                        DeleteBookmark(bookmark, mgrProfile.DeleteWholeBookmark);
                        break;
                    }
                }

                return(true);
            }
            catch (System.Exception ex)
            {
                ManagerException mgrExp = new ManagerException(ErrorCode.ipe_DeleteBookmarkError,
                                                               MessageUtils.Expand(Properties.Resources.ipe_DeleteBookmarkError, ex.Message), ex.StackTrace);

                throw mgrExp;
            }
        }
コード例 #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            ManagerProfile m = new ManagerProfile();

            this.Hide();
            m.Show();
        }
コード例 #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox4.Text == "")
            {
                MessageBox.Show("Please select any salesman...");
                GridUpdate();
            }
            else
            {
                DialogResult res = MessageBox.Show("Are You Sure?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (res.Equals(DialogResult.Yes))
                {
                    string id = textBox4.Text;
                    if (s.DeleteSalesman(id))
                    {
                        GridUpdate();
                        MessageBox.Show("Successfully deleted");
                        ManagerProfile m = new ManagerProfile();
                        this.Hide();
                        m.Show();
                    }
                }

                else
                {
                    dataGridView1.DataSource = s.GetAllSalesman();
                }
            }
            textBox4.Text = string.Empty;
        }
コード例 #6
0
        public void RemoveBookmark(string key)
        {
            try
            {
                ManagerProfile mgrPro = Wkl.MainCtrl.ManagerCtrl.GetProfile(key);

                foreach (string bmKey in mgrPro.WbmKeys)
                {
                    if (_doc.Bookmarks.Exists(bmKey))
                    {
                        _doc.Bookmarks[bmKey].Range.HighlightColorIndex = ProntoMarkup.BackgroundUnHighLight;
                        _doc.Bookmarks[bmKey].Delete();
                    }

                    iBm.RemoveInternalBookmarkItem(bmKey);
                }
            }
            catch (BaseException baseExp)
            {
                ManagerException mgrExp = new ManagerException(ErrorCode.ipe_RemoveBookmarkError);
                mgrExp.Errors.Add(baseExp);

                throw mgrExp;
            }
            catch (System.Exception ex)
            {
                ManagerException mgrExp = new ManagerException(ErrorCode.ipe_RemoveBookmarkError,
                                                               MessageUtils.Expand(Properties.Resources.ipe_DeleteBookmarkError, ex.Message), ex.StackTrace);

                throw mgrExp;
            }
        }
コード例 #7
0
        /// <summary>
        /// Move cursor to [left] or [right] with [count] characters
        /// </summary>
        /// <param name="count">Number of characters</param>
        /// <param name="isLeft">true if go the left</param>
        public void MoveCharacters(string key)
        {
            ManagerProfile mgrProfile = Wkl.MainCtrl.ManagerCtrl.GetProfile(key);

            if (mgrProfile.MoveChars_IsExtend == null || !mgrProfile.MoveChars_IsExtend.Value)
            {
                if (mgrProfile.MoveChars_IsLeft)
                {
                    CommonProfile.CurrentSelection.MoveLeft(WdUnits.wdCharacter, mgrProfile.MoveChars_Count);
                }
                else
                {
                    CommonProfile.CurrentSelection.MoveRight(WdUnits.wdCharacter, mgrProfile.MoveChars_Count);
                }
            }
            else
            {
                if (mgrProfile.MoveChars_IsLeft)
                {
                    CommonProfile.CurrentSelection.MoveLeft(WdUnits.wdCharacter, mgrProfile.MoveChars_Count, WdMovementType.wdExtend);
                }
                else
                {
                    CommonProfile.CurrentSelection.MoveRight(WdUnits.wdCharacter, mgrProfile.MoveChars_Count, WdMovementType.wdExtend);
                }
            }
        }
コード例 #8
0
        /// <summary>
        /// Move cursor to [left] or [right] with [count] characters
        /// </summary>
        /// <param name="count">Number of characters</param>
        /// <param name="isLeft">true if go the left</param>
        /// <param name="isExtend">true if text is selected</param>
        private void MoveCharacters(int count, bool isLeft, bool isExtend)
        {
            string         key;
            ManagerProfile mgrProfile = Wkl.MainCtrl.ManagerCtrl.CreateProfile(out key);

            mgrProfile.MoveChars_Count  = count;
            mgrProfile.MoveChars_IsLeft = isLeft;
            if (isExtend)
            {
                if (isLeft)
                {
                    Wkl.MainCtrl.CommonCtrl.CommonProfile.CurrentSelection.MoveLeft(WdUnits.wdCharacter, count, WdMovementType.wdExtend);
                }
                else
                {
                    Wkl.MainCtrl.CommonCtrl.CommonProfile.CurrentSelection.MoveRight(WdUnits.wdCharacter, count, WdMovementType.wdExtend);
                }
            }
            else
            {
                MoveCharacters(key);
            }

            Wkl.MainCtrl.ManagerCtrl.RemoveDataObject(key);
        }
コード例 #9
0
        private void ShowManagerProfileWindow(ManagerProfile managerProfile, Panel owner)
        {
            owner.Visibility = Visibility.Collapsed;
            var callback = new Action <ManagerProfile>(x => { _managerProfiles.AddAndSave(x); });

            ManagerProfileTabControl.Children.Add(new ManagerProfileTabControl(managerProfile, owner, callback));
        }
コード例 #10
0
ファイル: ManagerController.cs プロジェクト: leonchen09/poc
        public ManagerProfile CreateProfile(string key)
        {
            ManagerProfile mgrPro = new ManagerProfile();

            AddDataObject(key, mgrPro);

            return(mgrPro);
        }
コード例 #11
0
ファイル: ManagerController.cs プロジェクト: leonchen09/poc
        public ManagerProfile CreateProfile(out string key)
        {
            ManagerProfile mgrPro = new ManagerProfile();

            key = AddDataObject(mgrPro);

            return(mgrPro);
        }
コード例 #12
0
        public ManagerProfileTabControl(ManagerProfile managerProfile, Panel owner, Action <ManagerProfile> saveCallback)
        {
            InitializeComponent();

            Init(managerProfile);
            CreateButtons(owner);
            _saveCallback = saveCallback;
        }
コード例 #13
0
ファイル: ContextManager.cs プロジェクト: leonchen09/poc
        /// <summary>
        /// Save a document
        /// </summary>
        /// <param name="Doc"></param>
        /// <param name="SaveAsUI"></param>
        /// <param name="Cancel"></param>
        public void SaveDocument(Document Doc, ref bool SaveAsUI, ref bool Cancel)
        {
            TemplateInfo tempInfo = Wkl.MainCtrl.CommonCtrl.GetTemplateInfo(Doc.FullName);

            if (tempInfo == null)
            {
                return;
            }

            if (!tempInfo.IsSaving)
            {
                string         mgrKey       = string.Empty;
                string         filePath     = Doc.FullName;
                bool           isAutoSaving = tempInfo.IsAutoSave;
                ManagerProfile mgrPro       = Wkl.MainCtrl.ManagerCtrl.CreateProfile(out mgrKey);
                mgrPro.TemplateType = MarkupUtilities.GetTemplateType(filePath);

                ContextValidator validator = new ContextValidator(Doc);
                validator.ValidateBeforeSave(mgrKey);

                tempInfo.IsAutoSave = true;
                Cancel   = true;
                SaveAsUI = false;

                if (!mgrPro.IsCorrect) // not AutoSave then we need to validate, check file path and prevent save event of word object
                {
                    if (!isAutoSaving)
                    {
                        tempInfo.IsSaving = false;
                        if (mgrPro.WbmKeys.Count == 0)
                        {
                            ShowPopupMessage(MessageUtils.Expand(Properties.Resources.ipe_NotIsProntoDoc, Properties.Resources.ipe_ValidateMessage));
                        }
                        else
                        {
                            mgrPro.WDoc = Doc;
                            Hcl.SaveMessageDialog saveNotify = new Hcl.SaveMessageDialog(mgrKey);
                            saveNotify.Show();
                        }
                    }

                    UpdateStatus(MessageUtils.Expand(Properties.Resources.ipm_NotIsProntoDoc, Properties.Resources.ipe_NotSaveMessage));
                }
                else
                {
                    if (!isAutoSaving && !File.Exists(filePath))
                    {
                        filePath = GetNewFileName();
                    }

                    Save(Doc, filePath);

                    SaveUserData();
                }

                Wkl.MainCtrl.ManagerCtrl.RemoveDataObject(mgrKey);
            }
        }
コード例 #14
0
        private void Init(ManagerProfile managerProfile)
        {
            if (managerProfile == null)
            {
                managerProfile = new ManagerProfile();
            }

            SetManagerProfileValues(managerProfile);
        }
コード例 #15
0
        public void SetFont(string key)
        {
            ManagerProfile mgrProfile = Wkl.MainCtrl.ManagerCtrl.GetProfile(key);

            if (mgrProfile != null && mgrProfile.WdColorIndex != null)
            {
                CommonProfile.CurrentSelection.Font.ColorIndex = mgrProfile.WdColorIndex;
            }
        }
コード例 #16
0
        private void Save()
        {
            var managerProfile = new ManagerProfile()
            {
                Name    = ProfileNameTextBox.Text,
                Created = DateTime.Now.ToMbmString()
            };

            _saveCallback(managerProfile);
        }
コード例 #17
0
        /* POCETNA STRANA MENADZERA
         * Ulogaovani menadzer, profil menadzera i u kom restoranu je on menadzer.
         */
        public ActionResult ManagerLogin()
        {
            ManagerProfile mp         = new ManagerProfile();
            string         idMenagera = Session["idMenadzera"].ToString();

            mp.menadzer  = db.MENADZERs.Where(z => z.IDMENADZERA == idMenagera).Single();
            mp.restoran  = db.RESTORANs.Where(z => z.ID_RESTORANA == mp.menadzer.ID_RESTORANA).Single();
            mp.jelovnici = db.JELOVNIKs.Where(x => x.ID_RESTORANA == mp.restoran.ID_RESTORANA).ToList();
            return(View(mp));
        }
コード例 #18
0
ファイル: MainService.cs プロジェクト: leonchen09/poc
        private void bmService_EnableComboboxDomain()
        {
            string         key    = string.Empty;
            ManagerProfile mgrPro = Wkl.MainCtrl.ManagerCtrl.CreateProfile(out key);

            mgrPro.ServiceType = ServiceType.ContentService;
            mgrPro.EventType   = EventType.EnableComboboxDomain;

            MainEvent(key);
            Wkl.MainCtrl.ManagerCtrl.RemoveDataObject(key);
        }
コード例 #19
0
ファイル: IntegrationManager.cs プロジェクト: leonchen09/poc
        public void AddInternalBookmarkItem(string key)
        {
            ManagerProfile         mgrPro    = Wkl.MainCtrl.ManagerCtrl.GetProfile(key);
            InternalBookmarkDomain ibmDomain = CurrentTemplateInfo.InternalBookmark.GetInternalBookmarkDomain(mgrPro.IbmItem.DomainName);

            if (ibmDomain == null)
            {
                ibmDomain = CurrentTemplateInfo.InternalBookmark.CreateInternalBookmarkDomain(mgrPro.IbmItem.DomainName);
            }
            ibmDomain.InternalBookmarkItems.Add(mgrPro.IbmItem);
        }
コード例 #20
0
        /// <summary>
        /// Add text into current selection in current document
        /// </summary>
        /// <param name="text">text string</param>
        /// <param name="isSelect">Select or not after add</param>
        public void AddText(string key)
        {
            ManagerProfile mgrProfile = Wkl.MainCtrl.ManagerCtrl.GetProfile(key);

            CommonProfile.CurrentSelection.TypeText(mgrProfile.AddToSelection_Text);

            if (mgrProfile.AddToSelection_IsSelected)
            {
                MoveCharacters(mgrProfile.AddToSelection_Text.Length, true, true);
            }
        }
コード例 #21
0
ファイル: MainService.cs プロジェクト: leonchen09/poc
        //private string proService_GetProperty(string key)
        //{
        //    Package package = new Package(propertyName, ServiceType.IntegrationService, EventType.GetProperty);

        //    MainEvent(package);

        //    return package.Result as string;
        //} // ngocbv_rem re-check

        //private void proService_AddProperty(string name, string value)
        //{
        //    Package package = new Package(ServiceType.IntegrationService, EventType.AddProperty);
        //    package.AddData(name);
        //    package.AddData(value);

        //    MainEvent(package);
        //} // ngocbv_rem re-check
        #endregion

        #region internal bookmark object
        private void proService_SaveInternalBookmark()
        {
            string         key    = string.Empty;
            ManagerProfile mgrPro = Wkl.MainCtrl.ManagerCtrl.CreateProfile(out key);

            mgrPro.ServiceType = ServiceType.IntegrationService;
            mgrPro.EventType   = EventType.SaveInternalBookmark;

            MainEvent(key);
            Wkl.MainCtrl.ManagerCtrl.RemoveDataObject(key);
        }
コード例 #22
0
ファイル: MainService.cs プロジェクト: leonchen09/poc
        private void bmService_ProtectBookmark()
        {
            string         key    = string.Empty;
            ManagerProfile mgrPro = Wkl.MainCtrl.ManagerCtrl.CreateProfile(out key);

            mgrPro.ServiceType = ServiceType.ContentService;
            mgrPro.EventType   = EventType.ProtectBookmark;

            MainEvent(key);
            Wkl.MainCtrl.ManagerCtrl.RemoveDataObject(key);
        }
コード例 #23
0
        /// <summary>
        /// get all foreach tags that contains current position (current position belong to that)
        /// </summary>
        /// <param name="key"></param>
        public void GetForeachTagsBoundCurrentPos(string key)
        {
            ManagerProfile mgrPro = Wkl.MainCtrl.ManagerCtrl.GetProfile(key);

            mgrPro.DicBookmarks = new Dictionary <string, Bookmark>();

            int sPos = CommonProfile.CurrentSelection.Start;
            int ePos = CommonProfile.CurrentSelection.End;

            //int startCount = 0;

            foreach (Bookmark wbm in CommonProfile.Bookmarks)
            {
                // check start position
                int pos = wbm.Start;
                if (pos <= sPos)
                {
                    if (wbm.Name.EndsWith(ProntoMarkup.KeyStartForeach))
                    {
                        mgrPro.DicBookmarks.Add(wbm.Name, wbm);
                        //startCount++;
                    }
                    //else if(startCount > 0)
                    //    mgrPro.DicBookmarks.Add(wbm.Name, wbm);
                }

                // check end position
                pos = wbm.End;
                if (pos >= ePos)
                {
                    if (wbm.Name.EndsWith(ProntoMarkup.KeyEndForeach))
                    {
                        mgrPro.DicBookmarks.Add(wbm.Name, wbm);
                        //startCount--;
                    }
                    //else if(startCount > 0)
                    //    mgrPro.DicBookmarks.Add(wbm.Name, wbm);
                }

                //if (wbm.Name.EndsWith(ProntoMarkup.KeyStartForeach))
                //{
                //    int pos = wbm.Start;
                //    if (pos <= sPos)
                //        mgrPro.DicBookmarks.Add(wbm.Name, wbm);
                //}
                //if (wbm.Name.EndsWith(ProntoMarkup.KeyEndForeach))
                //{
                //    int pos = wbm.End;
                //    if (pos >= ePos)
                //        mgrPro.DicBookmarks.Add(wbm.Name, wbm);
                //}
            }
        }
コード例 #24
0
ファイル: MainService.cs プロジェクト: leonchen09/poc
        private void proService_SavePdwInfo(string key)
        {
            ServicesProfile srvPro = Wkl.MainCtrl.ServiceCtrl.GetProfile(key);
            ManagerProfile  mgrPro = Wkl.MainCtrl.ManagerCtrl.CreateProfile(key);

            mgrPro.PdwInfo     = srvPro.PdwInfo;
            mgrPro.ServiceType = ServiceType.IntegrationService;
            mgrPro.EventType   = EventType.SavePdwInfo;

            MainEvent(key);
            Wkl.MainCtrl.ManagerCtrl.RemoveDataObject(key);
        }
コード例 #25
0
ファイル: MainService.cs プロジェクト: leonchen09/poc
        private void proService_RemoveInternalBookmarkItem(string key)
        {
            ServicesProfile srvPro = Wkl.MainCtrl.ServiceCtrl.GetProfile(key);
            ManagerProfile  mgrPro = Wkl.MainCtrl.ManagerCtrl.CreateProfile(key);

            mgrPro.ServiceType = ServiceType.IntegrationService;
            mgrPro.EventType   = EventType.RemoveInternalBookmarkItem;
            mgrPro.WbmKey      = srvPro.WbmKey;

            MainEvent(key);
            Wkl.MainCtrl.ManagerCtrl.RemoveDataObject(key);
        }
コード例 #26
0
ファイル: MainService.cs プロジェクト: leonchen09/poc
        private void bmService_HighlightBookmark(string key)
        {
            ServicesProfile servicePro = Wkl.MainCtrl.ServiceCtrl.GetProfile(key);
            ManagerProfile  mgrPro     = Wkl.MainCtrl.ManagerCtrl.CreateProfile(key);

            mgrPro.ServiceType = ServiceType.ContentService;
            mgrPro.EventType   = EventType.HighlightBookmark;

            mgrPro.HighlightBookmarkName = servicePro.ContentService.HighlightBookmarkName;

            MainEvent(key);
            Wkl.MainCtrl.ManagerCtrl.RemoveDataObject(key);
        }
コード例 #27
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="isProntoDoc"></param>
        public void MarkProntoDoc(string key)
        {
            ManagerProfile mgrProfile = Wkl.MainCtrl.ManagerCtrl.GetProfile(key);

            Wkl.MainCtrl.CommonCtrl.CommonProfile.CurrentTemplateInfo.IsProntoDoc = mgrProfile.MarkProntDoc;
            if (mgrProfile.MarkProntDoc)
            {
                if (!System.IO.File.Exists(Wkl.MainCtrl.CommonCtrl.CommonProfile.ActiveDoc.FullName))
                {
                    Wkl.MainCtrl.CommonCtrl.CommonProfile.App.Options.SaveInterval = 0;
                }
            }
        }
コード例 #28
0
ファイル: MainService.cs プロジェクト: leonchen09/poc
        private void bmService_MarkProntoDoc(string key)
        {
            ServicesProfile servicePro = Wkl.MainCtrl.ServiceCtrl.GetProfile(key);
            ManagerProfile  mgrPro     = Wkl.MainCtrl.ManagerCtrl.CreateProfile(key);

            mgrPro.ServiceType = ServiceType.ContentService;
            mgrPro.EventType   = EventType.MarkProntoDoc;

            mgrPro.MarkProntDoc = servicePro.ContentService.MarkProntDoc;

            MainEvent(key);
            Wkl.MainCtrl.ManagerCtrl.RemoveDataObject(key);
        }
コード例 #29
0
ファイル: MainService.cs プロジェクト: leonchen09/poc
        private void bmService_GetCurrentSelection(string key)
        {
            ServicesProfile servicePro = Wkl.MainCtrl.ServiceCtrl.GetProfile(key);
            ManagerProfile  mgrPro     = Wkl.MainCtrl.ManagerCtrl.CreateProfile(key);

            mgrPro.ServiceType = ServiceType.ContentService;
            mgrPro.EventType   = EventType.GetCurrentSelection;

            MainEvent(key);
            Wkl.MainCtrl.ManagerCtrl.RemoveDataObject(key);

            servicePro.ContentService.WSelection = mgrPro.WSelection;
        }
コード例 #30
0
ファイル: MainService.cs プロジェクト: leonchen09/poc
        private void proService_UpdateUscItems(string key)
        {
            string          mgrKey = string.Empty;
            ServicesProfile srvPro = Wkl.MainCtrl.ServiceCtrl.GetProfile(key);
            ManagerProfile  mgrPro = Wkl.MainCtrl.ManagerCtrl.CreateProfile(out mgrKey);

            mgrPro.UscItems    = srvPro.UscItems;
            mgrPro.ServiceType = ServiceType.IntegrationService;
            mgrPro.EventType   = EventType.UpdateUscItems;

            MainEvent(mgrKey);
            Wkl.MainCtrl.ManagerCtrl.RemoveDataObject(mgrKey);
        }
コード例 #31
0
 ///<exclude/>
 public bool Equals(ManagerProfile other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return other._Properties.SequenceEqual(_Properties);
 }