Example #1
0
        public static void parse_guids(ref IDataReader reader, ref List <Guid> lstGuids,
                                       ref long totalCount, ref string errorMessage)
        {
            while (reader.Read())
            {
                try { if (!string.IsNullOrEmpty(reader["ID"].ToString()))
                      {
                          lstGuids.Add((Guid)reader["ID"]);
                      }
                }
                catch { }

                if (totalCount <= 0)
                {
                    try { if (!string.IsNullOrEmpty(reader["TotalCount"].ToString()))
                          {
                              totalCount = long.Parse(reader["TotalCount"].ToString());
                          }
                    }
                    catch { }
                }
            }

            if (reader.NextResult())
            {
                totalCount = ProviderUtil.succeed_long(reader, ref errorMessage);
            }
            else if (!reader.IsClosed)
            {
                reader.Close();
            }
        }
        public static long?SetOwnerVariable(Guid applicationId, long?id, Guid?ownerId,
                                            string name, string value, Guid currentUserId)
        {
            try
            {
                long result = ProviderUtil.succeed_long(ProviderUtil.execute_reader(GetFullyQualifiedName("SetOwnerVariable"),
                                                                                    applicationId, id, ownerId, name, value, currentUserId, DateTime.Now));

                if (result <= 0)
                {
                    return(null);
                }
                else
                {
                    return(result);
                }
            }
            catch (Exception ex) { string strEx = ex.ToString(); return(null); }
        }