Пример #1
0
        /// <summary>
        /// 添加会议通知的方法
        /// </summary>
        /// <param name="MeetingInfoM">会议通知信息</param>
        /// <returns>被添加会议通知ID</returns>
        public static int MeetingInfoAdd(MeetingInfoModel MeetingInfoM)
        {
            try
            {
                #region 设置参数
                SqlParameter[] param = new SqlParameter[25];
                param[0] = SqlHelper.GetParameter("@CompanyCD     ", MeetingInfoM.CompanyCD);
                param[1] = SqlHelper.GetParameter("@MeetingNo     ", MeetingInfoM.MeetingNo);
                param[2] = SqlHelper.GetParameter("@Title         ", MeetingInfoM.Title);
                param[3] = SqlHelper.GetParameter("@TypeID        ", MeetingInfoM.TypeID);
                param[4] = SqlHelper.GetParameter("@Caller        ", MeetingInfoM.Caller);
                param[5] = SqlHelper.GetParameter("@DeptID        ", MeetingInfoM.DeptID);
                param[6] = SqlHelper.GetParameter("@Chairman      ", MeetingInfoM.Chairman);
                param[7] = SqlHelper.GetParameter("@StartDate", MeetingInfoM.StartDate == null
                                       ? SqlDateTime.Null
                                       : SqlDateTime.Parse(MeetingInfoM.StartDate.ToString()));
                param[8]  = SqlHelper.GetParameter("@StartTime     ", MeetingInfoM.StartTime);
                param[9]  = SqlHelper.GetParameter("@TimeLong      ", MeetingInfoM.TimeLong);
                param[10] = SqlHelper.GetParameter("@Place         ", MeetingInfoM.Place);
                param[11] = SqlHelper.GetParameter("@Topic         ", MeetingInfoM.Topic);
                param[12] = SqlHelper.GetParameter("@Contents      ", MeetingInfoM.Contents);
                param[13] = SqlHelper.GetParameter("@ReadyInfo     ", MeetingInfoM.ReadyInfo);
                param[14] = SqlHelper.GetParameter("@Attachment    ", MeetingInfoM.Attachment);
                param[15] = SqlHelper.GetParameter("@Remark        ", MeetingInfoM.Remark);
                param[16] = SqlHelper.GetParameter("@MeetingStatus ", MeetingInfoM.MeetingStatus);
                param[17] = SqlHelper.GetParameter("@IsMobileCall  ", MeetingInfoM.IsMobileCall);
                param[18] = SqlHelper.GetParameter("@CallContent   ", MeetingInfoM.CallContent);
                param[19] = SqlHelper.GetParameter("@JoinUser      ", MeetingInfoM.JoinUser);
                param[20] = SqlHelper.GetParameter("@Sender        ", MeetingInfoM.Sender);
                param[21] = SqlHelper.GetParameter("@SendDate", MeetingInfoM.SendDate == null
                                       ? SqlDateTime.Null
                                       : SqlDateTime.Parse(MeetingInfoM.SendDate.ToString()));
                param[22] = SqlHelper.GetParameter("@ModifiedDate  ", MeetingInfoM.ModifiedDate);
                param[23] = SqlHelper.GetParameter("@ModifiedUserID", MeetingInfoM.ModifiedUserID);

                SqlParameter paramid = new SqlParameter("@id", SqlDbType.Int);
                paramid.Direction = ParameterDirection.Output;
                param[24]         = paramid;
                #endregion

                //创建命令
                SqlCommand comm = new SqlCommand();
                SqlHelper.ExecuteTransStoredProcedure("officedba.insertMeetingInfo", comm, param);
                int MeetingInfoID = Convert.ToInt32(comm.Parameters["@id"].Value);

                return(MeetingInfoID);
            }
            catch
            {
                return(0);
            }
        }
