예제 #1
0
        public BaseResult ColumnDel(ColumnDel request)
        {
            BaseResult br = new BaseResult();

            try
            {
                using (var db = DbFactory.Open())
                {
                    if (string.IsNullOrEmpty(request.id))
                    {
                        throw new Exception("参数异常!");
                    }
                    ArrayList arr = new ArrayList();
                    var       ids = request.id.Split(',');
                    for (int i = 0; i < ids.Count(); i++)
                    {
                        var id = int.Parse(ids[i]);
                        arr.Add(id);
                    }
                    br.IsSuccess = db.Delete <Column>(w => Sql.In(w.ColumnID, arr)) > 0;
                }
            }
            catch (Exception ex)
            {
                br.IsSuccess = false;
                br.ErrorMsg  = ex.Message;
                throw new Exception(ex.Message);
            }
            return(br);
        }
 public BaseResult POST(ColumnDel request)
 {
     return(ColumnManager.ColumnDel(request));
 }