Пример #1
0
        private void SaveBt_Click(object sender, EventArgs e)
        {
            ContextManager             manager          = new ContextManager();
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);
            int?parentStructureObjectID = null;

            if ((StructureObjectsCB.SelectedValue != null) & (StructureObjectsCB.SelectedIndex > 0))
            {
                int test;
                if (int.TryParse(StructureObjectsCB.SelectedValue.ToString(), out test) == true)
                {
                    parentStructureObjectID = Convert.ToInt32(StructureObjectsCB.SelectedValue);
                }
            }

            if (mode == "new")
            {
                StructureObjects.Create(NameTB.Text, AllowServicesCB.Checked, ActiveCB.Checked, parentStructureObjectID);
            }
            if (mode == "edit")
            {
                StructureObjects.Update(Convert.ToInt32(id), NameTB.Text, AllowServicesCB.Checked, ActiveCB.Checked, parentStructureObjectID);
            }
            manager.Save();

            this.Close();
        }
Пример #2
0
        private void Fill()
        {
            StaffEmployeeSalariesLogic employeeSalaries = new StaffEmployeeSalariesLogic(manager);

            //StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);
            //StaffEmployeeSalary employeeSalary = employeeSalaries.Get(Convert.ToInt32(id));
            StaffEmployeeLogic employees = new StaffEmployeeLogic(manager);



            //заповнюємо поле відділу
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);

            List <Item> list = new List <Item>();
            //Item defaultItem = new Item();
            //defaultItem.ID = "";
            //defaultItem.Name = " - всі відділи - ";
            //list.Add(defaultItem);
            int selectedObjectIndex = 0;
            int counter             = 0;

            foreach (var a in StructureObjects.GetHeirarchyView())
            {
                Item i = new Item();
                i.ID   = a.ID.ToString();
                i.Name = a.Name;
                list.Add(i);
                counter++;
            }
            StructureObjectsCB.DisplayMember = "Name";
            StructureObjectsCB.ValueMember   = "ID";
            StructureObjectsCB.DataSource    = list;
            StructureObjectsCB.SelectedIndex = selectedObjectIndex;
        }
Пример #3
0
        /// <summary>
        /// Заповнюємо перелік вхідних об'єктів
        /// </summary>
        private void FillToObjects()
        {
            StaffStructureObjectsLogic        objects     = new StaffStructureObjectsLogic(manager);
            BindingList <StructureObjectView> objectsView = objects.GetHeirarchyView();

            //ToObjectCB.ValueMember = "ID";
            //ToObjectCB.DisplayMember = "Name";
            //FromObjectCB.ValueMember = "ID";
            //FromObjectCB.DisplayMember = "Name";
            //foreach (StructureObjectView ov in objectsView)
            //{
            //    ToObjectCB.Items.Add(ov);
            //    FromObjectCB.Items.Add(ov);
            //}

            ToObjectLUE.Properties.DataSource    = objectsView;
            ToObjectLUE.Properties.DisplayMember = "Name";
            ToObjectLUE.Properties.ValueMember   = "ID";
            LookUpColumnInfoCollection coll = ToObjectLUE.Properties.Columns;

            coll.Add(new LookUpColumnInfo("Name", 0, "Назва"));
            ToObjectLUE.Properties.BestFitMode = BestFitMode.BestFitResizePopup;
            //ToObjectLUE.Properties.SearchMode = SearchMode.AutoFilter;
            ToObjectLUE.Properties.AutoSearchColumnIndex = 1;

            FromObjectLUE.Properties.DataSource    = objectsView;
            FromObjectLUE.Properties.DisplayMember = "Name";
            FromObjectLUE.Properties.ValueMember   = "ID";
            LookUpColumnInfoCollection coll1 = FromObjectLUE.Properties.Columns;

            coll1.Add(new LookUpColumnInfo("Name", 0, "Назва"));
            FromObjectLUE.Properties.BestFitMode = BestFitMode.BestFitResizePopup;
            //FromObjectLUE.Properties.SearchMode = SearchMode.AutoFilter;
            FromObjectLUE.Properties.AutoSearchColumnIndex = 1;
        }
