コード例 #1
0
        public int CreateNewProposal(int OrgID, string projtitle, string projectlabel)
        {
            //check if such label exists first.
            if (!projrepository.CheckifSuchProjectLabelExists(projectlabel))
            {
                int ProjectID = projrepository.CreateNewProposal(OrgID, projtitle, projectlabel);

                if (ProjectID > 0)
                {
                    //Update to First Selected Values of DropDowns.
                    //1. ProposalStatus
                    bool propstatus = UpdateToFirstDefaultProposalStatus(ProjectID);
                    //2. CompetitionCode
                    bool compcode = UpdateToFirstDefaultCompetitionCode(ProjectID);
                    //3. GrantType
                    bool granttype = UpdateToFirstDefaultGrantType(ProjectID);
                    //4. ProgramArea
                    bool programarea = UpdateToFirstDefaultProgramArea(ProjectID);
                    //Insert default Legal Address...Reports require this.
                    bool LegalAddress = InsertDefaultLegalAddressIntoNewProject(OrgID);
                }

                bool updated = true; // ProposalInfoUpdate(NewProject);

                if (updated)
                {
                    return(ProjectID);
                }
                else
                {
                    return(-2);
                }
            }
            else
            {
                return(-2); //such label already exists.
            }
        }