コード例 #1
0
        //根据维修编号获取维修信息
        //public Model.Repair GetRepairBLL(string id)
        //{
        //    return new DAL.RepairDAL().GetRepairDAL(" and [RepairID]='" + id + "'")[0];
        //}

        //添加物品名维修信息

        public int InsertRepairBLL(Model.Repair rep)
        {
            if (!new Rule.RepairRule().TestInsert(rep.RepairName))
            {
                return(-3);
            }
            return(new DAL.RepairDAL().InsertRepairDAL(rep));
        }
コード例 #2
0
        //更新学员信息

        public int UpdateRepairDAL(Model.Repair rep)
        {
            string sql = "Update [Repair] set [State]=0";

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

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

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

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

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

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

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

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

            sql += " where [RepairID]='" + rep.RepairID + "'";
            return(DBHelper.ExecQuery(sql));
        }
コード例 #3
0
 //更新维修信息
 public string UpdateRepairBLL(Model.Repair rep)
 {
     return(Option(new DAL.RepairDAL().UpdateRepairDAL(rep), "更新"));
 }
コード例 #4
0
 //添加物品名信息
 public int InsertRepairDAL(Model.Repair rep)
 {
     return(DBHelper.ExecQuery("Insert into [Repair]([RepairPerso],[RepairName],[dormitoryID],[RepairTime],[HandleTime],[Count],[HandlePerso],[Explain],[State]) values('" + rep.RepairPerso + "','" + rep.RepairName + "','" + rep.dormitoryID + "','" + rep.RepairTime + "','" + rep.HandleTime + "','" + rep.Count + "','" + rep.HandlePerso + "','" + rep.Explain + "',0)"));
 }