Пример #4
0
        private void FillGrid()
        {
            ContextManager             manager          = new ContextManager();
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);

            DataGV.AutoGenerateColumns = false;
            DataGV.DataSource          = StructureObjects.GetAll();
            BindingSource bs = new BindingSource();

            //bs.DataSource = StructureObjects.GetAll().Select(x => new {
            //    x.ID,
            //    x.Name,
            //    x.Active,
            //    x.AllowServices,
            //    ParrentStructureObjectName = (x.StaffStructureObject1 == null ? "" : x.StaffStructureObject1.Name)
            //    });
            bs.DataSource     = StructureObjects.GetHeirarchyView();
            DataGV.DataSource = bs;
            //ataGridView1.DataSource = StructureObjects.GetAll();//.Select(x => new { x.ID, x.Name, x.Active, x.AllowServices, ParrentStructureObjectName = (x.StaffStructureObject1 == null ? "" : x.StaffStructureObject1.Name) });
            //foreach (var a in StructureObjects.GetAll().Select(x => new { x.ID, x.Name, x.Active, x.AllowServices, ParentStructureObjectName = (x.StaffStructureObject1 == null ? "" : x.StaffStructureObject1.Name) }))
            //{

            //    MessageBox.Show(a.ParentStructureObjectName /* + (a.StaffStructureObject1 == null ? "" : a.StaffStructureObject1.Name)*/);
            //}

            DataGV.Update();

            manager.CloseContext();
        }
Пример #5
0
 private void Fill()
 {
     StaffTeamsLogic teams = new StaffTeamsLogic(manager);
     StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);
     StaffTeam team = teams.Get(Convert.ToInt32(id));
     NameTB.Text = team.Name;
 }
Пример #6
0
        public List <RemainView> GetAllView(int?StructureObjectID, int?WareID, DateTime?StartDate, DateTime?EndDate, int?WareCategoryID)
        {
            StaffStructureObjectsLogic structureObjectsLogic = new StaffStructureObjectsLogic(manager);
            List <int> structureObjects = new List <int>();

            if (StructureObjectID != null)
            {
                structureObjects = structureObjectsLogic.GetByParentStructureObjectID(Convert.ToInt32(StructureObjectID)).Select(a => a.ID).ToList();
                structureObjects.Add(Convert.ToInt32(StructureObjectID));
            }
            List <RemainView> result = new List <RemainView>();
            //вибираємо всі залишки за вказаними критеріями
            List <WareRemain> remains = (from a in context.WareRemains
                                         where ((StartDate == null) || (a.StartDate >= StartDate)) &
                                         ((EndDate == null) || (a.StartDate <= EndDate)) &
                                         ((WareID == null) || (a.WareID == WareID)) &
                                         ((StructureObjectID == null) || (structureObjects.Contains(a.StructureObjectID))) &
                                         ((WareCategoryID == null) || (a.Ware.CategoryID == WareCategoryID))


                                         select a).ToList();

            foreach (WareRemain a in remains)
            {
                result.Add(new RemainView(a));
            }
            //}
            return(result);
        }
Пример #7
0
        private void Fill()
        {
            StaffEmployeeSalariesLogic employeeSalaries = new StaffEmployeeSalariesLogic(manager);

            //StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);
            //StaffEmployeeSalary employeeSalary = employeeSalaries.Get(Convert.ToInt32(id));
            StaffEmployeeLogic employees = new StaffEmployeeLogic(manager);

            //заповнюємо поле відділу
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);

            List<Item> list = new List<Item>();
            //Item defaultItem = new Item();
            //defaultItem.ID = "";
            //defaultItem.Name = " - всі відділи - ";
            //list.Add(defaultItem);
            int selectedObjectIndex = 0;
            int counter = 0;
            foreach (var a in StructureObjects.GetHeirarchyView())
            {
                Item i = new Item();
                i.ID = a.ID.ToString();
                i.Name = a.Name;
                list.Add(i);
                counter++;
            }
            StructureObjectsCB.DisplayMember = "Name";
            StructureObjectsCB.ValueMember = "ID";
            StructureObjectsCB.DataSource = list;
            StructureObjectsCB.SelectedIndex = selectedObjectIndex;
        }
Пример #8
0
 public void FillStructureObjects()
 {
     Logic.Staff.StaffStructureObjectsLogic structureObjectsLogic = new StaffStructureObjectsLogic(manager);
     StructureObjectsCB.DisplayMember = "Name";
     StructureObjectsCB.ValueMember   = "ID";
     StructureObjectsCB.DataSource    = structureObjectsLogic.GetHeirarchyView();
 }
Пример #9
0
 public void FillStructureObjects()
 {
     Logic.Staff.StaffStructureObjectsLogic structureObjectsLogic = new StaffStructureObjectsLogic(manager);
     StructureObjectsCB.DisplayMember = "Name";
     StructureObjectsCB.ValueMember = "ID";
     StructureObjectsCB.DataSource = structureObjectsLogic.GetHeirarchyView();
 }
