Beispiel #1
0
        public Group(Guid groupId)
        {
            this.groupId = groupId;

            //string sql = "select * from [Group] where groupId=@GroupId";
            //SqlParameter[] Parameters = new SqlParameter[1];


            //Parameters[0] = new SqlParameter("@GroupId", SqlDbType.UniqueIdentifier);
            //Parameters[0].Value = groupId;

            //using (IDataReader reader = SqlHelper.ExecuteReader(SqlHelper.SqlCon_QJVRMS, CommandType.Text, sql, Parameters))
            //{
            //    if (!reader.Read())
            //    {
            //        throw new Exception("没有组存在!");
            //    }

            //    GroupName = reader["Groupname"].ToString();
            //    this.createDate = DateTime.Parse(reader["CreateDate"].ToString());
            //}

            QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
            using (DataTable dt = gs.GetGroup(groupId))
            {
                GroupName = dt.Rows[0]["GroupName"].ToString();
                this.createDate = DateTime.Parse(dt.Rows[0]["CreateDate"].ToString());
            }
        }
Beispiel #2
0
        public Group(Guid groupId)
        {
            this.groupId = groupId;

            //string sql = "select * from [Group] where groupId=@GroupId";
            //SqlParameter[] Parameters = new SqlParameter[1];


            //Parameters[0] = new SqlParameter("@GroupId", SqlDbType.UniqueIdentifier);
            //Parameters[0].Value = groupId;

            //using (IDataReader reader = SqlHelper.ExecuteReader(SqlHelper.SqlCon_QJVRMS, CommandType.Text, sql, Parameters))
            //{
            //    if (!reader.Read())
            //    {
            //        throw new Exception("没有组存在!");
            //    }

            //    GroupName = reader["Groupname"].ToString();
            //    this.createDate = DateTime.Parse(reader["CreateDate"].ToString());
            //}

            QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
            using (DataTable dt = gs.GetGroup(groupId))
            {
                GroupName       = dt.Rows[0]["GroupName"].ToString();
                this.createDate = DateTime.Parse(dt.Rows[0]["CreateDate"].ToString());
            }
        }
Beispiel #3
0
        public static IGroup CreateGroup(string groupName, string description)
        {
            //SqlParameter[] Parameters = new SqlParameter[4];

            //Parameters[0] = new SqlParameter("@GroupName", SqlDbType.NVarChar);
            //Parameters[1] = new SqlParameter("@CreateDate", SqlDbType.DateTime);
            //Parameters[2] = new SqlParameter("@Description", SqlDbType.NVarChar);
            //Parameters[3] = new SqlParameter("@GroupId", SqlDbType.UniqueIdentifier);

            //Parameters[3].Direction = ParameterDirection.Output;
            //DateTime now = DateTime.Now;

            //Parameters[0].Value = groupName;
            //Parameters[1].Value = now;
            //Parameters[2].Value = description;

            //try
            //{
            //    int i = SqlHelper.ExecuteNonQuery(SqlHelper.SqlCon_QJVRMS, CommandType.StoredProcedure, "dbo.Group_CreateGroup", Parameters);

            //    return new Group(new Guid(Parameters[3].Value.ToString()), groupName, description, now);

            //}
            //catch(Exception ex)
            //{
            //   // QJVRMS.Common.LogWriter.WriteExceptionLog(ex, true);
            //    return null;
            //}
            QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
            Guid groupId = gs.CreateGroup(groupName, description);

            return(new Group(groupId, groupName, description, DateTime.Now));
        }
Beispiel #4
0
        public static DataTable GetGroupList()
        {
            //string sql = "select  * from [Group]";

            //return SqlHelper.ExecuteDataset(SqlHelper.SqlCon_QJVRMS, CommandType.Text, sql).Tables[0];

            QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
            return(gs.GetGroupList());
        }
Beispiel #5
0
        public DataTable SelectUsers(string sqlWhere)
        {
            //string sql = "select * from users where GroupId='{0}'";

            //sql = string.Format(sql, this.groupId.ToString());

            //if (!string.IsNullOrEmpty(sqlWhere))
            //{
            //    sql += " and " + sqlWhere;


            //}

            //return SqlHelper.ExecuteDataset(SqlHelper.SqlCon_QJVRMS, CommandType.Text, sql).Tables[0];

            QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
            return(gs.SearchUsers(sqlWhere));
        }
Beispiel #6
0
        public static IGroup GetRootGroup()
        {
            QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
            using (DataTable dt = gs.GetRootGroup())
            {
                if (dt.Rows.Count > 0)
                {
                    DataRow  row       = dt.Rows[0];
                    Guid     groupId   = new Guid(row["groupId"].ToString());
                    string   groupName = row["groupName"].ToString();
                    string   des       = row["Description"].ToString();
                    DateTime cDate     = DateTime.Parse(row["CreateDate"].ToString());
                    Group    g         = new Group(groupId, groupName, des, cDate);

                    return(g);
                }
            }

            return(null);
        }
Beispiel #7
0
        public static IGroup GetRootGroup()
        {
            QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
            using (DataTable dt = gs.GetRootGroup())
            {
                if (dt.Rows.Count > 0)
                {
                    DataRow row = dt.Rows[0];
                    Guid groupId = new Guid(row["groupId"].ToString());
                    string groupName = row["groupName"].ToString();
                    string des = row["Description"].ToString();
                    DateTime cDate = DateTime.Parse(row["CreateDate"].ToString());
                    Group g = new Group(groupId, groupName, des, cDate);

                    return g;
                }
            }

            return null;
        }
