示例#1
0
        private void LoadGridVrsteNabave()
        {
            BusinessLogic.VrsteNabave vrste_nabave = new BusinessLogic.VrsteNabave();

            ugdVrsteNabave.DataSource = vrste_nabave.GetVrsteNabaveMainGrid();
            ugdVrsteNabave.DataBind();
            Utils.Tools.UltraGridStyling(ugdVrsteNabave);

            foreach (UltraGridRow row in ugdVrsteNabave.Rows)
            {
                if (row.Index == BusinessLogic.VrsteNabave.pSelectedIndex)
                {
                    ugdVrsteNabave.ActiveRow = row;
                }
            }
        }
示例#2
0
        public void Delete(object sender, EventArgs e)
        {
            if (ugdVrsteNabave.ActiveRow != null)
            {
                BusinessLogic.VrsteNabave.pID = Convert.ToInt32(ugdVrsteNabave.ActiveRow.Cells["ID"].Value);

                if (MessageBox.Show(string.Format("Obrisati vrstu nabave '{0}-{1}'?", BusinessLogic.CPVOznake.pID, ugdVrsteNabave.ActiveRow.Cells["Naziv"].Value),
                                    "Brisanje Vrste nabave", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    BusinessLogic.VrsteNabave vrste_nabave = new BusinessLogic.VrsteNabave();
                    if (!vrste_nabave.Delete())
                    {
                        MessageBox.Show("Dogodila se greška prilikom brisanja vrste nabave.\nKontaktirajte administratora [Error:00008]");
                    }
                    LoadGridVrsteNabave();
                }
            }
        }
示例#3
0
        private bool SaveData()
        {
            lblValidationMessages.ResetText();

            BusinessLogic.VrsteNabave vrste_nabave = new BusinessLogic.VrsteNabave();

            if (FormEditMode == Enums.FormEditMode.Insert || FormEditMode == Enums.FormEditMode.Copy)
            {
                if (vrste_nabave.Insert())
                {
                    FormEditMode = Enums.FormEditMode.Update;
                    return(true);
                }
            }
            else if (this.FormEditMode == Enums.FormEditMode.Update)
            {
                if (vrste_nabave.Update())
                {
                    return(true);
                }
            }
            return(false);
        }