Пример #10
0
        private void Fill()
        {
            StaffTeamsLogic            teams            = new StaffTeamsLogic(manager);
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);
            StaffTeam team = teams.Get(Convert.ToInt32(id));

            NameTB.Text = team.Name;
        }
Пример #11
0
        private void DeleteSB_Click(object sender, EventArgs e)
        {
            ContextManager             manager          = new ContextManager();
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);

            StructureObjects.Delete(Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value));
            manager.Save();
            manager.CloseContext();
            FillGrid();
        }
Пример #12
0
        private void FillStructureObjects()
        {
            StaffStructureObjectsLogic        structureObjectsLogic = new StaffStructureObjectsLogic(manager);
            BindingList <StructureObjectView> structureObjects      = structureObjectsLogic.GetHeirarchyView();

            StructureObjectsLUE.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", "Назва"));
            StructureObjectsLUE.Properties.DataSource    = structureObjects;
            StructureObjectsLUE.Properties.DisplayMember = "Name";
            StructureObjectsLUE.Properties.ValueMember   = "ID";

            if (structureObjects.Count > 0)
            {
                StructureObjectsLUE.EditValue = structureObjects[0].ID;
            }
        }
Пример #13
0
        private void FillStructureObjects()
        {
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);

            List <Item> list = new List <Item>();

            foreach (var a in StructureObjects.GetStructureObjectsHierarchy(true))
            {
                Item i = new Item();
                i.ID   = a.ID.ToString();
                i.Name = a.Name;
                list.Add(i);
            }

            StructureObjectsCB.DataSource = list;
        }
Пример #14
0
        private void Fill()
        {
            WareUnitsLogic             units   = new WareUnitsLogic(manager);
            WaresLogic                 wares   = new WaresLogic(manager);
            StaffStructureObjectsLogic objects = new StaffStructureObjectsLogic(manager);

            if (DocumentDetail != null)
            {
                WareLUE.EditValue                 = DocumentDetail.WareID;
                UnitQuantityTB.EditValue          = DocumentDetail.UnitQuantity;
                SecondaryUnitQuantityTB.EditValue = DocumentDetail.SecondaryUnitQuantity;
                SalePriceForUnitTB.EditValue      = DocumentDetail.PriceForUnit;
                DiscountForUnitTB.EditValue       = DocumentDetail.DiscountForUnit;
                EndSalePriceForUnitTB.Text        = Convert.ToDecimal(DocumentDetail.EndPriceForUnit).ToString("n2");
                SalePriceTB.Text = Convert.ToDecimal(DocumentDetail.EndPrice).ToString("n2");
            }
        }
Пример #15
0
        private void FillStructureObjects()
        {
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);

            StructureObjectsCB.ValueMember   = "ID";
            StructureObjectsCB.DisplayMember = "Name";
            StructureObjectsCB.DropDownStyle = ComboBoxStyle.DropDownList;
            ItemIntValue none = new ItemIntValue();

            //none.ID = -1;
            none.Name = "- не вибрано -";
            List <ItemIntValue> list = new List <ItemIntValue>();

            list.Add(none);
            list.AddRange(StructureObjects.GetStructureObjectsHierarchy(true).Select(a => a));

            StructureObjectsCB.DataSource = list;
        }
Пример #16
0
        private void FillStructureObjects()
        {
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);

            StructureObjectsCB.ValueMember   = "ID";
            StructureObjectsCB.DisplayMember = "Name";
            StructureObjectsCB.DropDownStyle = ComboBoxStyle.DropDownList;
            StaffStructureObject none = new StaffStructureObject();

            //none.ID = -1;
            none.Name = "- не вибрано -";
            List <ItemIntValue> list = new List <ItemIntValue>();

            list.AddRange(StructureObjects.GetStructureObjectsHierarchy(true));

            StructureObjectsCB.DataSource = list;

            if (mode == "edit" || mode == "copy")
            {
                if (sheduler != null && sheduler.StructureObjectID != null)
                {
                    int i = 0;
                    foreach (object o in StructureObjectsCB.Items)
                    {
                        ItemIntValue StructureObject = (ItemIntValue)o;
                        if (StructureObject.ID == sheduler.StructureObjectID)
                        {
                            StructureObjectsCB.SelectedIndex = i;
                        }
                        i++;
                    }
                }

                if (mode == "copy")
                {
                    StartDateDTP.Value = sheduler.StartDate.Date.AddDays(1);
                    EndDateDTP.Value   = sheduler.EndDate.Date.AddDays(1);
                    StartTimeDTP.Value = sheduler.StartDate;
                    EndTimeDTP.Value   = sheduler.EndDate;
                }
            }
        }
