コード例 #1
0
ファイル: UnitsList.cs プロジェクト: rymarrv/Compas
 private void DeleteSB_Click(object sender, EventArgs e)
 {
     WareUnitsLogic units = new WareUnitsLogic(manager);
     units.Delete(Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value));
     manager.Save();
     Fill();
 }
コード例 #2
0
ファイル: UnitsList.cs プロジェクト: rymarrv/Compas
 private void Fill()
 {
     WareUnitsLogic units = new WareUnitsLogic(manager);
     DataGV.AutoGenerateColumns = false;
     DataGV.DataSource = units.GetAll();
     DataGV.Update();
 }
コード例 #3
0
ファイル: WareData.cs プロジェクト: zep2zep/Compas
        private void FillUnits()
        {
            ItemIntValue none = new ItemIntValue();

            none.ID   = -1;
            none.Name = " - не вибрано - ";

            WareUnitsLogic      units  = new WareUnitsLogic(manager);
            List <ItemIntValue> items2 = new List <ItemIntValue>();

            items2.Clear();
            items2.Add(none);
            foreach (var a in units.GetAll().OrderBy(a => a.Name))
            {
                ItemIntValue i = new ItemIntValue();
                i.ID   = a.ID;
                i.Name = a.Name;
                items2.Add(i);
            }
            UnitsCB.DataSource    = items2;
            UnitsCB.ValueMember   = "ID";
            UnitsCB.DisplayMember = "Name";
            UnitsCB.Update();
            if (UnitsCB.Items.Count > 1)
            {
                UnitsCB.SelectedIndex = 1;
            }
        }
コード例 #4
0
ファイル: WareFilterUC.cs プロジェクト: zep2zep/Compas
        //public string WareName
        //{
        //    get
        //    {
        //        string result = null;
        //        if (NameTB.Text.Length > 0)
        //        {
        //            result = NameTB.Text;
        //        }
        //        return result;
        //    }
        //}

        public void Fill()
        {
            ItemIntValue none = new ItemIntValue();

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

            WareCategoriesLogic categories = new WareCategoriesLogic(manager);

            items0.Clear();
            //items0.Add(none);
            foreach (var a in categories.GetCategoriesHierarchy().OrderBy(a => a.Name))
            {
                ItemIntValue i = new ItemIntValue();
                i.ID   = a.ID;
                i.Name = a.Name;
                items0.Add(i);
            }
            CategoriesCB.DataSource    = items0;
            CategoriesCB.ValueMember   = "ID";
            CategoriesCB.DisplayMember = "Name";
            CategoriesCB.Update();

            WareManufacturersLogic manufacturers = new WareManufacturersLogic(manager);
            List <ItemIntValue>    items1        = new List <ItemIntValue>();

            items1.Clear();
            items1.Add(none);
            foreach (var a in manufacturers.GetAll().OrderBy(a => a.Name))
            {
                ItemIntValue i = new ItemIntValue();
                i.ID   = a.ID;
                i.Name = a.Name;
                items1.Add(i);
            }
            //ManufacturersCB.DataSource = manufacturers.GetAll();
            ManufacturersCB.DataSource    = items1;
            ManufacturersCB.ValueMember   = "ID";
            ManufacturersCB.DisplayMember = "Name";
            ManufacturersCB.Update();

            WareUnitsLogic      units  = new WareUnitsLogic(manager);
            List <ItemIntValue> items2 = new List <ItemIntValue>();

            items2.Clear();
            items2.Add(none);
            foreach (var a in units.GetAll().OrderBy(a => a.Name))
            {
                ItemIntValue i = new ItemIntValue();
                i.ID   = a.ID;
                i.Name = a.Name;
                items2.Add(i);
            }
            UnitsCB.DataSource    = items2;
            UnitsCB.ValueMember   = "ID";
            UnitsCB.DisplayMember = "Name";
            UnitsCB.Update();
        }
コード例 #5
0
        private void DeleteSB_Click(object sender, EventArgs e)
        {
            WareUnitsLogic units = new WareUnitsLogic(manager);

            units.Delete(Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value));
            manager.Save();
            Fill();
        }
コード例 #6
0
        private void Fill()
        {
            WareUnitsLogic units = new WareUnitsLogic(manager);

            DataGV.AutoGenerateColumns = false;
            DataGV.DataSource          = units.GetAll();
            DataGV.Update();
        }