Пример #2
0
        /// <summary>
        /// 根据会议通知ID修改会议通知信息
        /// </summary>
        /// <param name="MeetingInfoM">会议通知信息</param>
        /// <returns>bool值</returns>
        public static bool UpdateMeetingInfo(MeetingInfoModel MeetingInfoM)
        {
            try
            {
                StringBuilder sql = new StringBuilder();
                sql.AppendLine("UPDATE officedba.MeetingInfo set ");
                sql.AppendLine("CompanyCD     =@CompanyCD     ,");
                //sql.AppendLine("MeetingNo     =@MeetingNo     ,");
                sql.AppendLine("Title         =@Title         ,");
                sql.AppendLine("TypeID        =@TypeID        ,");
                sql.AppendLine("Caller        =@Caller        ,");
                sql.AppendLine("DeptID        =@DeptID        ,");
                sql.AppendLine("Chairman      =@Chairman      ,");
                sql.AppendLine("StartDate     =@StartDate     ,");
                sql.AppendLine("StartTime     =@StartTime     ,");
                sql.AppendLine("TimeLong      =@TimeLong      ,");
                sql.AppendLine("Place         =@Place         ,");
                sql.AppendLine("Topic         =@Topic         ,");
                sql.AppendLine("Contents      =@Contents      ,");
                sql.AppendLine("ReadyInfo     =@ReadyInfo     ,");
                sql.AppendLine("Attachment    =@Attachment    ,");
                sql.AppendLine("Remark        =@Remark        ,");

                sql.AppendLine("IsMobileCall  =@IsMobileCall  ,");
                sql.AppendLine("CallContent   =@CallContent   ,");
                sql.AppendLine("JoinUser      =@JoinUser      ,");
                sql.AppendLine("Sender        =@Sender        ,");
                sql.AppendLine("SendDate      =@SendDate      ,");
                sql.AppendLine("ModifiedDate  =@ModifiedDate  ,");
                sql.AppendLine("ModifiedUserID=@ModifiedUserID");
                sql.AppendLine(" WHERE ");
                sql.AppendLine("ID = @ID ");

                SqlParameter[] param = new SqlParameter[23];
                param[0] = SqlHelper.GetParameter("@ID      ", MeetingInfoM.ID);
                param[1] = SqlHelper.GetParameter("@CompanyCD     ", MeetingInfoM.CompanyCD);
                param[2] = SqlHelper.GetParameter("@Title         ", MeetingInfoM.Title);
                param[3] = SqlHelper.GetParameter("@TypeID        ", MeetingInfoM.TypeID);
                param[4] = SqlHelper.GetParameter("@Caller        ", MeetingInfoM.Caller);
                param[5] = SqlHelper.GetParameter("@DeptID        ", MeetingInfoM.DeptID);
                param[6] = SqlHelper.GetParameter("@Chairman      ", MeetingInfoM.Chairman);
                //param[7] = SqlHelper.GetParameter("@StartDate     ",MeetingInfoM.StartDate     );
                param[7] = SqlHelper.GetParameter("@StartDate", MeetingInfoM.StartDate == null
                                        ? SqlDateTime.Null
                                        : SqlDateTime.Parse(MeetingInfoM.StartDate.ToString()));
                param[8]  = SqlHelper.GetParameter("@StartTime     ", MeetingInfoM.StartTime);
                param[9]  = SqlHelper.GetParameter("@TimeLong      ", MeetingInfoM.TimeLong);
                param[10] = SqlHelper.GetParameter("@Place         ", MeetingInfoM.Place);
                param[11] = SqlHelper.GetParameter("@Topic         ", MeetingInfoM.Topic);
                param[12] = SqlHelper.GetParameter("@Contents      ", MeetingInfoM.Contents);
                param[13] = SqlHelper.GetParameter("@ReadyInfo     ", MeetingInfoM.ReadyInfo);
                param[14] = SqlHelper.GetParameter("@Attachment    ", MeetingInfoM.Attachment);
                param[15] = SqlHelper.GetParameter("@Remark        ", MeetingInfoM.Remark);

                param[16] = SqlHelper.GetParameter("@IsMobileCall  ", MeetingInfoM.IsMobileCall);
                param[17] = SqlHelper.GetParameter("@CallContent   ", MeetingInfoM.CallContent);
                param[18] = SqlHelper.GetParameter("@JoinUser      ", MeetingInfoM.JoinUser);
                param[19] = SqlHelper.GetParameter("@Sender        ", MeetingInfoM.Sender);
                //param[21] = SqlHelper.GetParameter("@SendDate      ",MeetingInfoM.SendDate      );
                param[20] = SqlHelper.GetParameter("@SendDate", MeetingInfoM.SendDate == null
                                        ? SqlDateTime.Null
                                        : SqlDateTime.Parse(MeetingInfoM.SendDate.ToString()));
                param[21] = SqlHelper.GetParameter("@ModifiedDate  ", MeetingInfoM.ModifiedDate);
                param[22] = SqlHelper.GetParameter("@ModifiedUserID", MeetingInfoM.ModifiedUserID);

                SqlHelper.ExecuteTransSql(sql.ToString(), param);
                return(SqlHelper.Result.OprateCount > 0 ? true : false);
            }
            catch
            {
                return(false);
            }
        }
