Пример #1
0
        //更新宿舍日常管理信息
        public int UpdateManagementDAL(Model.Management ma)
        {
            string sql = "update [Management] set [State]=0";

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

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

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

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

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

            sql += " where [ManagementID]=" + ma.ManagementID;
            return(DBHelper.ExecQuery(sql));
        }
Пример #2
0
        //添加宿舍日常管理信息
        public int InsertManagementBLL(Model.Management ma)
        {
            if (!new ManagementRule().TestInsert(ma.ManagementID))
            {
                return(-3);
            }

            return(new DAL.ManagementDAL().InsertManagementDAL(ma));
        }
Пример #3
0
 //更新宿舍日常管理信息
 public string UpdateManagementBLL(Model.Management ma)
 {
     return(Option(new DAL.ManagementDAL().UpdateManagementDAL(ma), "更新"));
 }
Пример #4
0
 //添加宿舍日常管理信息
 public int InsertManagementDAL(Model.Management ma)
 {
     return(DBHelper.ExecQuery("insert into [Management] ([dormitoryID],[Hygiene],[Inspectors],[ManagementTime],[Explain],[State]) values('" + ma.dormitoryID + "','" + ma.Hygiene + "','" + ma.Inspectors + "','" + ma.ManagementTime + "','" + ma.Explain + "',0)"));
 }