Beispiel #1
0
        public GestioneDipendentiPresenter(ListForm target)
        {
            //Controlli
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }
            _target = target;

            //Label e titolo
            Label label = new Label();

            label.Text      = "Dipendenti presenti nel sistema";
            label.TextAlign = ContentAlignment.MiddleCenter;
            label.Anchor    = AnchorStyles.Top;
            label.AutoSize  = true;
            _target.SetFilter(label);
            _target.Size = new Size(568, 355);
            _target.Text = "Gestione dipendenti";

            // Popolo la grid
            _target.DataSource = Negozio.Dipendenti.ToList();

            // Registrazione eventi
            _target.AddButton.Click    += AggiungiDipendenteAlSistema;
            _target.EditButton.Click   += ModificaDipendente;
            _target.DeleteButton.Click += RimuoviDipendenteDalSistema;
            Negozio.Changed            += RefreshDataGrid;
        }
        public ActionResult TeamTasks(int taskId)
        {
            int             Employee_Id = SessionUser.GetUser().Id;
            List <ListForm> list        = new List <ListForm>();

            foreach (Task Task in TaskService.GetForTeam(taskId, Employee_Id))
            {
                ListForm form = new ListForm()
                {
                    Id          = Task.Id,
                    ProjectId   = Task.ProjectId,
                    CreatorId   = Task.CreatorId,
                    Name        = Task.Title,
                    Description = Task.Description,
                    StartDate   = Task.Start,
                    EndDate     = Task.End,
                    Deadline    = Task.Deadline,
                    SubtaskOf   = Task.SubtaskOf,
                    StatusName  = Task.StatusName,
                    StatusDate  = Task.StatusDate,
                    StatusId    = Task.StatusId,
                    TeamId      = Task.TeamId
                };
                list.Add(form);
            }
            return(View(list));
        }
        // GET: Employee/Task
        public ActionResult Index()
        {
            int             Employee_Id = SessionUser.GetUser().Id;
            List <ListForm> list        = new List <ListForm>();

            foreach (Task Task in TaskService.GetForUser(Employee_Id))
            {
                ListForm form = new ListForm()
                {
                    Id            = Task.Id,
                    ProjectId     = Task.ProjectId,
                    CreatorId     = Task.CreatorId,
                    Name          = Task.Title,
                    Description   = Task.Description,
                    StartDate     = Task.Start,
                    EndDate       = Task.End,
                    Deadline      = Task.Deadline,
                    SubtaskOf     = Task.SubtaskOf,
                    StatusName    = Task.StatusName,
                    StatusDate    = Task.StatusDate,
                    StatusId      = Task.StatusId,
                    TeamId        = Task.TeamId,
                    Project       = ProjectService.GetProjectById(Task.ProjectId),
                    Creator       = EmployeeService.Get(Task.CreatorId),
                    Team          = (Task.TeamId != null) ? TeamService.GetTeamById((int)Task.TeamId) : null,
                    TaskSubtaskOf = (Task.SubtaskOf != null) ? TaskService.Get((int)Task.SubtaskOf, SessionUser.GetUser().Id) : null
                };
                list.Add(form);
            }
            return(View(list));
        }
Beispiel #4
0
        public override void Enter()
        {
#if !WindowsCE
            ListForm.SetFormVisible(false);
#endif
            base.Enter();
        }
Beispiel #5
0
        /// <summary>
        /// 編集ダイアログを表示する
        /// </summary>
        /// <param name="editType"></param>
        public void ShowEditDialog(EditType editType)
        {
            switch (editType)
            {
            case EditType.Register:
                SelectedEditType = EditType.Register;

                break;

            case EditType.Update:
                SelectedUser     = GetSelctedUser(ListForm.GetSelectedRow());
                SelectedEditType = EditType.Update;

                break;

            case EditType.Delete:
                SelectedUser     = GetSelctedUser(ListForm.GetSelectedRow());
                SelectedEditType = EditType.Delete;

                break;
            }

            View.EditForm editForm = new View.EditForm(Users, Departments, SelectedEditType, SelectedUser);
            editForm.ShowDialog();

            //編集したユーザー情報をIDの昇順に並べバインドリストに
            Users = Users.OrderBy(x => x.ID).ToList();
        }
 public static void ElencoElementi()
 {
     using (ListForm listForm = new ListForm())
     {
         GestioneElementiPresenter presenter = new GestioneElementiPresenter(listForm);
         listForm.ShowDialog();
     }
 }
