Exemple #1
0
        public bool Update(ProposalTrackerEntity entity)
        {
            BaseValidator <ProposalTrackerEntity> validator = new AddProposalTrackerValidator();

            if (entity.ProjectID == 0)
            {
                this.AddBrokenRuleMessage("Project", "Please select Project");
                return(false);
            }
            if (string.IsNullOrEmpty(entity.Title))
            {
                this.AddBrokenRuleMessage("Title", "Please input Title");
                return(false);
            }
            if (entity.Description.Length > 500)
            {
                this.AddBrokenRuleMessage("Description", "Please input Description in 500 words");
                return(false);
            }
            bool result = proposalTrackerRepository.Update(entity);

            if (!result)
            {
                this.AddBrokenRuleMessage();
                return(false);
            }
            return(result);
        }
Exemple #2
0
        public int Add(ProposalTrackerEntity entity)
        {
            BaseValidator <ProposalTrackerEntity> validator = new AddProposalTrackerValidator();

            if (entity.ProjectID == 0)
            {
                this.AddBrokenRuleMessage("Project", "Please select Project");
                return(0);
            }

            if (string.IsNullOrEmpty(entity.Title))
            {
                this.AddBrokenRuleMessage("Title", "Please input Title");
                return(0);
            }
            //if (string.IsNullOrEmpty(entity.WorkScope))
            //{
            //    this.AddBrokenRuleMessage("WorkScope", "Please select WorkScope");
            //    return 0;
            //}
            if (entity.Description.Length > 500)
            {
                this.AddBrokenRuleMessage("Description", "Please input Description in 500 words");
                return(0);
            }
            //if (!validator.Validate(entity))
            //{
            //    this.AddBrokenRuleMessages(validator.BrokenRuleMessages);
            //    return 0;
            //}
            int id = proposalTrackerRepository.Insert(entity);

            if (id <= 0)
            {
                this.AddBrokenRuleMessage();
                return(0);
            }
            return(id);
        }
Exemple #3
0
        public bool UpdateProposalTrackerForPayment(ProposalTrackerEntity entity, string connStr)
        {
            BaseValidator <ProposalTrackerEntity> validator = new AddProposalTrackerValidator();

            return(proposalTrackerRepository.UpdateProposalTrackerForPayment(entity, connStr));
        }