コード例 #1
0
 public void Delete(modelProject project, bool reload = true)
 {
     db.Delete("tblProject", "ID", project);
     if (reload)
     {
         LoadProjects();
     }
 }
コード例 #2
0
        public void prepareMailMergeData(modelProject project)
        {
            mmVariationVars = new List <Dictionary <string, string> >();
            foreach (var variation in Program.GData.dataProject.getProjectVariations.Where(c => c.ProjectID == project.ID))
            {
                var mailMergeVars = new Dictionary <string, string>();
                prepareMailMergeDataVariation(variation, ref mailMergeVars);

                mmVariationVars.Add(mailMergeVars);
            }
        }
コード例 #3
0
 public void Update(modelProject project, bool reload = true)
 {
     if (project.CreatedDate.Year < 2000)
     {
         project.CreatedDate = new DateTime(2000, 1, 1);
     }
     project.UpdatedDate = DateTime.Now;
     db.Update("tblProject", "ID", project);
     if (reload)
     {
         LoadProjects();
     }
 }
コード例 #4
0
 public void Insert(modelProject project, bool reload = true)
 {
     if (project.ID == 0)
     {
         project.ID          = Program.GData.LongID();
         project.CreatedDate = DateTime.Now;
         project.UpdatedDate = DateTime.Now;
     }
     db.Insert("tblProject", "ID", false, project);
     if (reload)
     {
         LoadProjects();
     }
 }
コード例 #5
0
        public formWordTemplateEdit()
        {
            InitializeComponent();
            actualProject = null;

            MMvars  = new modelMailMargeVariables();
            varItem = MMvars.usedVariables;

            panelInsert.Visible = false;
            panelUpdate.Visible = true;
            ibuttonPrev.Visible = false;
            ibuttonNext.Visible = false;
            //DisableButtons();
            FillList();
        }
コード例 #6
0
        public formWordTemplateEdit(modelProject project)
        {
            InitializeComponent();
            actualProject = project;
            MMvars        = new modelMailMargeVariables();
            varItem       = MMvars.usedVariables;
            MMvars.prepareMailMergeData(project);

            panelInsert.Visible = true;
            panelUpdate.Visible = false;
            ibuttonPrev.Visible = true;
            ibuttonNext.Visible = true;
            //DisableButtons();
            //mandateItem = Program.GData.getMandateDataItem(_projvar, _applicant, _partner, _agency);
            FillList();
        }
コード例 #7
0
        public void DeleteProjectWithAllDetails(modelProject proj)
        {
            var variations = getProjectVariations.Where(c => c.ProjectID == proj.ID).Select(c => c.ID).ToArray();

            foreach (var variationID in variations)
            {
                DeleteProjectVaration(variationID);
            }

            var activities = getProjectActivities.Where(c => c.ProjectID == proj.ID).Select(c => c.ID).ToArray();

            foreach (var activity in activities)
            {
                db.Delete("tblProjectActivity", "ID", null, activity);
            }

            db.Delete("tblProject", "ID", null, proj.ID);
        }