Beispiel #7
0
 public int AddList(ListForm form)
 {
     using (var uow = UnitOfWorkFactory.Create <NovelContext>())
     {
         var service = new ListService(uow);
         return(service.SaveChanges(form));
     }
 }
        private void initFilters(ListForm target)
        {
            //Popolo il filtro
            _filterBox.Items.AddRange(Negozio.Categorie.ToArray());
            _filterBox.SelectedItem = _filterBox.Items.OfType <object>().First();

            //Chiama l'aggiornamento
            RefreshDataGrid(this, ChangedEventArgs.AggiornaFiltro());
        }
Beispiel #9
0
        private void initFilters(ListForm target)
        {
            //Popolo il filtro
            //_filterBox.Items.AddRange(Negozio.TipologieAgevolazioni.ToArray()); TO DO >> implementare in Negozio
            _filterBox.SelectedItem = _filterBox.Items.OfType <object>().First();

            //Chiama l'aggiornamento
            RefreshDataGrid(this, ChangedEventArgs.AggiornaFiltro());
        }
Beispiel #10
0
        //Instance method has 2 parameters
        //1. Enumerator for a list of items to be displayed. Each item implements
        //IMenuItem interface, which means that it knows howto display itself
        //2. Delegate for the method which will be called on the selected item
        //when the user presses enter key
        public static new IState Instance(IDoubleEnumerator ide, ProcessSelectedItem psi)
        {
#if WindowsCE
            return(List.Instance(ide, psi));
#else
            ListForm.SetList(ide);
            ProcessSelected = psi;
            List.Instance(ide);
            return(state);
#endif
        }
Beispiel #11
0
 /// <summary>
 /// Crea una instancia de ListFormSilverlight.
 /// </summary>
 public ListFormSilverlight()
 {
     // Inicializar variables.
     InitializeComponent();
     listForm = new ListForm();
     listForm.TemplateListFormDocument     = new TemplateListFormDocument();
     listForm.InputConnectionPoint         = new ConnectionPoint(ConnectionPointType.Input);
     listForm.InputConnectionPoint.Parent  = listForm;
     listForm.OutputConnectionPoint        = new ConnectionPoint(ConnectionPointType.Output);
     listForm.OutputConnectionPoint.Parent = listForm;
     AddMenu(canvasWidget);
 }
Beispiel #12
0
        private void barBtn_Search_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ListForm lf = new ListForm();

            if (lf.ShowDialog(this) == DialogResult.OK)
            {
                this._PCFC  = lf.SelectItem as Model.PCFinishCheck;
                this.action = "view";
                this.Refresh();
            }
            lf.Dispose();
            GC.Collect();
        }
Beispiel #13
0
 private void Form2_FormClosed(object sender, FormClosedEventArgs e)
 {
     ListForm.Remove(this);
     foreach (var Temp in HisForm)
     {
         if (Temp.Key == this.Text)
         {
             HisForm.Remove(Temp.Key);
             break;
         }
     }
     HisForm.Add(this.Text, new BezierPoint(p1, p2, p3, p4));
 }
        public ActionResult Index()
        {
            List <ListForm> list = new List <ListForm>();

            foreach (C.Project Project in ProjectService.GetAllActive())
            {
                int?       ManagerId = Project.ProjectManagerId;
                C.Employee Manager   = EmployeeService.Get((int)ManagerId);
                C.Employee Creator   = EmployeeService.Get(Project.CreatorId);
                ListForm   form      = new ListForm(Project, Manager, Creator);
                list.Add(form);
            }
            return(View(list));
        }
Beispiel #15
0
        public ActionResult Index()
        {
            int             Employee_Id = SessionUser.GetUser().Id;
            List <ListForm> list        = new List <ListForm>();

            foreach (C.Project Project in ProjectService.GetAllActive())
            {
                int        ManagerId = Project.ProjectManagerId;
                C.Employee Manager   = EmployeeService.Get(ManagerId);
                ListForm   form      = new ListForm(Project, Manager, Employee_Id);
                list.Add(form);
            }
            return(View(list));
        }