Пример #3
0
        /// <summary>
        /// 导出会议通知列表
        /// </summary>
        /// <param name="MeetingInfoM"></param>
        /// <param name="FileDateBegin"></param>
        /// <param name="FileDateEnd"></param>
        /// <param name="ord"></param>
        /// <returns></returns>
        public static DataTable ExportMeetingInfo(MeetingInfoModel MeetingInfoM, string FileDateBegin, string FileDateEnd, string ord)
        {
            try
            {
                #region sql语句
                string sql = "select " +
                             " mi.ID,mi.MeetingNo,mi.Title," +
                             " mi.DeptID,isnull(di.DeptName,'') DeptName," +
                             " mi.Caller,isnull(ei.EmployeeName,'') EmployeeName," +
                             " CONVERT(varchar(100), mi.StartDate, 23)+' '+mi.StartTime StartDate," +
                             " mi.Place,mr.RoomName," +
                             " (case mi.MeetingStatus when '1' then '草稿' when '2' then '延期' when '3' then '取消' when '4' then '已通知' end)MeetingStatus," +
                             " mi.Sender,isnull(eis.EmployeeName,'') SenderName " +
                             " ,isnull(mrc.MeetingNo,'') ishave" +
                             " from " +
                             " officedba.MeetingInfo mi" +
                             " left join officedba.DeptInfo di on di.id = mi.DeptID" +
                             " left join officedba.EmployeeInfo ei on ei.id = mi.Caller" +
                             " left join officedba.MeetingRoom mr on mr.id = mi.Place" +
                             " left join officedba.EmployeeInfo eis on eis.id = mi.Sender" +
                             " left join officedba.MeetingRecord mrc on mrc.MeetingNo = mi.MeetingNo" +
                             " where" +
                             " mi.CompanyCD = '" + MeetingInfoM.CompanyCD + "'";

                if (MeetingInfoM.MeetingNo != "")
                {
                    sql += " and mi.MeetingNo like '%" + MeetingInfoM.MeetingNo + "%'";
                }
                if (MeetingInfoM.MeetingStatus != "0")
                {
                    sql += " and mi.MeetingStatus = '" + MeetingInfoM.MeetingStatus + "'";
                }
                if (MeetingInfoM.Place != 0)
                {
                    sql += " and mi.Place = " + MeetingInfoM.Place + "";
                }
                if (MeetingInfoM.DeptID != 0)
                {
                    sql += " and mi.DeptID = " + MeetingInfoM.DeptID + "";
                }
                if (MeetingInfoM.Title != "")
                {
                    sql += " and mi.Title like '%" + MeetingInfoM.Title + "%'";
                }
                if (MeetingInfoM.Caller != 0)
                {
                    sql += " and mi.Caller = " + MeetingInfoM.Caller + "";
                }
                if (MeetingInfoM.Sender != 0)
                {
                    sql += " and mi.Sender = " + MeetingInfoM.Sender + "";
                }
                if (FileDateBegin != "")
                {
                    sql += " and mi.StartDate >= '" + FileDateBegin.ToString() + "'";
                }
                if (FileDateEnd != "")
                {
                    sql += " and mi.StartDate <= '" + FileDateEnd.ToString() + "'";
                }

                #endregion

                return(SqlHelper.ExecuteSql(sql));
            }
            catch
            {
                return(null);
            }
        }
