Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        public bool SaveGrantRecords(ref SearchGrantsDto dto)
        {
            SQLParamCollection p = new SQLParamCollection();

            p.AddWithValue("@ID", dto.ID);
            p.AddWithValue("@tblUserID", dto.tblUserID);
            p.AddWithValue("@moreInfoID", dto.moreInfoID);
            p.AddWithValue("@IdentityVal", 0, SqlDbType.Int, ParameterDirection.Output);

            return(SaveCommand("SaveGrantRecords", p));
        }