Example #1
0
 public JObject PageLoad(long start, long limit, string field, string direction, string searchInfo)
 {
     try
     {
         DBSortPage    dbsort   = new DBSortPage(start, limit, field, direction);
         DBServer      dbserver = new SqlServer();
         ApplyApproval mybase   = new ApplyApproval(dbserver);
         string        filterf  = string.Format("nvcLoginCode='{0}' and nvcCheckResult  is null or nvcCheckResult='待议' ", searchInfo);
         return(mybase.Load(dbsort, filterf));
     }
     catch (Exception ex)
     {
         return(ShowDataLoadError(ex.Message));
     }
 }
Example #2
0
        public JObject Add(JObject data)
        {
            try
            {
                DBServer      dbserver = new SqlServer();
                ApplyApproval model    = new ApplyApproval(dbserver);

                data.Remove("ID");
                data.Add(new JProperty("ID", GUID.NewGuid()));
                if (model.Create(data))
                {
                    return(ShowSuccess("保存成功."));
                }
                else
                {
                    return(ShowExecuteError("保存失败."));
                }
            }
            catch (Exception ex)
            {
                return(ShowExecuteError(ex.Message));
            }
        }