Exemplo n.º 1
0
        public static int AddGroupMeeting(GroupMeeting groupMeeting)
        {
            int rowAffected = 0;

            using (IDbConnection con = new SqlConnection(strConnectionString))
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }

                DynamicParameters parameters = new DynamicParameters();
                parameters.Add("@ProjectName", groupMeeting.ProjectName);
                parameters.Add("@GroupMeetingLeadName", groupMeeting.GroupMeetingLeadName);
                parameters.Add("@TeamLeadName", groupMeeting.TeamLeadName);
                parameters.Add("@Description", groupMeeting.Description);
                parameters.Add("@GroupMeetingDate", groupMeeting.GroupMeetingDate);

                rowAffected = con.Execute("InsertGroupMeeting", parameters, commandType: CommandType.StoredProcedure);
            }

            return(rowAffected);
        }
Exemplo n.º 2
0
        public static GroupMeeting GetGroupMeetingById(int?id)
        {
            GroupMeeting groupMeeting = new GroupMeeting();

            if (id == null)
            {
                return(groupMeeting);
            }

            using (IDbConnection con = new SqlConnection(strConnectionString))
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }

                DynamicParameters parameters = new DynamicParameters();
                parameters.Add("@Id", id);
                groupMeeting = con.Query <GroupMeeting>("GetGroupMeetingById", parameters, commandType: CommandType.StoredProcedure).FirstOrDefault();
            }

            return(groupMeeting);
        }