Beispiel #8
0
 public static bool ModifyGroup(Guid groupId, string groupName, int orderFlag)
 {
     QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
     return gs.ModifyGroup(groupId, groupName, orderFlag);
 }
Beispiel #9
0
 /// <summary>
 /// 通过机构名称名称查到机构的ID
 /// </summary>
 /// <param name="groupName"></param>
 /// <returns></returns>
 public static string GetGroupIdByGroupName(string groupName)
 {
     GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
     return(gs.GetGroupIdByGroupName(groupName));
 }
Beispiel #10
0
 public static DataTable GetAllGroups(string spaceChar)
 {
     GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
     return(gs.GetAllGroups(spaceChar));
 }
Beispiel #11
0
        public static DataTable GetGroupList()
        {
            //string sql = "select  * from [Group]";

            //return SqlHelper.ExecuteDataset(SqlHelper.SqlCon_QJVRMS, CommandType.Text, sql).Tables[0];

            QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
            return gs.GetGroupList();
        }
Beispiel #12
0
 public static bool ModifyGroup(Guid groupId, string groupName, int orderFlag)
 {
     QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
     return(gs.ModifyGroup(groupId, groupName, orderFlag));
 }
Beispiel #13
0
 public static bool DeleteGroup(Guid groupId)
 {
     QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
     return(gs.DeleteGroup(groupId));
 }
Beispiel #14
0
 public static bool DeleteGroup(Guid groupId)
 {
     QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
     return gs.DeleteGroup(groupId);
 }
Beispiel #15
0
 public DataTable SelectUsers(string loginName, string userName)
 {
     QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
     return(gs.SearchUsers(groupId, loginName, userName));
 }
Beispiel #16
0
 public static DataSet GetGroupUsersStat()
 {
     QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
     return gs.GetGroupUsersStat();
 }
Beispiel #17
0
 public DataTable SelectUsers(string loginName, string userName)
 {
     QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
     return gs.SearchUsers(groupId, loginName, userName);
 }
Beispiel #18
0
        public DataTable SelectUsers(string sqlWhere)
        {
            //string sql = "select * from users where GroupId='{0}'";

            //sql = string.Format(sql, this.groupId.ToString());

            //if (!string.IsNullOrEmpty(sqlWhere))
            //{
            //    sql += " and " + sqlWhere;


            //}

            //return SqlHelper.ExecuteDataset(SqlHelper.SqlCon_QJVRMS, CommandType.Text, sql).Tables[0];

            QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
            return gs.SearchUsers(sqlWhere);
        }
Beispiel #19
0
 public static DataTable GetAllGroups(string spaceChar)
 {
     GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
     return gs.GetAllGroups(spaceChar);
 }
Beispiel #20
0
 /// <summary>
 /// 通过机构名称名称查到机构的ID
 /// </summary>
 /// <param name="groupName"></param>
 /// <returns></returns>
 public static string GetGroupIdByGroupName(string groupName)
 { 
     GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
     return gs.GetGroupIdByGroupName(groupName);
 }
Beispiel #21
0
 public static DataSet GetGroupUsersStat()
 {
     QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
     return(gs.GetGroupUsersStat());
 }
Beispiel #22
0
        public static IGroup CreateGroup(string groupName, string description)
        {
            //SqlParameter[] Parameters = new SqlParameter[4];

            //Parameters[0] = new SqlParameter("@GroupName", SqlDbType.NVarChar);
            //Parameters[1] = new SqlParameter("@CreateDate", SqlDbType.DateTime);
            //Parameters[2] = new SqlParameter("@Description", SqlDbType.NVarChar);
            //Parameters[3] = new SqlParameter("@GroupId", SqlDbType.UniqueIdentifier);

            //Parameters[3].Direction = ParameterDirection.Output;
            //DateTime now = DateTime.Now;

            //Parameters[0].Value = groupName;
            //Parameters[1].Value = now;
            //Parameters[2].Value = description;

            //try
            //{
            //    int i = SqlHelper.ExecuteNonQuery(SqlHelper.SqlCon_QJVRMS, CommandType.StoredProcedure, "dbo.Group_CreateGroup", Parameters);

            //    return new Group(new Guid(Parameters[3].Value.ToString()), groupName, description, now);

            //}
            //catch(Exception ex)
            //{
            //   // QJVRMS.Common.LogWriter.WriteExceptionLog(ex, true);
            //    return null;
            //}
            QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
            Guid groupId = gs.CreateGroup(groupName, description);

            return new Group(groupId, groupName, description, DateTime.Now);
        }
Beispiel #23
0
 public static Guid CreateChildGroup(Guid parentId, string groupName, int orderFlag)
 {
     QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
     return(gs.CreateChildGroup(parentId, groupName, orderFlag));
 }
Beispiel #24
0
 public static Guid CreateChildGroup(Guid parentId, string groupName, int orderFlag)
 {
     QJVRMS.Business.GroupWS.GroupService gs = new QJVRMS.Business.GroupWS.GroupService();
     return gs.CreateChildGroup(parentId, groupName, orderFlag);
 }