Beispiel #1
0
        protected void btnSaveEstimation_OnClick(object sender, EventArgs e)
        {
            var projectId        = _projId;
            var userId           = _userId;
            var projectParamater = new ProjectProjection();

            var accomodation   = accommodation;
            var vehicleDeatils = vehicle;
            var employ         = employees;
            var printMaterial  = material;
            var refresh        = refreshment;
            var fieldWork      = fieldwork;
            var teleph         = telephone;

            projectParamater.proj_id        = (int)projectId;
            projectParamater.employees      = employ.Text;
            projectParamater.vehicle        = vehicleDeatils.Text;
            projectParamater.accomodation   = accomodation.Text;
            projectParamater.print_material = printMaterial.Text;
            projectParamater.refreshments   = refresh.Text;
            projectParamater.telephone      = teleph.Text;
            projectParamater.wifi_data      = fieldWork.Text;
            projectParamater.user_id        = userId;
            projectParamater.created_at     = DateTime.Today;
            projectParamater.modified_at    = DateTime.Today;

            _insedlu.ProjectProjections.Add(projectParamater);

            _insedlu.SaveChangesAsync();
            MakeReadOnly();
        }
Beispiel #2
0
        protected void SubmitButton_OnClick(object sender, EventArgs e)
        {
            var createdDate = DateTime.Now;
            var modifiedAt  = DateTime.Now;
            var conclution  = conclusion.Content;

            var newProj = new Project
            {
                created_at  = createdDate,
                modified_at = modifiedAt,
                description = descriptionPro.Text,
                name        = ProjName.Value,
                status      = EntityStatus.Active.GetHashCode(),
                conclusion  = conclution
            };

            _insendluEntities.Projects.Add(newProj);
            var projId = _insendluEntities.SaveChanges();

            if (projId == 1)
            {
                var newId = newProj.id;

                var executiveSummary = execSummary.Content;
                var id = Executive(executiveSummary, newId);

                var company   = companyBackground.Content;
                var companyId = GetCompany(company, newId);

                //var dpwProperty = dpw.Content;
                //var methId = GetDpw(dpwProperty, newId);

                var methodology = propMethodology.Content;
                var methodoId   = GetMethodology(methodology, newId);


                var costPlanV  = costPlan.Content;
                var costPlanId = GetProjectCostPlan(costPlanV, newId);

                //var bee = whyChoose.Content;
                //var companyId = GetCompanyDetails(bee, newId);

                var projAnalysis = riskanalysis.Content;
                var analysisId   = GetProjectAnalysis(projAnalysis, newId);

                var resources = resource.Content;

                var updateProject = (from pr in _insendluEntities.Projects
                                     where pr.id == newId
                                     select pr).Single();

                if (updateProject != null)
                {
                    updateProject.cost_plan_id    = costPlanId;
                    updateProject.company_id      = companyId;
                    updateProject.exec_summary_id = id;
                    updateProject.methodology_id  = methodoId;
                    updateProject.policy_id       = analysisId;

                    _insendluEntities.SaveChangesAsync();

                    SaveProject(updateProject);
                }
            }
        }