Пример #17
0
        private void FillData()
        {
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);

            //EnterprisesCB.DataSource = enterprises.GetAll();
            //StructureObjectsCB.DataSource = StructureObjects.GetAll();
            Model.StaffStructureObject StructureObject = StructureObjects.Get(Convert.ToInt32(id));
            NameTB.Text = StructureObject.Name;
            AllowServicesCB.Checked = StructureObject.AllowServices;
            ActiveCB.Checked = StructureObject.Active;

            if (StructureObject.ParentStructureObjectID != null)
            {
                int n = 0;
                foreach (Item i in StructureObjectsCB.Items)
                {
                    if (i.ID == Convert.ToInt32(StructureObject.ParentStructureObjectID).ToString())
                        StructureObjectsCB.SelectedIndex = n;
                    n++;
                }
            }
        }
Пример #18
0
        private void Fill()
        {
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);

            List<Item> list = new List<Item>();

            foreach (var a in StructureObjects.GetStructureObjectsHierarchy(true))
            {
                Item i = new Item();
                i.ID = a.ID.ToString();
                i.Name = a.Name;
                list.Add(i);
            }
            StructureObjectsCB.DataSource = list;

            //list.AddRange(StructureObjects.GetAll().Select(x => new { ID = x.ID.ToString(), x.Name }).ToList() );

            //StructureObjectsCB.DataSource = StructureObjects.GetAll().Insert(-1, dep);

            //StructureObjectsCB.DataSource = null;
            //StructureObjectsCB.Items.Insert(0, " не вказано ");
        }
Пример #19
0
        public void FillFilters()
        {
            WareCategoriesLogic        categoriesLogic       = new WareCategoriesLogic(manager);
            StaffStructureObjectsLogic structureObjectsLogic = new StaffStructureObjectsLogic(manager);
            WaresLogic         waresLogic         = new WaresLogic(manager);
            DocumentTypesLogic documentTypesLogic = new DocumentTypesLogic(manager);


            StructureObjectsLUE.Properties.DisplayMember = "Name";
            StructureObjectsLUE.Properties.ValueMember   = "ID";
            StructureObjectsLUE.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", "Назва"));
            StructureObjectsLUE.Properties.DataSource = structureObjectsLogic.GetHeirarchyView();



            WareCategoriesLUE.Properties.DisplayMember = "Name";
            WareCategoriesLUE.Properties.ValueMember   = "ID";
            WareCategoriesLUE.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", "Назва"));
            WareCategoriesLUE.Properties.DataSource = categoriesLogic.GetCategoriesHierarchy();

            StartDateDE.EditValue = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
        }
Пример #20
0
        private void Fill()
        {
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);

            List <Item> list = new List <Item>();

            foreach (var a in StructureObjects.GetStructureObjectsHierarchy(true))
            {
                Item i = new Item();
                i.ID   = a.ID.ToString();
                i.Name = a.Name;
                list.Add(i);
            }
            StructureObjectsCB.DataSource = list;

            //list.AddRange(StructureObjects.GetAll().Select(x => new { ID = x.ID.ToString(), x.Name }).ToList() );

            //StructureObjectsCB.DataSource = StructureObjects.GetAll().Insert(-1, dep);

            //StructureObjectsCB.DataSource = null;
            //StructureObjectsCB.Items.Insert(0, " не вказано ");
        }
Пример #21
0
        private void FillData()
        {
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);

            //EnterprisesCB.DataSource = enterprises.GetAll();
            //StructureObjectsCB.DataSource = StructureObjects.GetAll();
            Model.StaffStructureObject StructureObject = StructureObjects.Get(Convert.ToInt32(id));
            NameTB.Text             = StructureObject.Name;
            AllowServicesCB.Checked = StructureObject.AllowServices;
            ActiveCB.Checked        = StructureObject.Active;

            if (StructureObject.ParentStructureObjectID != null)
            {
                int n = 0;
                foreach (Item i in StructureObjectsCB.Items)
                {
                    if (i.ID == Convert.ToInt32(StructureObject.ParentStructureObjectID).ToString())
                    {
                        StructureObjectsCB.SelectedIndex = n;
                    }
                    n++;
                }
            }
        }