Пример #4
0
        /// <summary>
        /// 根据条件检索会议信息
        /// </summary>
        /// <param name="MeetingInfoM">会议信息</param>
        /// <param name="FileDateBegin">开始时间</param>
        /// <param name="FileDateEnd">结束时间</param>
        /// <returns>会议列表信息</returns>
        public static DataTable GetMeetingInfoBycondition(MeetingInfoModel MeetingInfoM, string FileDateBegin, string FileDateEnd, int pageIndex, int pageCount, string ord, ref int TotalCount)
        {
            try
            {
                #region sql语句
                string sql = "select " +
                             " mi.ID,mi.MeetingNo,mi.Title," +
                             " mi.DeptID,isnull(di.DeptName,'') DeptName," +
                             " mi.Caller,isnull(ei.EmployeeName,'') EmployeeName," +
                             " CONVERT(varchar(100), mi.StartDate, 23)+' '+mi.StartTime StartDate," +
                             " mi.Place,mr.RoomName," +
                             " mi.MeetingStatus," +
                             " mi.Sender,isnull(eis.EmployeeName,'') SenderName " +
                             " ,isnull(mrc.MeetingNo,'') ishave" +
                             " from " +
                             " officedba.MeetingInfo mi" +
                             " left join officedba.DeptInfo di on di.id = mi.DeptID" +
                             " left join officedba.EmployeeInfo ei on ei.id = mi.Caller" +
                             " left join officedba.MeetingRoom mr on mr.id = mi.Place" +
                             " left join officedba.EmployeeInfo eis on eis.id = mi.Sender" +
                             " left join officedba.MeetingRecord mrc on mrc.MeetingNo = mi.MeetingNo" +
                             " where" +
                             " mi.CompanyCD = '" + MeetingInfoM.CompanyCD + "'";

                if (MeetingInfoM.MeetingNo != "")
                {
                    sql += " and mi.MeetingNo like '%" + MeetingInfoM.MeetingNo + "%'";
                }
                if (MeetingInfoM.MeetingStatus != "0")
                {
                    sql += " and mi.MeetingStatus = '" + MeetingInfoM.MeetingStatus + "'";
                }
                if (MeetingInfoM.Place != 0)
                {
                    sql += " and mi.Place = " + MeetingInfoM.Place + "";
                }
                if (MeetingInfoM.DeptID != 0)
                {
                    sql += " and mi.DeptID = " + MeetingInfoM.DeptID + "";
                }
                if (MeetingInfoM.Title != "")
                {
                    sql += " and mi.Title like '%" + MeetingInfoM.Title + "%'";
                }
                if (MeetingInfoM.Caller != 0)
                {
                    sql += " and mi.Caller = " + MeetingInfoM.Caller + "";
                }
                if (MeetingInfoM.Sender != 0)
                {
                    sql += " and mi.Sender = " + MeetingInfoM.Sender + "";
                }
                if (FileDateBegin != "")
                {
                    sql += " and mi.StartDate >= '" + FileDateBegin.ToString() + "'";
                }
                if (FileDateEnd != "")
                {
                    sql += " and mi.StartDate <= '" + FileDateEnd.ToString() + "'";
                }

                #endregion

                //return SqlHelper.ExecuteSql(sql);
                return(SqlHelper.CreateSqlByPageExcuteSql(sql.ToString(), pageIndex, pageCount, ord, null, ref TotalCount));
            }
            catch
            {
                return(null);
            }
        }
