Exemple #1
0
        public bool SavePasswordChange()
        {
            GIDB db           = new GIDB();
            bool bDBIsNothing = db == null;

            if (bDBIsNothing)
            {
                db = new GIDB();
            }
            bool retval = false;

            try
            {
                UserDto obj = this;
                retval         = db.SavePassword(ref obj);
                this.tblUserID = db.Identity;
            }
            catch (Exception ex)
            {
                throw new Exception("UserDto.SavePasswordChange: \r\n" + ex.Message);
            }
            finally
            {
                if (bDBIsNothing)
                {
                    db = null;
                }
            }
            return(retval);
        }
Exemple #2
0
        public bool UpdateActive(GIDB db = null /* TODO Change to default(_) if this is not a reference type */)
        {
            bool bDBIsNothing = db == null;

            if (bDBIsNothing)
            {
                db = new GIDB();
            }
            bool retval = false;

            try
            {
                GrantsDto obj = this;
                retval  = db.UpdateGrantActive(ref obj);
                this.ID = db.Identity;
            }
            catch (Exception ex)
            {
                throw new Exception("GrantsDto.Delete: " + ex.Message + Constants.vbCrLf);
            }

            finally
            {
                if (bDBIsNothing)
                {
                    db = null /* TODO Change to default(_) if this is not a reference type */;
                }
            }

            return(retval);
        }
Exemple #3
0
        public bool Save()
        {
            GIDB db           = new GIDB();
            bool bDBIsNothing = db == null;

            if (bDBIsNothing)
            {
                db = new GIDB();
            }
            bool retval = false;

            try
            {
                SearchGrantsDto obj = this;
                retval  = db.SaveGrantRecords(ref obj);
                this.ID = db.Identity;
            }
            catch (Exception ex)
            {
                throw new Exception("GrantRecordsDto.Save: \r\n" + ex.Message);
            }
            finally
            {
                if (bDBIsNothing)
                {
                    db = null;
                }
            }
            return(retval);
        }
Exemple #4
0
        public void Populate(ref int ID, ref GIDB db)
        {
            bool bDBIsNothing = db == null;

            if (bDBIsNothing)
            {
                db = new GIDB();
            }

            try
            {
                DataSet ds = db.SelectByIDGrants(ID);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    DataRow dr = ds.Tables[0].Rows[0];
                    this.ID                          = dr["ID"];
                    this.GrantID                     = dr["GrantID"];
                    this.ProgramName                 = dr["ProgramName"];
                    this.AgencyName                  = dr["AgencyName"];
                    this.ContactInformation          = dr["ContactInformation"];
                    this.GrantSubject                = dr["GrantSubject"];
                    this.EligibleActivities          = dr["EligibleActivities"];
                    this.LastUpdated                 = dr["LastUpdated"];
                    this.CostShareType               = dr["CostShareType"];
                    this.CostShareDescription        = dr["CostShareDescription"];
                    this.OtherProgramCharacteristics = dr["OtherProgramCharacteristics"];
                    this.ApplicationDueDate          = dr["ApplicationDueDate"];
                    this.DueDate                     = dr["DueDate"];
                    this.ApplicationSubType          = dr["ApplicationSubType"];
                    this.FundingType                 = dr["FundingType"];
                    this.Active                      = dr["Active"];
                    this.CreatedByUserID             = dr["CreatedByUserID"];
                    this.DateCreated                 = dr["DateCreated"];
                    this.LastUpdatedByUserID         = dr["LastUpdatedByUserID"];
                    this.DateLastUpdated             = dr["DateLastUpdated"];
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error GrantsDTO.Populate: \r\n" + ex.Message);
            }
            finally
            {
                if (bDBIsNothing)
                {
                    db = null /* TODO Change to default(_) if this is not a reference type */;
                }
            }
        }
Exemple #5
0
        public void Populate(int ID)
        {
            GIDB db           = new GIDB();
            bool bDBIsNothing = db == null;

            if (bDBIsNothing)
            {
                db = new GIDB();
            }

            try
            {
                DataSet ds = db.SelectByIDUsers(ID);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    DataRow dr = ds.Tables[0].Rows[0];
                    this.tblUserID             = Convert.ToInt32(dr["tblUserID"]);
                    this.Email                 = Convert.ToString(dr["Email"]);
                    this.Alias                 = Convert.ToString(dr["Alias"]);
                    this.FirstName             = Convert.ToString(dr["FirstName"]);
                    this.LastName              = Convert.ToString(dr["LastName"]);
                    this.luRoleID              = Convert.ToInt32(dr["luRoleID"]);
                    this.OrganizationShortName = Convert.ToString(dr["OrganizationShortName"]);
                    this.OrganizationFullName  = Convert.ToString(dr["OrganizationFullName"]);
                    this.Active                = Convert.ToBoolean(dr["Active"]);
                    this.CreatedByUserID       = Convert.ToString(dr["CreatedByUserID"]);
                    this.DateCreated           = Convert.ToDateTime(dr["DateCreated"]);
                    this.LastUpdatedByUserID   = Convert.ToString(dr["LastUpdatedByUserID"]);
                    this.DateLastUpdated       = Convert.ToDateTime(dr["DateLastUpdated"]);
                    this.Verified              = Convert.ToBoolean(dr["Verified"]);
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error UserDTO.Populate: \r\n" + ex.Message);
            }
            finally
            {
                if (bDBIsNothing)
                {
                    db = null;
                }
            }
        }