예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="estate"></param>
        /// <returns></returns>
        public int UpdateEstate(CentaEstateType estate)
        {
            string funMsg        = "function: UpdateEstate(CentaEstateType estate)" + FileUtility.NewLine + _ClassMsg;
            string procedureName = string.Empty;

            try
            {
                procedureName = "sp_updest";//"spUpdateEstate";
                return(DbUtility.ExecuteNonQueryByProc(procedureName, this._CentaDbConn, new SqlParameter[] {
                    new SqlParameter {
                        ParameterName = "@scopeId", SqlDbType = SqlDbType.NVarChar, Value = estate.ScopeId
                    },
                    new SqlParameter {
                        ParameterName = "@estateId", SqlDbType = SqlDbType.NVarChar, Value = estate.EstateId
                    },
                    new SqlParameter {
                        ParameterName = "@estateName", SqlDbType = SqlDbType.NVarChar, Value = estate.EstateName
                    },
                    new SqlParameter {
                        ParameterName = "@estateType", SqlDbType = SqlDbType.NVarChar, Value = estate.EstateType
                    },
                    new SqlParameter {
                        ParameterName = "@address", SqlDbType = SqlDbType.NVarChar, Value = estate.Address
                    },
                    new SqlParameter {
                        ParameterName = "@phase", SqlDbType = SqlDbType.NVarChar, Value = estate.Phase
                    }
                }));
            }
            catch (Exception ex)
            {
                string exMsg = "Exception: " + ex.Message + FileUtility.NewLine + "ProcedureName: " + procedureName + FileUtility.NewLine + funMsg;
                throw new Exception(exMsg, ex.InnerException);
            }
        }
        public bool UpdateEstate(CentaEstateType estate)
        {
            string funMsg = "function: UpdateEstate(CentaEstateType estate)" + FileUtility.NewLine + _ClassMsg;

            try
            {
                int effected = _DbService.UpdateEstate(estate);
                if (effected > 0)
                {
                    return(true);
                }
                return(false);
            }
            catch (Exception ex)
            {
                string exMsg = "Exception: " + ex.Message + FileUtility.NewLine + funMsg;
                throw new Exception(exMsg, ex.InnerException);
            }
        }