public T_BusinessConsulting GetModel(int id)
        {
            T_BusinessConsulting model = null;
            string strSql = string.Format("select  top 1 Id,UserName,UserAddress,UserTel,UserEmail,ConsTitle,ConsContent,ConsDate,ReplyContent,ReplyDate,ReplyUser from T_BusinessConsulting  where Id={0}", id);

            using (dynamic read = DbHelper.Factory().ExecuteReader(strSql))
            {
                model = new T_BusinessConsulting();
                if (read.Read())
                {
                    model.Id          = int.Parse(read["Id"].ToString());
                    model.UserName    = read["UserName"].ToString();
                    model.UserAddress = read["UserAddress"].ToString();
                    model.UserTel     = read["UserTel"].ToString();
                    model.UserEmail   = read["UserEmail"].ToString();
                    model.ConsTitle   = read["ConsTitle"].ToString();
                    model.ConsContent = read["ConsContent"].ToString();
                    try { model.ConsDate = DateTime.Parse(read["ConsDate"].ToString()); }
                    catch { }
                    model.ReplyContent = read["ReplyContent"].ToString();
                    try { model.ReplyDate = DateTime.Parse(read["ReplyDate"].ToString()); }
                    catch { }
                    model.ReplyUser = read["ReplyUser"].ToString();
                }
                read.Dispose();
            }
            return(model);
        }
 private string Update(T_BusinessConsulting model)
 {
     try
     {
         if (dal.Update(model))
         {
             return("业务咨询信息修改成功!");
         }
         else
         {
             return("业务咨询信息修改失败,错误代码:500 ");
         }
     }
     catch { return("Error 500"); }
 }
 //
 public bool Update(T_BusinessConsulting model)
 {
     try
     {
         object[] obj    = { model.ReplyContent, model.ReplyDate.ToString("yyyy-MM-dd HH:mm:ss"), model.ReplyUser, model.Id, model.BusinsessState };
         string   strSql = string.Format("update [T_BusinessConsulting] set [ReplyContent] ='{0}',[ReplyDate] ='{1}',[ReplyUser] ='{2}',BusinsessState='{4}' where [Id]={3} ", obj);
         if (DbHelper.Factory().ExecuteNonQuery(strSql) > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch { throw; }
 }
 //
 public bool Create(T_BusinessConsulting model)
 {
     try
     {
         object[] obj    = { model.UserName, model.UserAddress, model.UserTel, model.UserEmail, model.ConsTitle, model.ConsContent, model.ConsDate.ToString("yyyy-MM-dd HH:mm:ss"), model.ReplyContent, model.ReplyDate.ToString("yyyy-MM-dd HH:mm:ss"), model.ReplyUser, model.BusinessType };
         string   strSql = string.Format("insert into [T_BusinessConsulting]([UserName],[UserAddress],[UserTel],[UserEmail],[ConsTitle],[ConsContent],[ConsDate],[ReplyContent],[ReplyDate],[ReplyUser],BusinessType)values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}')", obj);
         if (DbHelper.Factory().ExecuteNonQuery(strSql) > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch { throw; }
 }
        private T_BusinessConsulting GetModel(HttpContext context)
        {
            T_BusinessConsulting model = new T_BusinessConsulting();

            try { model.Id = int.Parse(context.Request.Form["Id"].ToString()); }
            catch { }
            model.UserName    = context.Request.Form["UserName"].ToString();
            model.UserAddress = context.Request.Form["UserAddress"].ToString();
            model.UserTel     = context.Request.Form["UserTel"].ToString();
            model.UserEmail   = context.Request.Form["UserEmail"].ToString();
            model.ConsTitle   = context.Request.Form["ConsTitle"].ToString();
            model.ConsContent = context.Request.Form["ConsContent"].ToString();
            try { model.ConsDate = DateTime.Parse(context.Request.Form["ConsDate"].ToString()); }
            catch { }
            model.ReplyContent = context.Request.Form["ReplyContent"].ToString();
            try { model.ReplyDate = DateTime.Parse(context.Request.Form["ReplyDate"].ToString()); }
            catch { }
            model.ReplyUser      = context.Request.Form["ReplyUser"].ToString();
            model.BusinsessState = "1";
            return(model);
        }
 public void Add(T_BusinessConsulting model)
 {
     dal.Create(model);
 }