Beispiel #16
0
        // GET: Admin/Team
        public ActionResult Index()
        {
            List <ListForm> list = new List <ListForm>();

            foreach (C.Team Team in TeamService.GetAllActive())
            {
                int?       TeamLeaderId = TeamService.GetTeamLeaderId((int)Team.Id);
                C.Employee TeamLeader   = EmployeeService.Get((int)TeamLeaderId);
                C.Employee Creator      = EmployeeService.Get(Team.Creator_Id);
                C.Project  Project      = ProjectService.GetProjectById(Team.Project_Id);
                ListForm   form         = new ListForm(Team, TeamLeader, Creator, Project);
                list.Add(form);
            }
            return(View(list));
        }
        public ActionResult Delete(int id)
        {
            C.Employee emp = EmployeeService.Get(id);
            ListForm   e   = new ListForm()
            {
                LastName  = emp.LastName,
                FirstName = emp.FirstName,
                Email     = emp.Email,
                Address   = emp.Address,
                Phone     = emp.Phone,
                RegNat    = emp.RegNat
            };

            return(View(e));
        }
Beispiel #18
0
        /// <summary>
        /// Crea un EditListFormControl basado en un ListFormSilverlight.
        /// </summary>
        /// <param name="listFormSilverlight">listFormSilverlight usado para crear.</param>
        /// <param name="dataModel">Modelo de datos usado para completar la interfaz.</param>
        public EditListFormControl(ListFormSilverlight listFormSilverlight, DataModel dataModel)
        {
            // Inicializar variables.
            InitializeComponent();
            this.dataModel           = dataModel;
            this.listFormSilverlight = listFormSilverlight;
            this.listForm            = listFormSilverlight.ListForm;

            // Una lista usada para guardar la configuración de ítems mientras el
            // usuario configura la lista, esto no se actualiza en el momento, porque
            // el usuario puede cancelar la edición.
            this.tempSingleItems = new List <TextField>();

            this.canvasDraw.MouseLeftButtonUp += new MouseButtonEventHandler(canvasDraw_MouseLeftButtonUp);
        }
        static public void MOGGlobalToolsLoadReport(MogMainForm mainForm)
        {
            string ReportDir = MOG_ControllerProject.GetUser().GetUserPath() + "\\Reports";

            ListForm report = new ListForm("Load custom user report");

            report.ListListView.SmallImageList = MogUtil_AssetIcons.Images;

            mainForm.MOGOpenFileDialog.Filter           = "Mog Reports | *.rep";
            mainForm.MOGOpenFileDialog.InitialDirectory = ReportDir;
            if (mainForm.MOGOpenFileDialog.ShowDialog(mainForm) == DialogResult.OK)
            {
                report.Show(mainForm);
                report.LoadReportList(mainForm.MOGOpenFileDialog.FileName);
            }
        }
 private void Form2_FormClosed(object sender, FormClosedEventArgs e)
 {
     try
     {
         ListForm.Remove(this);
         foreach (var Temp in HisForm)
         {
             if (Temp.Key == SetDate.mode + SetDate.UseMode)
             {
                 HisForm.Remove(Temp.Key);
                 break;
             }
         }
         HisForm.Add(SetDate.mode + SetDate.UseMode, new BezierPoint(p1, p2, p3, p4));
     }
     catch (Exception) { }
 }
        public GestioneElementiPresenter(ListForm target)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }
            _target                     = target;
            _target.Text                = "Gestione elementi";
            _target.AddButton.Click    += AggiungiElementoAlSistema;
            _target.EditButton.Click   += ModificaElemento;
            _target.DeleteButton.Click += RimuoviElementoDalSistema;

            //Inizializzazione filtri
            _filterPresenter = new FilterPresenter(_target.DataGridView);
            target.AddFilter(_filterPresenter.InitializeFilters());
            Negozio.Changed += RefreshDataGrid;
        }
