Exemplo n.º 1
0
 private void DeleteSB_Click(object sender, EventArgs e)
 {
     WarePriceGroupsLogic groups = new WarePriceGroupsLogic(manager);
     groups.Delete(Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value));
     manager.Save();
     Fill();
 }
Exemplo n.º 2
0
 private void Fill()
 {
     WarePriceGroupsLogic groups = new WarePriceGroupsLogic(manager);
     DataGV.AutoGenerateColumns = false;
     DataGV.DataSource = groups.GetAll();
     DataGV.Update();
 }
Exemplo n.º 3
0
        private void DeleteSB_Click(object sender, EventArgs e)
        {
            WarePriceGroupsLogic groups = new WarePriceGroupsLogic(manager);

            groups.Delete(Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value));
            manager.Save();
            Fill();
        }
Exemplo n.º 4
0
        private void Fill()
        {
            WarePriceGroupsLogic groups = new WarePriceGroupsLogic(manager);

            DataGV.AutoGenerateColumns = false;
            DataGV.DataSource          = groups.GetAll();
            DataGV.Update();
        }
Exemplo n.º 5
0
        private void FillPriceGroups()
        {
            WarePriceGroupsLogic groups = new WarePriceGroupsLogic(manager);

            PriceGroupsCB.DataSource    = groups.GetAll();
            PriceGroupsCB.ValueMember   = "ID";
            PriceGroupsCB.DisplayMember = "Name";
        }
Exemplo n.º 6
0
        private void Fill()
        {
            WarePriceGroupsLogic groups = new WarePriceGroupsLogic(manager);

            if (mode == "edit")
            {
                WarePriceGroup group = groups.Get(Convert.ToInt32(id));
                if (group != null)
                {
                    NameTB.Text = group.Name;
                    DefaultExtraPercentNUD.Value = Convert.ToInt32(group.DefaultExtraPercent);
                    ActiveCB.Checked = group.Active;
                }
            }
        }
Exemplo n.º 7
0
        private void Fill()
        {
            WarePriceGroupsLogic groups = new WarePriceGroupsLogic(manager);

            if (mode == "edit")
            {
                WarePriceGroup group = groups.Get(Convert.ToInt32(id));
                if (group != null)
                {
                    NameTB.Text = group.Name;
                    DefaultExtraPercentNUD.Value = Convert.ToInt32(group.DefaultExtraPercent);
                    ActiveCB.Checked             = group.Active;
                }
            }
        }
Exemplo n.º 8
0
        private void SaveBt_Click(object sender, EventArgs e)
        {
            WarePriceGroupsLogic groups = new WarePriceGroupsLogic(manager);

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

            this.Close();
        }
Exemplo n.º 9
0
        private void SaveBt_Click(object sender, EventArgs e)
        {
            WarePriceGroupsLogic groups = new WarePriceGroupsLogic(manager);

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

            this.Close();
        }
Exemplo n.º 10
0
        private void FillPriceGroups()
        {
            WarePriceGroupsLogic priceGroups = new WarePriceGroupsLogic(manager);

            //SortableBindingList<WarePriceGroup>  view = new SortableBindingList<WarePriceGroup>(viewList);
            if (WareLUE.EditValue != null)
            {
                int wareId = ((int)(WareLUE.EditValue));
                PriceGroupsCBE.Properties.DataSource    = priceGroups.GetAll(wareId);
                PriceGroupsCBE.Properties.ValueMember   = "ID";
                PriceGroupsCBE.Properties.DisplayMember = "Name";

                WarePriceGroup priceGroup = priceGroups.GetAll(wareId).FirstOrDefault();
                if ((priceGroup != null) & (mode == "new"))
                {
                    PriceGroupsCBE.EditValue = priceGroup.ID;
                }
                //PriceGroupsCBE.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", 0, "Назва"));
            }
        }
Exemplo n.º 11
0
 private void FillPriceGroups()
 {
     WarePriceGroupsLogic groups = new WarePriceGroupsLogic(manager);
     PriceGroupsCB.DataSource = groups.GetAll();
     PriceGroupsCB.ValueMember = "ID";
     PriceGroupsCB.DisplayMember = "Name";
 }
Exemplo n.º 12
0
        private void FillPriceGroups()
        {
            WarePriceGroupsLogic priceGroups = new WarePriceGroupsLogic(manager);
            //SortableBindingList<WarePriceGroup>  view = new SortableBindingList<WarePriceGroup>(viewList);
            if (WareLUE.EditValue != null)
            {
                int wareId = ((int)(WareLUE.EditValue));
                PriceGroupsCBE.Properties.DataSource = priceGroups.GetAll(wareId);
                PriceGroupsCBE.Properties.ValueMember = "ID";
                PriceGroupsCBE.Properties.DisplayMember = "Name";

                WarePriceGroup priceGroup = priceGroups.GetAll(wareId).FirstOrDefault();
                if ((priceGroup != null) & (mode == "new"))
                {
                    PriceGroupsCBE.EditValue = priceGroup.ID;
                }
                //PriceGroupsCBE.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", 0, "Назва"));
            }
        }