示例#1
0
        private void LoadGridCPVOznake()
        {
            BusinessLogic.CPVOznake cpv_oznake = new BusinessLogic.CPVOznake();

            ugdCPVOznake.DataSource = cpv_oznake.GetCPVOznakeMainGrid();
            ugdCPVOznake.DataBind();
            Utils.Tools.UltraGridStyling(ugdCPVOznake);

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

                if (MessageBox.Show(string.Format("Obrisati CPV oznaku '{0}-{1}'?", BusinessLogic.CPVOznake.pID, ugdCPVOznake.ActiveRow.Cells["Naziv"].Value),
                                    "Brisanje CPV oznake", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    BusinessLogic.CPVOznake cpv_oznake = new BusinessLogic.CPVOznake();
                    if (!cpv_oznake.Delete())
                    {
                        MessageBox.Show("Dogodila se greška prilikom brisanja CPV oznake.\nKontaktirajte administratora [Error:00006]");
                    }
                    LoadGridCPVOznake();
                }
            }
        }
示例#3
0
        private bool SaveData()
        {
            lblValidationMessages.ResetText();

            BusinessLogic.CPVOznake cpv_oznake = new BusinessLogic.CPVOznake();

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