Пример #22
0
        private void FillStructureObjects()
        {
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);

            List<Item> list = new List<Item>();

            foreach (var a in StructureObjects.GetStructureObjectsHierarchy(true))
            {
                Item i = new Item();
                i.ID = a.ID.ToString();
                i.Name = a.Name;
                list.Add(i);
            }

            StructureObjectsCB.DataSource = list;
        }
Пример #23
0
        private void SaveBt_Click(object sender, EventArgs e)
        {
            ContextManager manager = new ContextManager();
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);
            int? parentStructureObjectID = null;
            if ((StructureObjectsCB.SelectedValue != null) & (StructureObjectsCB.SelectedIndex > 0))
            {
                int test;
                if (int.TryParse(StructureObjectsCB.SelectedValue.ToString(), out test) == true)
                    parentStructureObjectID = Convert.ToInt32(StructureObjectsCB.SelectedValue);
            }

            if (mode == "new")
            {
                StructureObjects.Create(NameTB.Text, AllowServicesCB.Checked, ActiveCB.Checked, parentStructureObjectID);
            }
            if (mode == "edit")
            {
                StructureObjects.Update(Convert.ToInt32(id), NameTB.Text, AllowServicesCB.Checked, ActiveCB.Checked, parentStructureObjectID);
            }
            manager.Save();

            this.Close();
        }
Пример #24
0
        /// <summary>
        /// Заповнюємо перелік вхідних об'єктів
        /// </summary>
        private void FillToObjects()
        {
            StaffStructureObjectsLogic objects = new StaffStructureObjectsLogic(manager);
            BindingList<StructureObjectView> objectsView = objects.GetHeirarchyView();

            //ToObjectCB.ValueMember = "ID";
            //ToObjectCB.DisplayMember = "Name";
            //FromObjectCB.ValueMember = "ID";
            //FromObjectCB.DisplayMember = "Name";
            //foreach (StructureObjectView ov in objectsView)
            //{
            //    ToObjectCB.Items.Add(ov);
            //    FromObjectCB.Items.Add(ov);
            //}

            ToObjectLUE.Properties.DataSource = objectsView;
            ToObjectLUE.Properties.DisplayMember = "Name";
            ToObjectLUE.Properties.ValueMember = "ID";
            LookUpColumnInfoCollection coll = ToObjectLUE.Properties.Columns;
            coll.Add(new LookUpColumnInfo("Name", 0, "Назва"));
            ToObjectLUE.Properties.BestFitMode = BestFitMode.BestFitResizePopup;
            //ToObjectLUE.Properties.SearchMode = SearchMode.AutoFilter;
            ToObjectLUE.Properties.AutoSearchColumnIndex = 1;

            FromObjectLUE.Properties.DataSource = objectsView;
            FromObjectLUE.Properties.DisplayMember = "Name";
            FromObjectLUE.Properties.ValueMember = "ID";
            LookUpColumnInfoCollection coll1 = FromObjectLUE.Properties.Columns;
            coll1.Add(new LookUpColumnInfo("Name", 0, "Назва"));
            FromObjectLUE.Properties.BestFitMode = BestFitMode.BestFitResizePopup;
            //FromObjectLUE.Properties.SearchMode = SearchMode.AutoFilter;
            FromObjectLUE.Properties.AutoSearchColumnIndex = 1;
        }
Пример #25
0
        private void FillStructureObjects()
        {
            StaffStructureObjectsLogic structureObjectsLogic = new StaffStructureObjectsLogic(manager);
            BindingList<StructureObjectView> structureObjects = structureObjectsLogic.GetHeirarchyView();
            StructureObjectsLUE.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", "Назва"));
            StructureObjectsLUE.Properties.DataSource = structureObjects;
            StructureObjectsLUE.Properties.DisplayMember = "Name";
            StructureObjectsLUE.Properties.ValueMember = "ID";

            if (structureObjects.Count > 0)
            {
                StructureObjectsLUE.EditValue = structureObjects[0].ID;
            }
        }
