示例#1
0
 public static bool altaMateria(Business.Entities.Materia ma, string nombrePlan)
 {
     Business.Entities.Plan plan = ABMplan.buscarPlan(nombrePlan);
     if (plan != null)
     {
         ma.agregarPlan(plan);
         Data.Database.Materias.getInstance().altaMateria(ma);
         return(true);
     }
     else
     {
         return(false);
     }
 }
示例#2
0
 public static bool modificarMateria(Business.Entities.Materia mat)
 {
     if (mat.HorasSemanales < mat.HorasTotales)
     {
         Business.Entities.Plan plan = Business.Logic.ABMplan.buscarPlanPorId(mat.Plan.IdPlan);
         if (plan != null)
         {
             Business.Entities.Materia mate = buscarMateriaPorNombre(mat.Nombre);
             if (mate == null || mate.IdMateria == mat.IdMateria)
             {
                 return(Data.Database.MateriaDB.getInstance().modificarMateria(mat));
             }
         }
     }
     return(false);
 }
示例#3
0
 protected void modi()
 {
     try
     {
         DataGridViewRow            row    = grd_view.CurrentRow;
         DataGridViewCellCollection celdas = row.Cells;
         Business.Entities.Plan     pl     = new Business.Entities.Plan(celdas["nombrePlan"].Value.ToString(),
                                                                        celdas["descripcionPlan"].Value.ToString()
                                                                        );
         pl.IdPlan = (int)celdas["idPlan"].Value;
         new frm_AltaPlan(pl).ShowDialog();
         grd_view.DataSource = Business.Logic.ABMplan.listarPlanes();
     }
     catch (NullReferenceException ex)
     {
         MessageBox.Show("No ha seleccionado ningun plan", "Cuidado", MessageBoxButtons.OK);
     }
 }
        public frmAddExistingItem(frmMain mf, string _FormType, Guid RegardingId1, string RegardingId2, FormClosedEventHandler Close)
        {
            Presentation.Forms.frmSplashScreen ss = new Presentation.Forms.frmSplashScreen();
            ss.Show();
            Application.DoEvents();

            InitializeComponent();
            frmMain_Parent = mf;

            Application.AddMessageFilter(this);
            controlsToMove.Add(this.label1);
            controlsToMove.Add(this.label23);
            controlsToMove.Add(this.panel2);
            controlsToMove.Add(this.panel16);
            controlsToMove.Add(this.pictureBox1);

            this.FormClosed += Close;

            FormType = _FormType;

            if (FormType == "Custodian")
            {
                FormType = "Custodian";

                label23.Text         = "Add a custodian";
                labelRegarding1.Text = "Plan";
                label31.Text         = "Select a custodian";

                try
                {
                    Business.Entities.Plan plan = new Business.Entities.Plan(RegardingId1);
                    PlanId        = plan.PlanId;
                    textBox7.Text = plan.PlanName;
                }
                catch (Exception ex)
                {
                    frmError _frmError = new Presentation.Forms.frmError(frmMain_Parent, ex);
                }
            }
            else if (FormType == "Plan")
            {
                FormType = "Plan";

                label23.Text         = "Add a plan";
                labelRegarding1.Text = "Fund";
                label31.Text         = "Select a plan";

                try
                {
                    Fund details = new Fund(RegardingId1, null);
                    FundId        = details.FundId;
                    textBox7.Text = details.FundName;
                }
                catch (Exception ex)
                {
                    frmError _frmError = new Presentation.Forms.frmError(frmMain_Parent, ex);
                }
            }
            else if (FormType == "Fund")
            {
                FormType = "Fund";

                label23.Text         = "Add a fund";
                labelRegarding1.Text = "Plan";
                label31.Text         = "Select a fund";

                try
                {
                    Business.Entities.Plan plan = new Business.Entities.Plan(RegardingId1);
                    PlanId        = plan.PlanId;
                    textBox7.Text = plan.PlanName;
                }
                catch (Exception ex)
                {
                    frmError _frmError = new Presentation.Forms.frmError(frmMain_Parent, ex);
                }
            }

            ss.Close();
            this.Show();
            txtSearch.Select();
        }