private bool SaveData() { lblValidationMessages.ResetText(); BusinessLogic.NacinPlacanja.pNaziv = BusinessLogic.NacinPlacanja.IsDbNull <string>(uteNaziv.Value); StringBuilder message = ValidateDataInput(); if (message.Length == 0) { BusinessLogic.NacinPlacanja objekt = new BusinessLogic.NacinPlacanja(); if (FormEditMode == Enums.FormEditMode.Insert || FormEditMode == Enums.FormEditMode.Copy) { if (objekt.Insert(message)) { FormEditMode = Enums.FormEditMode.Update; return(true); } } else if (this.FormEditMode == Enums.FormEditMode.Update) { if (objekt.Update(message)) { return(true); } } } lblValidationMessages.Text = message.ToString(); return(false); }
private void LoadGridNacinPlacanja() { BusinessLogic.NacinPlacanja objekt = new BusinessLogic.NacinPlacanja(); ugdNacinPlacanja.DataSource = objekt.GetNacinPlacanjaMainGrid(); ugdNacinPlacanja.DataBind(); Utils.Tools.UltraGridStyling(ugdNacinPlacanja); foreach (UltraGridRow row in ugdNacinPlacanja.Rows) { if (row.Index == BusinessLogic.NacinPlacanja.pSelectedIndex) { ugdNacinPlacanja.ActiveRow = row; } } }
public void Delete(object sender, EventArgs e) { if (ugdNacinPlacanja.ActiveRow != null) { BusinessLogic.NacinPlacanja.pID = Convert.ToInt32(ugdNacinPlacanja.ActiveRow.Cells["ID"].Value); if (MessageBox.Show(string.Format("Obrisati nacin placanja '{0}-{1}'?", BusinessLogic.CPVOznake.pID, ugdNacinPlacanja.ActiveRow.Cells["Naziv"].Value), "Brisanje nacina placanja", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { BusinessLogic.NacinPlacanja objekt = new BusinessLogic.NacinPlacanja(); if (!objekt.Delete()) { MessageBox.Show("Dogodila se greška prilikom brisanja načina plačanja.\nKontaktirajte administratora [Error:00021]"); } LoadGridNacinPlacanja(); } } }