HBM.GeneralManagement.GauranteeDAO.Insert C# (CSharp) Method

Insert() public method

public Insert ( Gaurantee gaurantee ) : bool
gaurantee Gaurantee
return bool
        public bool Insert(Gaurantee gaurantee)
        {
            Database db = DatabaseFactory.CreateDatabase(Constants.HBMCONNECTIONSTRING);
            DbCommand command = db.GetStoredProcCommand("usp_GuaranteeInsert");

            db.AddInParameter(command, "@CompanyId", DbType.Int32, gaurantee.CompanyId);
            db.AddInParameter(command, "@GuaranteeName", DbType.String, gaurantee.GuaranteeName);
            db.AddInParameter(command, "@GuaranteeDescription", DbType.String, gaurantee.GuaranteeDescription);
            db.AddInParameter(command, "@CreatedBy", DbType.Int32, gaurantee.CreatedBy);
            db.AddInParameter(command, "@CreatedDate", DbType.DateTime, gaurantee.CreatedDate);

            db.ExecuteNonQuery(command);

            return true;
        }