Beispiel #22
0
        private void OpenMenu(tb_Sys_Menu menuInfo)
        {
            if (SelecedTabByName(menuInfo.MenuName))
            {
                return;
            }
            //var m = this.MdiChildren.Where(i => i.Text ==menuInfo.MenuName).FirstOrDefault();
            //if (m != null)
            //{
            //    //m.WindowState = FormWindowState.Maximized;
            //    m.Show();
            //    return;
            //}
            if (string.IsNullOrWhiteSpace(menuInfo.NameSpeace))
            {
                return;
            }
            if (menuInfo.MenuName == "权限管理")
            {
                A004_RoleControl frm = new A004_RoleControl();
                frm.MdiParent = this;
                frm.Text      = menuInfo.MenuName;
                frm.Show();
                return;
            }
            Type type = Type.GetType(menuInfo.NameSpeace);

            if (type == null)
            {
                throw new AppException("没有对应的窗体类型,创建失败");
            }
            ListForm     obj       = (ListForm)Activator.CreateInstance(type);
            tb_Sys_Roles rolesData = appCacheService.GetItem("roles") as tb_Sys_Roles;
            //Guid roleId = rolesDataXml.Element("Id").Value.ToGuid();
            var buttonList = buttonService.GetButtonsByMenu(menuInfo.Id, rolesData.Id);

            obj.Text = menuInfo.MenuName;
            obj.Tag  = menuInfo;
            obj.CreateToolBar(buttonList);
            obj.MdiParent = this;
            //obj.WindowState = FormWindowState.Maximized;
            obj.Show();
            //obj.ShowDig(this,menuInfo.MenuName);
        }
 public static void ElencoStatiElementi()
 {
     using (ListForm listForm = new ListForm())
     {
         listForm.EditButton.Enabled   = false;
         listForm.AddButton.Enabled    = false;
         listForm.DeleteButton.Enabled = false;
         listForm.DataSource           = Negozio.StatiElemento.ToList();
         listForm.Text = "Elenco stati elementi";
         Label label = new Label();
         label.Text      = "Stati in cui un elmento si può trovare";
         label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
         label.Anchor    = AnchorStyles.Top;
         label.AutoSize  = true;
         listForm.SetFilter(label);
         listForm.Size = new Size(850, 355);
         listForm.ShowDialog();
     }
 }
        public GestioneTipologieElementiPresenter(ListForm target)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }
            _target                     = target;
            _target.Text                = "Gestione tipologie elementi";
            _target.AddButton.Click    += AggiungiElementoAlSistema;
            _target.EditButton.Click   += ModificaTipoElemento;
            _target.DeleteButton.Click += DisattivaTipoElemento;

            //Inizializzazione filtri e registrazione eventi relativi
            _filterBox = new ComboBox();
            target.AddFilter(_filterBox);
            initFilters(_target);
            _filterBox.SelectionChangeCommitted += RefreshCategoria;
            Negozio.Changed += RefreshDataGrid;
        }
 public static void ElencoCategorie()
 {
     using (ListForm listForm = new ListForm())
     {
         listForm.EditButton.Enabled   = false;
         listForm.AddButton.Enabled    = false;
         listForm.DeleteButton.Enabled = false;
         listForm.DataSource           = Negozio.Categorie;
         listForm.Text = "Elenco categorie";
         Label label = new Label();
         label.Text      = "Categorie di elementi presenti nel sistema";
         label.TextAlign = ContentAlignment.MiddleCenter;
         label.Anchor    = AnchorStyles.Top;
         label.AutoSize  = true;
         listForm.SetFilter(label);
         listForm.Size = new Size(568, 355);
         listForm.ShowDialog();
     }
 }
 public static void ElencoFasceOrarie()
 {
     using (ListForm listForm = new ListForm())
     {
         listForm.EditButton.Enabled   = false;
         listForm.AddButton.Enabled    = false;
         listForm.DeleteButton.Enabled = false;
         listForm.DataSource           = Negozio.FasceOrarie.ToList();
         listForm.Text = "Elenco fasce orarie";
         Label label = new Label();
         label.Text      = "Fasce orarie in base a cui avviene la tariffazione";
         label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
         label.Anchor    = AnchorStyles.Top;
         label.AutoSize  = true;
         listForm.SetFilter(label);
         listForm.Size = new Size(568, 355);
         listForm.ShowDialog();
     }
 }
Beispiel #27
0
        public GestioneAgevolazioniPresenter(ListForm target)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }
            _target                     = target;
            _target.Text                = "Gestione agevolazioni";
            _target.AddButton.Click    += AggiungiAgevolazioneAlSistema;
            _target.EditButton.Click   += ModificaAgevolazione;
            _target.DeleteButton.Click += RimuoviAgevolazione;

            //Inizializzazione filtri e registrazione eventi relativi
            _filterBox = new ComboBox();
            target.AddFilter(_filterBox);
            initFilters(_target);
            _filterBox.SelectionChangeCommitted += RefreshTipoAgevolazione;
            Negozio.Changed += RefreshDataGrid;
        }
Beispiel #28
0
        // GET: Admin/Department
        public ActionResult Index()
        {
            List <ListForm> list = new List <ListForm>();

            foreach (C.Department Department in DepartmentService.GetAll())
            {
                ListForm form = new ListForm
                {
                    Id          = (int)Department.Id,
                    Title       = Department.Title,
                    Created     = Department.Created,
                    Description = Department.Description,
                    Admin_Id    = Department.Admin_Id,
                    Creator     = EmployeeService.Get(Department.Admin_Id),
                    Active      = Department.Active,
                };
                list.Add(form);
            }
            return(View(list));
        }
