private void butDelete_Click(object sender, EventArgs e)
        {
            if (Supp.IsNew)
            {
                DialogResult = DialogResult.Cancel;
            }
            //if(!MsgBox.){

            //}
            SupplyNeededs.DeleteObject(Supp);
            DialogResult = DialogResult.OK;
        }
 private void butOK_Click(object sender, EventArgs e)
 {
     if (textDate.errorProvider1.GetError(textDate) != "")
     {
         MsgBox.Show(this, "Please fix data entry errors first.");
         return;
     }
     Supp.DateAdded   = PIn.Date(textDate.Text);
     Supp.Description = textDescription.Text;
     if (Supp.IsNew)
     {
         SupplyNeededs.Insert(Supp);
     }
     else
     {
         SupplyNeededs.Update(Supp);
     }
     DialogResult = DialogResult.OK;
 }
Beispiel #3
0
        private void FillGridNeeded()
        {
            listNeeded = SupplyNeededs.CreateObjects();
            gridNeeded.BeginUpdate();
            gridNeeded.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g(this, "Date Added"), 80);

            gridNeeded.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Description"), 300);
            gridNeeded.Columns.Add(col);
            gridNeeded.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < listNeeded.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(listNeeded[i].DateAdded.ToShortDateString());
                row.Cells.Add(listNeeded[i].Description);
                gridNeeded.Rows.Add(row);
            }
            gridNeeded.EndUpdate();
        }