Example #1
0
        //更新来访信息
        public int UpdateVisitingDAL(Model.Visiting vis)
        {
            string sql = "update [Visiting] set [State]=0";

            if (!string.IsNullOrEmpty(vis.dormitoryID.ToString()))
            {
                sql += ",[dormitoryID]='" + vis.dormitoryID + "'";
            }

            if (!string.IsNullOrEmpty(vis.VisitingName))
            {
                sql += ",[VisitingName]='" + vis.VisitingName + "'";
            }

            if (!string.IsNullOrEmpty(vis.VisitingTime.ToString()))
            {
                sql += ",[VisitingTime]='" + vis.VisitingTime + "'";
            }

            if (!string.IsNullOrEmpty(vis.LikaiTime.ToString()))
            {
                sql += ",[LikaiTime]='" + vis.LikaiTime + "'";
            }

            sql += " where [VisitingID]=" + vis.VisitingID;
            return(DBHelper.ExecQuery(sql));
        }
Example #2
0
        //添加来访信息
        public int InsertVisitingBLL(Model.Visiting vis)
        {
            if (!new VisitingRule().TestInsert(vis.VisitingID))
            {
                return(-3);
            }

            return(new DAL.VisitingDAL().InsertVisitingDAL(vis));
        }
Example #3
0
 //更新来访信息
 public string UpdateVisitingBLL(Model.Visiting vis)
 {
     return(Option(new DAL.VisitingDAL().UpdateVisitingDAL(vis), "更新"));
 }
Example #4
0
        //添加来访信息

        public int InsertVisitingDAL(Model.Visiting vis)
        {
            return(DBHelper.ExecQuery("insert into [Visiting] ([dormitoryID],[VisitingName],[VisitingTime],[LikaiTime],[State]) values('" + vis.dormitoryID + "','" + vis.VisitingName + "','" + vis.VisitingTime + "','" + vis.LikaiTime + "',0)"));
        }