public BrokerInfo BrokerInfoIDataReader(IDataReader dr)
        {
            BrokerInfo obj = new BrokerInfo();

            obj.BrokerID       = (dr["BrokerID"] is DBNull) ? string.Empty : dr["BrokerID"].ToString();
            obj.Gender         = (dr["Gender"] is DBNull) ? string.Empty : dr["Gender"].ToString();
            obj.Name           = (dr["Name"] is DBNull) ? string.Empty : dr["Name"].ToString();
            obj.Birthday       = (dr["Birthday"] is DBNull) ? string.Empty : dr["Birthday"].ToString();
            obj.IdentityCard   = (dr["IdentityCard"] is DBNull) ? string.Empty : dr["IdentityCard"].ToString();
            obj.About          = (dr["About"] is DBNull) ? string.Empty : dr["About"].ToString();
            obj.Address        = (dr["Address"] is DBNull) ? string.Empty : dr["Address"].ToString();
            obj.HomePhone      = (dr["HomePhone"] is DBNull) ? string.Empty : dr["HomePhone"].ToString();
            obj.MobiPhone      = (dr["MobiPhone"] is DBNull) ? string.Empty : dr["MobiPhone"].ToString();
            obj.Email          = (dr["Email"] is DBNull) ? string.Empty : dr["Email"].ToString();
            obj.PropertyNumber = (dr["PropertyNumber"] is DBNull) ? string.Empty : dr["PropertyNumber"].ToString();
            obj.RealEstateName = (dr["RealEstateName"] is DBNull) ? string.Empty : dr["RealEstateName"].ToString();
            return(obj);
        }
Exemple #2
0
 public bool BrokerInfo_Update(BrokerInfo data)
 {
     using (SqlCommand dbCmd = new SqlCommand("Banner_Update", GetConnection()))
     {
         dbCmd.CommandType = CommandType.StoredProcedure;
         dbCmd.Parameters.Add(new SqlParameter("@BrokerID", data.BrokerID));
         dbCmd.Parameters.Add(new SqlParameter("@Name", data.Name));
         dbCmd.Parameters.Add(new SqlParameter("@Gender", data.Gender));
         dbCmd.Parameters.Add(new SqlParameter("@Birthday", data.Birthday));
         dbCmd.Parameters.Add(new SqlParameter("@About", data.About));
         dbCmd.Parameters.Add(new SqlParameter("@IdentityCard", data.IdentityCard));
         dbCmd.Parameters.Add(new SqlParameter("@Address", data.Address));
         dbCmd.Parameters.Add(new SqlParameter("@HomePhone", data.HomePhone));
         dbCmd.Parameters.Add(new SqlParameter("@MobiPhone", data.MobiPhone));
         dbCmd.Parameters.Add(new SqlParameter("@Email", data.Email));
         dbCmd.Parameters.Add(new SqlParameter("@PropertyNumber", data.PropertyNumber));
         dbCmd.Parameters.Add(new SqlParameter("@RealEstateName", data.RealEstateName));
         dbCmd.ExecuteNonQuery();
     }
     //Clear cache
     System.Web.HttpContext.Current.Cache.Remove("BrokerInfo");
     return(true);
 }