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

Insert() public method

public Insert ( Company company ) : bool
company Company
return bool
        public bool Insert(Company company)
        {
            Database db = DatabaseFactory.CreateDatabase(Constants.HBMCONNECTIONSTRING);
            DbCommand command = db.GetStoredProcCommand("usp_CompanyInsert");

            db.AddInParameter(command, "@CompanyName", DbType.String, company.CompanyName);
            db.AddInParameter(command, "@CompanyAddress", DbType.String, company.CompanyAddress);
            db.AddInParameter(command, "@CompanyCity", DbType.String, company.CompanyCity);
            db.AddInParameter(command, "@CompanyEmail", DbType.String, company.CompanyEmail);
            db.AddInParameter(command, "@CompanyTelephone", DbType.String, company.CompanyTelephone);
            db.AddInParameter(command, "@CompanyTypeId", DbType.Int32, company.CompanyTypeId);
            db.AddInParameter(command, "@CreatedUser", DbType.Int32, company.CreatedUser);
            db.AddInParameter(command, "@StatusId", DbType.Int32, company.StatusId);
            db.AddInParameter(command, "@CompanyFax", DbType.String, company.CompanyFax);
            db.AddInParameter(command, "@CompanyLogo", DbType.Binary, company.CompanyLogo);
            db.AddInParameter(command, "@WebURL", DbType.String, company.WebURL);
            db.AddInParameter(command, "@RegistrationNo", DbType.String, company.RegistrationNo);
            db.AddInParameter(command, "@VATNo", DbType.String, company.VATNo);
            db.AddInParameter(command, "@AdditionalDetails1", DbType.String, company.AdditionalDetails1);
            db.AddInParameter(command, "@AdditionalDetails2", DbType.String, company.AdditionalDetails2);

            db.ExecuteNonQuery(command);

            return true;
        }