Beispiel #29
0
        public int SaveChanges(ListForm form)
        {
            var tUserList = Table <UserList>();

            var userList = tUserList.GetOrAdd(w => w.ID == form.ID || (w.UserID == form.UserID && w.Name == form.Name));

            MapProperty(form, userList, form.InlineEditProperty);
            UpdateAuditFields(userList, form.ByUserID);

            // override
            if (form.InlineEditProperty == form.PropertyName(m => m.ShareLevel))
            {
                userList.ShareLevel = form.ShareLevel;
            }

            // save
            SaveChanges();

            return(userList.ID);
        }
Beispiel #30
0
        public static void AggiungiElementi()
        {
            //  Creare un nuovo elemento (servizio di Negozio)
            //  Invocare il metodo Modifica
            //  In caso di successo, aggiungere l'elemento al negozio (servizio di Document)

            string categoria = null;

            //Faccio scegliere la categoria
            using (ListForm listForm = new ListForm())
            {
                listForm.EditButton.Enabled   = false;
                listForm.AddButton.Enabled    = false;
                listForm.DeleteButton.Enabled = false;
                listForm.DataSource           = Negozio.Categorie;
                listForm.Text = "Scelta categoria elemento";
                Label label = new Label();
                label.Text      = "Scegliere la categoria dell'elemento";
                label.TextAlign = ContentAlignment.MiddleCenter;
                label.Anchor    = AnchorStyles.Top;
                label.AutoSize  = true;
                listForm.SetFilter(label);
                listForm.Size = new Size(568, 355);
                listForm.OkButton.DialogResult = DialogResult.OK;
                if (listForm.ShowDialog() == DialogResult.OK && listForm.DataGridView.CurrentRow != null)
                {
                    categoria = listForm.DataGridView.CurrentRow.DataBoundItem.ToString();
                }
                else
                {
                    return;
                }
            }

            Elemento elemento = Negozio.NuovoElemento(categoria);

            if (NoleggioServices.Modifica(elemento, true))
            {
                Negozio.InserisciNuovoElemento(elemento);
            }
        }
 public SelectScreen(ListForm listForm)
     : base(listForm)
 {
 }
Beispiel #32
0
        /// <summary>
        /// 执行命令
        /// </summary>
        /// <param name="o">命令参数</param>
        /// <returns>是否执行成功</returns>
        public override bool Execute(object o)
        {
            bool success = false;
            List<string> mapList = o as List<string>;
            TreeNode currentNode = tree.SelectedNode;
            TreeNode newNode;
            DialogResult result;
            string inputText;

            if (currentNode.Level > 0) // 在当前选中树结点下新建分类
            {
                InputForm iForm = new InputForm("请输入新建分类的名称", "新建分类");
                result = iForm.ShowDialog();
                inputText = iForm.InputText;
            }
            else // 在根结点下新建分类
            {
                ListForm lForm = new ListForm("请选择新建分类的地图名", mapList);
                result = lForm.ShowDialog();
                inputText = lForm.InputText;
            }

            if (result == DialogResult.OK)
            {
                if (CheckPathValid(currentNode, inputText)) // 当前无重复路径
                {
                    // 保存命令执行前的状态
                    description = ("新建分类 " + inputText);                    

                    if (currentNode != null) 
                    {
                        newNode = currentNode.Nodes.Add(inputText);
                    }
                    else 
                    {
                        newNode = tree.Nodes.Add(inputText);
                    }

                    newNode.Name = inputText;
                    newNode.ImageIndex = 0;
                    newNode.SelectedImageIndex = 0;
                    tree.SelectedNode = newNode;
                    documentManager.CurrentTreeMode = EditMode.Normal;

                    // 对数据库进行操作
                    DataBaseManager dataBaseManager = DataBaseManager.GetDataBaseManager();
                    string path = documentManager.GetNodePath(newNode);
                    string id = dataBaseManager.CreateNewDiagram(path, true, documentManager.CurrentChartMode);
                    newNode.Tag = id;

                    // 保存命令执行后的状态                    
                    success = true;
                }
                else
                {
                    MessageBox.Show("该路径已经存在!", "路径有效性检查", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }

            return success;
        }
Beispiel #33
0
 private void просмотрToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var listForm = new ListForm<ParameterDetail>(DIKernel);
     listForm.MdiParent = this;
     listForm.LoadData = DIKernel.Get<ParameterRepository>().GetAll;
     listForm.InitializeOperations();
     listForm.Show();
     listForm.Activate();
 }