Пример #26
0
        private void Fill()
        {
            StaffEmployeeSalariesLogic employeeSalaries = new StaffEmployeeSalariesLogic(manager);

            //StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);
            StaffEmployeeSalary employeeSalary = employeeSalaries.Get(Convert.ToInt32(id));
            StaffEmployeeLogic employees = new StaffEmployeeLogic(manager);
            StaffEmployee employee = employees.Get(employeeId);

            EmployeeL.Text = employee.LastName + " "+ employee.FirstName + " " + employee.MiddleName;

            //заповнюємо поле відділу
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);
            int objectId = Convert.ToInt32(employee.StructureObjectID);
            List<Item> list = new List<Item>();
            //Item defaultItem = new Item();
            //defaultItem.ID = "";
            //defaultItem.Name = " - всі відділи - ";
            //list.Add(defaultItem);
            int selectedObjectIndex = 0;
            int counter = 0;
            foreach (var a in StructureObjects.GetHeirarchyView())
            {
                Item i = new Item();
                i.ID = a.ID.ToString();
                i.Name = a.Name;
                if (employee.StructureObjectID == a.ID)
                    selectedObjectIndex = counter;
                list.Add(i);
                counter++;
            }
            StructureObjectsCB.DisplayMember = "Name";
            StructureObjectsCB.ValueMember = "ID";
            StructureObjectsCB.DataSource = list;
            StructureObjectsCB.SelectedIndex = selectedObjectIndex;

            if (mode == "new")
            {
                //очищаємо поле EndDate
                //set the format to custom

            }
            if (mode == "edit")
            {

                //заповнюємо відділ по якому нараховується зарплата
                if (employeeSalary.StructureObjectID != null)
                {
                    int n = 0;
                    foreach (Item i in StructureObjectsCB.Items)
                    {
                        if (i.ID == employeeSalary.StructureObjectID.ToString())
                            StructureObjectsCB.SelectedIndex = n;
                        n++;
                    }
                }

                dateTimePicker1.Value = employeeSalary.Month;
                SalaryNUD.Value = employeeSalary.Salary;
                SaleSumNUD.Value = employeeSalary.SumSale;
                ExtraPercentNUD.Value = employeeSalary.ExtraPercent;

            }
        }
Пример #27
0
        private void Fill()
        {
            StaffEmployeePositionsLogic employeePositions = new StaffEmployeePositionsLogic(manager);
            //StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);
            StaffEmployeePosition employeePosition = employeePositions.Get(Convert.ToInt32(id));
            StaffPositionsLogic   positions        = new StaffPositionsLogic(manager);
            StaffEmployeeLogic    employees        = new StaffEmployeeLogic(manager);
            StaffEmployee         employee         = employees.Get(employeeId);

            EmployeeL.Text            = employee.LastName + " " + employee.FirstName + " " + employee.MiddleName;
            PositionsCB.DataSource    = positions.GetAll();
            PositionsCB.DisplayMember = "Name";
            PositionsCB.ValueMember   = "ID";
            PositionsCB.Update();

            //заповнюємо поле відділу
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);
            int         objectId    = Convert.ToInt32(employee.StructureObjectID);
            List <Item> list        = new List <Item>();
            Item        defaultItem = new Item();

            defaultItem.ID   = "";
            defaultItem.Name = " - всі відділи - ";
            list.Add(defaultItem);
            foreach (var a in StructureObjects.GetHeirarchyView())
            {
                Item i = new Item();
                i.ID   = a.ID.ToString();
                i.Name = a.Name;
                list.Add(i);
            }
            StructureObjectsCB.DisplayMember = "Name";
            StructureObjectsCB.ValueMember   = "ID";
            StructureObjectsCB.DataSource    = list;


            if (mode == "new")
            {
                //очищаємо поле EndDate
                //set the format to custom
                EndDateDTP.Format = DateTimePickerFormat.Custom;
                // set custom format to empty
                EndDateDTP.CustomFormat = " ";
                ActiveCB.Checked        = true;
            }
            if (mode == "edit")
            {
                StartDateDTP.Value = employeePosition.StartDate;
                if (employeePosition.EndDate != null)
                {
                    EndDateDTP.Value = Convert.ToDateTime(employeePosition.EndDate);
                }
                else
                {
                    //очищаємо поле EndDate
                    //set the format to custom
                    EndDateDTP.Format = DateTimePickerFormat.Custom;
                    // set custom format to empty
                    EndDateDTP.CustomFormat = " ";
                }
                PositionsCB.SelectedItem = positions.GetAll().Where(a => a.ID == employeePosition.PositionID).FirstOrDefault();
                ActiveCB.Checked         = employeePosition.Active;

                if (employeePosition.StructureObjectID != null)
                {
                    int n = 0;
                    foreach (Item i in StructureObjectsCB.Items)
                    {
                        if (i.ID == employeePosition.StructureObjectID.ToString())
                        {
                            StructureObjectsCB.SelectedIndex = n;
                        }
                        n++;
                    }
                }
            }
        }
