Example #1
0
        private void EditData()
        {
            int     index   = dataGrid.SelectedRows[0].Index;
            Flaw    temp    = sql.findFlaw(Int32.Parse(dataGrid.Rows[index].Cells[0].Value.ToString()));
            AddFlaw addFlaw = new AddFlaw();

            addFlaw.changeFlaw(temp);
            LoadData();
        }
Example #2
0
 public static FlawViewModel ToViewModel(this Flaw flaw)
 {
     return(new FlawViewModel
     {
         FlawId = flaw.Id,
         Mods = flaw.Mods.Select(sm => sm.ToViewModel()).ToList(),
         Name = flaw.Name,
         Description = flaw.Description,
         Author = flaw.Player?.ToViewModel()
     });
 }
Example #3
0
        public void changeFlaw(Flaw flaw)
        {
            this.flaw          = flaw;
            this.product       = sql.findProduct(flaw.ProductID);
            OrderIDEdit.Text   = product.ID.ToString();
            OrderEdit.Text     = product.Name;
            CountEdit.Value    = flaw.Count;
            SummToPayEdit.Text = flaw.Price.ToString();

            AddBtn.Text   = "Зберегти";
            this.Text     = product.Name;
            AddBtn.Click -= AddBtn_Click;
            AddBtn.Click += SaveBtn_Click;
            this.ShowDialog();
        }
Example #4
0
 public AddFlaw()
 {
     InitializeComponent();
     flaw    = new Flaw();
     product = new Product();
 }