コード例 #7
0
        private void Fill()
        {
            WareUnitsLogic units = new WareUnitsLogic(manager);

            if (mode == "edit")
            {
                WareUnit unit = units.Get(Convert.ToInt32(id));
                if (unit != null)
                {
                    NameTB.Text = unit.Name;
                }
            }
        }
コード例 #8
0
        private void SaveBt_Click(object sender, EventArgs e)
        {
            WareUnitsLogic units = new WareUnitsLogic(manager);

            if (mode == "new")
            {
                units.Create(NameTB.Text);
            }
            if (mode == "edit")
            {
                units.Update(Convert.ToInt32(id), NameTB.Text);
            }
            manager.Save();

            this.Close();
        }
コード例 #9
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");
            }
        }
コード例 #10
0
ファイル: DocumentDetailsData.cs プロジェクト: rymarrv/Compas
        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");
            }
        }
コード例 #11
0
ファイル: WareFilterUC.cs プロジェクト: rymarrv/Compas
        //public string WareName
        //{
        //    get
        //    {
        //        string result = null;
        //        if (NameTB.Text.Length > 0)
        //        {
        //            result = NameTB.Text;
        //        }
        //        return result;
        //    }
        //}
        public void Fill()
        {
            ItemIntValue none = new ItemIntValue();
            none.ID = -1;
            none.Name = " - не вибрано - ";
            List<ItemIntValue> items0 = new List<ItemIntValue>();

            WareCategoriesLogic categories = new WareCategoriesLogic(manager);
            items0.Clear();
            //items0.Add(none);
            foreach (var a in categories.GetCategoriesHierarchy().OrderBy(a => a.Name))
            {
                ItemIntValue i = new ItemIntValue();
                i.ID = a.ID;
                i.Name = a.Name;
                items0.Add(i);
            }
            CategoriesCB.DataSource = items0;
            CategoriesCB.ValueMember = "ID";
            CategoriesCB.DisplayMember = "Name";
            CategoriesCB.Update();

            WareManufacturersLogic manufacturers = new WareManufacturersLogic(manager);
            List<ItemIntValue> items1 = new List<ItemIntValue>();
            items1.Clear();
            items1.Add(none);
            foreach (var a in manufacturers.GetAll().OrderBy(a => a.Name))
            {
                ItemIntValue i = new ItemIntValue();
                i.ID = a.ID;
                i.Name = a.Name;
                items1.Add(i);
            }
            //ManufacturersCB.DataSource = manufacturers.GetAll();
            ManufacturersCB.DataSource = items1;
            ManufacturersCB.ValueMember = "ID";
            ManufacturersCB.DisplayMember = "Name";
            ManufacturersCB.Update();

            WareUnitsLogic units = new WareUnitsLogic(manager);
            List<ItemIntValue> items2 = new List<ItemIntValue>();
            items2.Clear();
            items2.Add(none);
            foreach (var a in units.GetAll().OrderBy(a => a.Name))
            {
                ItemIntValue i = new ItemIntValue();
                i.ID = a.ID;
                i.Name = a.Name;
                items2.Add(i);
            }
            UnitsCB.DataSource = items2;
            UnitsCB.ValueMember = "ID";
            UnitsCB.DisplayMember = "Name";
            UnitsCB.Update();
        }
コード例 #12
0
ファイル: WareData.cs プロジェクト: rymarrv/Compas
        private void FillUnits()
        {
            ItemIntValue none = new ItemIntValue();
            none.ID = -1;
            none.Name = " - не вибрано - ";

            WareUnitsLogic units = new WareUnitsLogic(manager);
            List<ItemIntValue> items2 = new List<ItemIntValue>();
            items2.Clear();
            items2.Add(none);
            foreach (var a in units.GetAll().OrderBy(a => a.Name))
            {
                ItemIntValue i = new ItemIntValue();
                i.ID = a.ID;
                i.Name = a.Name;
                items2.Add(i);
            }
            UnitsCB.DataSource = items2;
            UnitsCB.ValueMember = "ID";
            UnitsCB.DisplayMember = "Name";
            UnitsCB.Update();
            if(UnitsCB.Items.Count > 1)
                UnitsCB.SelectedIndex = 1;
        }