Пример #28
0
        private void Fill()
        {
            WareUnitsLogic units = new WareUnitsLogic(manager);
            WaresLogic wares = new WaresLogic(manager);
            StaffStructureObjectsLogic objects = new StaffStructureObjectsLogic(manager);

            if (DocumentDetail != null)
            {
                WareLUE.EditValue = DocumentDetail.WareID;
                UnitQuantityTB.EditValue = DocumentDetail.UnitQuantity;
                SecondaryUnitQuantityTB.EditValue = DocumentDetail.SecondaryUnitQuantity;
                SalePriceForUnitTB.EditValue = DocumentDetail.PriceForUnit;
                DiscountForUnitTB.EditValue = DocumentDetail.DiscountForUnit;
                EndSalePriceForUnitTB.Text = Convert.ToDecimal(DocumentDetail.EndPriceForUnit).ToString("n2");
                SalePriceTB.Text = Convert.ToDecimal(DocumentDetail.EndPrice).ToString("n2");
            }
        }
Пример #29
0
        private void Fill()
        {
            StaffEmployeePositionsLogic employeePositions = new StaffEmployeePositionsLogic(manager);
            //StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);
            StaffEmployeePosition employeePosition = employeePositions.Get(Convert.ToInt32(id));
            StaffPositionsLogic positions = new StaffPositionsLogic(manager);
            StaffEmployeeLogic employees = new StaffEmployeeLogic(manager);
            StaffEmployee employee = employees.Get(employeeId);

            EmployeeL.Text = employee.LastName + " "+ employee.FirstName + " " + employee.MiddleName;
            PositionsCB.DataSource = positions.GetAll();
            PositionsCB.DisplayMember = "Name";
            PositionsCB.ValueMember = "ID";
            PositionsCB.Update();

            //заповнюємо поле відділу
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);
            int objectId = Convert.ToInt32(employee.StructureObjectID);
            List<Item> list = new List<Item>();
            Item defaultItem = new Item();
            defaultItem.ID = "";
            defaultItem.Name = " - всі відділи - ";
            list.Add(defaultItem);
            foreach (var a in StructureObjects.GetHeirarchyView())
            {
                Item i = new Item();
                i.ID = a.ID.ToString();
                i.Name = a.Name;
                list.Add(i);
            }
            StructureObjectsCB.DisplayMember = "Name";
            StructureObjectsCB.ValueMember = "ID";
            StructureObjectsCB.DataSource = list;

            if (mode == "new")
            {
                //очищаємо поле EndDate
                //set the format to custom
                EndDateDTP.Format = DateTimePickerFormat.Custom;
                // set custom format to empty
                EndDateDTP.CustomFormat = " ";
                ActiveCB.Checked = true;
            }
            if (mode == "edit")
            {
                StartDateDTP.Value = employeePosition.StartDate;
                if (employeePosition.EndDate != null)
                {
                    EndDateDTP.Value = Convert.ToDateTime(employeePosition.EndDate);
                }
                else
                {
                    //очищаємо поле EndDate
                    //set the format to custom
                    EndDateDTP.Format = DateTimePickerFormat.Custom;
                    // set custom format to empty
                    EndDateDTP.CustomFormat = " ";
                }
                PositionsCB.SelectedItem = positions.GetAll().Where(a => a.ID == employeePosition.PositionID).FirstOrDefault();
                ActiveCB.Checked = employeePosition.Active;

                if (employeePosition.StructureObjectID != null)
                {
                    int n = 0;
                    foreach (Item i in StructureObjectsCB.Items)
                    {
                        if (i.ID == employeePosition.StructureObjectID.ToString())
                            StructureObjectsCB.SelectedIndex = n;
                        n++;
                    }
                }
            }
        }
Пример #30
0
        private void FillStructureObjects()
        {
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);
            StructureObjectsCB.ValueMember = "ID";
            StructureObjectsCB.DisplayMember = "Name";
            StructureObjectsCB.DropDownStyle = ComboBoxStyle.DropDownList;
            ItemIntValue none = new ItemIntValue();
            //none.ID = -1;
            none.Name = "- не вибрано -";
            List<ItemIntValue> list = new List<ItemIntValue>();
            list.Add(none);
            list.AddRange(StructureObjects.GetStructureObjectsHierarchy(true).Select(a => a));

            StructureObjectsCB.DataSource = list;
        }
