Beispiel #1
0
        public bool AddMesgBendInfo(Tinfo model)
        {
            var          result             = false;
            const string AddMesgBendInfosql = @"
                               INSERT INTO dbo.Tinfo
                                        ( InfoTital, InfoName,InfoBody,InfoSetTime) 
                                VALUES  ( @InfoTital, 
                                          @InfoName,
                                          @InfoBody,
                                          @InfoSetTime
                                    ) ";


            try
            {
                using (DbConnection conn = DbFactory.CreateConnection())
                {
                    result = conn.Execute(AddMesgBendInfosql, model) > 0;
                    return(result);
                }
            }
            catch (System.Exception ex)
            {
                throw;
            }

            //SqlParameter[] para = new SqlParameter[]
            //{
            //    new SqlParameter("UserName",model.UserName),
            //    new SqlParameter("PassWord", model.PassWord)
            //    };
            //sqlh.ExecData(adduserMSGSql, para);
            //base.Excute();
            //return result;
        }
Beispiel #2
0
        public bool AddMesgBendInfo(Tinfo model)
        {
            var NowTime = DateTime.Now;

            model.InfoSetTime = NowTime;
            return(bendinfoDal.AddMesgBendInfo(model));
        }
Beispiel #3
0
        public ActionResult EditorBendInfoMSG(Tinfo model)
        {
            var result = false;

            result = _bendinfoBll.UpdateMesgBendInfo(model);
            return(RedirectToAction("BendInfoIndex", "BendInfo"));
        }
Beispiel #4
0
        public bool UpdateMesgBendInfo(Tinfo model)
        {
            const string update_MesgBendInfoSql = @"
				UPDATE dbo.Tinfo
				SET	InfoTital=@InfoTital,
					InfoName=@InfoName,
					InfoBody=@InfoBody,
                    InfoSetTime=@InfoSetTime
				WHERE ID=@ID"                ;

            using (DbConnection conn = DbFactory.CreateConnection())
            {
                var result = conn.Execute(update_MesgBendInfoSql, model) > 0;
                return(result);
            }
        }
Beispiel #5
0
 public bool UpdateMesgBendInfo(Tinfo model)
 {
     return(bendinfoDal.UpdateMesgBendInfo(model));
 }