Пример #5
0
        /// <summary>
        /// 根据会议通知ID修改会议通知信息
        /// </summary>
        /// <param name="MeetingInfoM">会议通知信息</param>
        /// <returns>bool值</returns>
        public static bool UpdateMeetingInfo(MeetingInfoModel MeetingInfoM)
        {
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
            LogInfoModel logModel = new LogInfoModel(); //操作日志
            bool         isSucc   = false;              //定义返回变量

            #region 设置操作日志内容
            //设置公司代码
            logModel.CompanyCD = userInfo.CompanyCD;
            //设置登陆用户ID
            logModel.UserID = userInfo.UserID;
            //设置模块ID 模块ID在ConstUtil中定义,以便维护
            logModel.ModuleID = ConstUtil.MODULE_ID_MEETINGINFO_LIST;
            //操作单据编号  编号
            logModel.ObjectID = MeetingInfoM.MeetingNo;
            //操作对象 操作的表信息
            logModel.ObjectName = ConstUtil.TABLE_NAME_MEETINGINFO;
            //涉及关键元素 涉及其他业务、表关系
            logModel.Element = ConstUtil.LOG_PROCESS_INSERT;
            //备注 操作类型
            logModel.Remark = ConstUtil.LOG_PROCESS_UPDATE;
            #endregion

            try
            {
                isSucc = MeetingInfoDBHelper.UpdateMeetingInfo(MeetingInfoM);
            }
            catch (System.Exception ex)
            {
                #region  操作失败时记录日志到文件
                //定义变量
                LogInfo logSys = new LogInfo();
                //设置日志类型 需要指定为系统日志
                logSys.Type = LogInfo.LogType.SYSTEM;
                //指定系统日志类型 出错信息
                logSys.SystemKind = LogInfo.SystemLogKind.SYSTEM_ERROR;
                //指定登陆用户信息
                logSys.UserInfo = userInfo;
                //设定模块ID
                logSys.ModuleID = ConstUtil.MODULE_ID_MEETINGINFO_LIST;
                //描述
                logSys.Description = ex.ToString();
                //输出日志
                LogUtil.WriteLog(logSys);
                #endregion
            }

            if (isSucc)//操作成功
            {
                logModel.Remark += "成功";
            }
            else//操作失败
            {
                logModel.Remark += "失败";
            }

            //记录日志
            LogDBHelper.InsertLog(logModel);

            return(isSucc);
        }
Пример #6
0
 /// <summary>
 /// 导出会议通知列表
 /// </summary>
 /// <param name="MeetingInfoM"></param>
 /// <param name="FileDateBegin"></param>
 /// <param name="FileDateEnd"></param>
 /// <param name="ord"></param>
 /// <returns></returns>
 public static DataTable ExportMeetingInfo(MeetingInfoModel MeetingInfoM, string FileDateBegin, string FileDateEnd, string ord)
 {
     return(MeetingInfoDBHelper.ExportMeetingInfo(MeetingInfoM, FileDateBegin, FileDateEnd, ord));
 }
Пример #7
0
 /// <summary>
 /// 根据条件检索会议信息
 /// </summary>
 /// <param name="MeetingInfoM">会议信息</param>
 /// <param name="FileDateBegin">开始时间</param>
 /// <param name="FileDateEnd">结束时间</param>
 /// <returns>会议列表信息</returns>
 public static DataTable GetMeetingInfoBycondition(MeetingInfoModel MeetingInfoM, string FileDateBegin, string FileDateEnd, int pageIndex, int pageCount, string ord, ref int TotalCount)
 {
     return(MeetingInfoDBHelper.GetMeetingInfoBycondition(MeetingInfoM, FileDateBegin, FileDateEnd, pageIndex, pageCount, ord, ref TotalCount));
 }