Пример #31
0
        public void FillFilters()
        {
            WareCategoriesLogic categoriesLogic = new WareCategoriesLogic(manager);
            StaffStructureObjectsLogic structureObjectsLogic = new StaffStructureObjectsLogic(manager);
            WaresLogic waresLogic = new WaresLogic(manager);
            DocumentTypesLogic documentTypesLogic = new DocumentTypesLogic(manager);

            StructureObjectsLUE.Properties.DisplayMember = "Name";
            StructureObjectsLUE.Properties.ValueMember = "ID";
            StructureObjectsLUE.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", "Назва"));
            StructureObjectsLUE.Properties.DataSource = structureObjectsLogic.GetHeirarchyView();

            WareCategoriesLUE.Properties.DisplayMember = "Name";
            WareCategoriesLUE.Properties.ValueMember = "ID";
            WareCategoriesLUE.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", "Назва"));
            WareCategoriesLUE.Properties.DataSource = categoriesLogic.GetCategoriesHierarchy();

            StartDateDE.EditValue = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
        }
Пример #32
0
        private void Fill()
        {
            StaffEmployeeSalariesLogic employeeSalaries = new StaffEmployeeSalariesLogic(manager);

            //StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);
            StaffEmployeeSalary employeeSalary = employeeSalaries.Get(Convert.ToInt32(id));
            StaffEmployeeLogic  employees      = new StaffEmployeeLogic(manager);
            StaffEmployee       employee       = employees.Get(employeeId);

            EmployeeL.Text = employee.LastName + " " + employee.FirstName + " " + employee.MiddleName;


            //заповнюємо поле відділу
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);
            int         objectId = Convert.ToInt32(employee.StructureObjectID);
            List <Item> list     = new List <Item>();
            //Item defaultItem = new Item();
            //defaultItem.ID = "";
            //defaultItem.Name = " - всі відділи - ";
            //list.Add(defaultItem);
            int selectedObjectIndex = 0;
            int counter             = 0;

            foreach (var a in StructureObjects.GetHeirarchyView())
            {
                Item i = new Item();
                i.ID   = a.ID.ToString();
                i.Name = a.Name;
                if (employee.StructureObjectID == a.ID)
                {
                    selectedObjectIndex = counter;
                }
                list.Add(i);
                counter++;
            }
            StructureObjectsCB.DisplayMember = "Name";
            StructureObjectsCB.ValueMember   = "ID";
            StructureObjectsCB.DataSource    = list;
            StructureObjectsCB.SelectedIndex = selectedObjectIndex;

            if (mode == "new")
            {
                //очищаємо поле EndDate
                //set the format to custom
            }
            if (mode == "edit")
            {
                //заповнюємо відділ по якому нараховується зарплата
                if (employeeSalary.StructureObjectID != null)
                {
                    int n = 0;
                    foreach (Item i in StructureObjectsCB.Items)
                    {
                        if (i.ID == employeeSalary.StructureObjectID.ToString())
                        {
                            StructureObjectsCB.SelectedIndex = n;
                        }
                        n++;
                    }
                }

                dateTimePicker1.Value = employeeSalary.Month;
                SalaryNUD.Value       = employeeSalary.Salary;
                SaleSumNUD.Value      = employeeSalary.SumSale;
                ExtraPercentNUD.Value = employeeSalary.ExtraPercent;
            }
        }
Пример #33
0
        private void FillStructureObjects()
        {
            StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager);
            StructureObjectsCB.ValueMember = "ID";
            StructureObjectsCB.DisplayMember = "Name";
            StructureObjectsCB.DropDownStyle = ComboBoxStyle.DropDownList;
            StaffStructureObject none = new StaffStructureObject();
            //none.ID = -1;
            none.Name = "- не вибрано -";
            List<ItemIntValue> list = new List<ItemIntValue>();

            list.AddRange(StructureObjects.GetStructureObjectsHierarchy(true));

            StructureObjectsCB.DataSource = list;

            if (mode == "edit" || mode == "copy")
            {
                if (sheduler != null && sheduler.StructureObjectID != null)
                {
                    int i = 0;
                    foreach (object o in StructureObjectsCB.Items)
                    {
                        ItemIntValue StructureObject = (ItemIntValue)o;
                        if (StructureObject.ID == sheduler.StructureObjectID)
                        {
                            StructureObjectsCB.SelectedIndex = i;
                        }
                        i++;
                    }
                }

                if (mode == "copy")
                {
                    StartDateDTP.Value = sheduler.StartDate.Date.AddDays(1);
                    EndDateDTP.Value = sheduler.EndDate.Date.AddDays(1);
                    StartTimeDTP.Value = sheduler.StartDate;
                    EndTimeDTP.Value = sheduler.EndDate;

                }
            }
        }