Exemplo n.º 1
0
        //Update Application(Send all application details from Presentation layer to data access layer for Updation)
        public bool Update(int updateapid, Application ap)
        {
            if (ap.FullName.Length > 20)
            {
                throw new UniversityException("Character length Exceeded in Name");
            }
            if (ap.HighestQualification.Length > 10)
            {
                throw new UniversityException("Character length Exceeded in qualification");
            }
            if (ap.Goals.Length > 20)
            {
                throw new UniversityException("Character length Exceeded in Goals");
            }
            if (ap.Email_Id.Length > 20)
            {
                throw new UniversityException("Character length Exceeded in Email");
            }
            if (ap.Scheduled_ProgramId.Length > 20)
            {
                throw new UniversityException("Character length Exceeded in scheduled program id");
            }
            if (ap.Status.Length > 20)
            {
                if (ap.Scheduled_ProgramId.Length > 20)
                {
                    throw new UniversityException("character length Exceeded in status");
                }
            }
            bool updt = false;

            //  ApplicationDAL app = new ApplicationDAL();
            DalObject.Update(updateapid, ap.FullName, ap.DOB, ap.HighestQualification, ap.MarksObtained, ap.Goals, ap.Email_Id, ap.Scheduled_ProgramId, ap.Status, ap.DateOFInterview);
            updt = true;
            if (updt == false)
            {
                throw new UniversityException("Updation is Failed");
            }

            return(updt);
        }
Exemplo n.º 2
0
        public IApplication Update(IApplication instance, string id, string customerId, string region, DateTime?dateApplied, DateTime?dateTraved, string offNoteNo, DateTime?offNoteDate, string remark)
        {
            using (var cmd = new DBCommand())
            {
                try
                {
                    ApplicationDAL.Update(cmd, instance, id, customerId, region, dateApplied, dateTraved, offNoteNo,
                                          offNoteDate, remark);

                    cmd.Commit();
                    return(instance);
                }
                catch (Exception ex)
                {
                    cmd.RollBack();
                    using (var builder = new MessageBuilder())
                    {
                        string err = builder.AppendLine("更新申请单错误!").AppendLine(ex).Message;
                        throw new Exception(err);
                    }
                }
            }
        }