Exemplo n.º 1
0
        /// <summary>
        ///  添加请示信息的方法
        /// </summary>
        /// <param name="DocSendM">请示信息</param>
        /// <returns>请示信息ID</returns>
        public static int DocRequstAdd(DocRequstModel DocRequstM)
        {
            try
            {
                #region 设置参数
                SqlParameter[] param = new SqlParameter[20];
                param[0] = SqlHelper.GetParameter("@CompanyCD     ",DocRequstM.CompanyCD     );
                param[1] = SqlHelper.GetParameter("@DocumentNo    ",DocRequstM.DocumentNo    );
                param[2] = SqlHelper.GetParameter("@RequstDocType ",DocRequstM.RequstDocType );
                param[3] = SqlHelper.GetParameter("@SecretLevel   ",DocRequstM.SecretLevel   );
                param[4] = SqlHelper.GetParameter("@EmerLevel     ",DocRequstM.EmerLevel     );
                param[5] = SqlHelper.GetParameter("@Main          ",DocRequstM.Main          );
                param[6] = SqlHelper.GetParameter("@RequestMoney  ",DocRequstM.RequestMoney  );
                param[7] = SqlHelper.GetParameter("@RequestTitle  ",DocRequstM.RequestTitle  );
                param[8] = SqlHelper.GetParameter("@Description   ",DocRequstM.Description   );
                param[9] = SqlHelper.GetParameter("@RequstNo      ",DocRequstM.RequstNo      );
                param[10] = SqlHelper.GetParameter("@RequestDate", DocRequstM.RequestDate == null
                                      ? SqlDateTime.Null
                                      : SqlDateTime.Parse(DocRequstM.RequestDate.ToString()));
                param[11] = SqlHelper.GetParameter("@RequestDept      ", DocRequstM.RequestDept);
                param[12] = SqlHelper.GetParameter("@EmployeeID      ", DocRequstM.EmployeeID);
                param[13] = SqlHelper.GetParameter("@UploadUserID  ",DocRequstM.UploadUserID  );                
                param[14] = SqlHelper.GetParameter("@UploadDate", DocRequstM.UploadDate == null
                                      ? SqlDateTime.Null
                                      : SqlDateTime.Parse(DocRequstM.UploadDate.ToString()));
                param[15] = SqlHelper.GetParameter("@DocumentName  ",DocRequstM.DocumentName  );
                param[16] = SqlHelper.GetParameter("@DocumentURL   ",DocRequstM.DocumentURL   );               
                param[17] = SqlHelper.GetParameter("@ModifiedDate", DocRequstM.ModifiedDate == null
                                      ? SqlDateTime.Null
                                      : SqlDateTime.Parse(DocRequstM.ModifiedDate.ToString()));
                param[18] = SqlHelper.GetParameter("@ModifiedUserID",DocRequstM.ModifiedUserID);

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

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

                return DocRequstID;
            }
            catch
            {
                return 0;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据请示ID修改请示信息
        /// </summary>
        /// <param name="DocSendM">请示信息</param>
        /// <returns>bool值</returns>
        public static bool UpdateDocRequst(DocRequstModel DocRequstM)
        {
            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_DOCREQUST_LIST;
            //操作单据编号  编号
            logModel.ObjectID = DocRequstM.DocumentNo;
            //操作对象 操作的表信息
            logModel.ObjectName = ConstUtil.TABLE_NAME_DOCREQUST;
            //涉及关键元素 涉及其他业务、表关系
            logModel.Element = ConstUtil.LOG_PROCESS_UPDATE;
            //备注 操作类型
            logModel.Remark = ConstUtil.LOG_PROCESS_UPDATE;
            #endregion

            try
            {
                isSucc = DocRequstDBHelper.UpdateDocRequst(DocRequstM);
            }
            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_DOCREQUST_LIST;
                //描述
                logSys.Description = ex.ToString();
                //输出日志
                LogUtil.WriteLog(logSys);
                #endregion
            }

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

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

            return isSucc;
        }
Exemplo n.º 3
0
 /// <summary>
 /// 导出请示列表
 /// </summary>
 /// <param name="DocRequstM"></param>
 /// <param name="FileDateBegin"></param>
 /// <param name="FileDateEnd"></param>
 /// <param name="ord"></param>
 /// <returns></returns>
 public static DataTable ExportDocRequst(DocRequstModel DocRequstM, string FileDateBegin, string FileDateEnd, string ord)
 {
     return DocRequstDBHelper.ExportDocRequst(DocRequstM, FileDateBegin, FileDateEnd, ord);
 }
Exemplo n.º 4
0
 /// <summary>
 /// 根据条件检索请示信息的方法
 /// </summary>
 /// <param name="DocRequstM">请示信息</param>
 /// <param name="FileDateBegin">开始时间</param>
 /// <param name="FileDateEnd">结束时间</param>
 /// <returns>请示列表信息</returns>
 public static DataTable GetDocRequstBycondition(DocRequstModel DocRequstM, string FileDateBegin, string FileDateEnd, int pageIndex, int pageCount, string ord, ref int totalCount)
 {
     return DocRequstDBHelper.GetDocRequstBycondition(DocRequstM, FileDateBegin, FileDateEnd, pageIndex, pageCount, ord, ref totalCount);
 }
Exemplo n.º 5
0
        /// <summary>
        /// 根据发文ID修改发文信息
        /// </summary>
        /// <param name="DocSendM">发文信息</param>
        /// <returns>bool值</returns>
        public static bool UpdateDocRequst(DocRequstModel DocRequstM)
        {
            try
            {
                StringBuilder sql = new StringBuilder();
                sql.AppendLine("UPDATE officedba.DocRequstInfo set ");
                sql.AppendLine("CompanyCD     = @CompanyCD     ,");
                //sql.AppendLine("DocumentNo    = @DocumentNo    ,");
                sql.AppendLine("RequstDocType = @RequstDocType ,");
                sql.AppendLine("SecretLevel   = @SecretLevel   ,");
                sql.AppendLine("EmerLevel     = @EmerLevel     ,");
                sql.AppendLine("Main          = @Main          ,");
                sql.AppendLine("RequestMoney  = @RequestMoney  ,");
                sql.AppendLine("RequestTitle  = @RequestTitle  ,");
                sql.AppendLine("Description   = @Description   ,");
                sql.AppendLine("RequstNo      = @RequstNo      ,");
                sql.AppendLine("RequestDate      = @RequestDate,");
                sql.AppendLine("RequestDept      = @RequestDept,");
                sql.AppendLine("EmployeeID      = @EmployeeID,");
                sql.AppendLine("UploadUserID  = @UploadUserID  ,");
                sql.AppendLine("UploadDate    = @UploadDate    ,");
                sql.AppendLine("DocumentName  = @DocumentName  ,");
                sql.AppendLine("DocumentURL   = @DocumentURL   ,");
                sql.AppendLine("ModifiedDate  = @ModifiedDate  ,");
                sql.AppendLine("ModifiedUserID= @ModifiedUserID");
                sql.AppendLine(" WHERE ");
                sql.AppendLine("ID = @ID ");

                SqlParameter[] param = new SqlParameter[19];
                param[0] = SqlHelper.GetParameter("@ID      ", DocRequstM.ID);
                param[1] = SqlHelper.GetParameter("@CompanyCD     ",DocRequstM.CompanyCD     );               
                param[2] = SqlHelper.GetParameter("@RequstDocType ",DocRequstM.RequstDocType );
                param[3] = SqlHelper.GetParameter("@SecretLevel   ",DocRequstM.SecretLevel   );
                param[4] = SqlHelper.GetParameter("@EmerLevel     ",DocRequstM.EmerLevel     );
                param[5] = SqlHelper.GetParameter("@Main          ",DocRequstM.Main          );
                param[6] = SqlHelper.GetParameter("@RequestMoney  ",DocRequstM.RequestMoney  );
                param[7] = SqlHelper.GetParameter("@RequestTitle  ",DocRequstM.RequestTitle  );
                param[8] = SqlHelper.GetParameter("@Description   ",DocRequstM.Description   );
                param[9] = SqlHelper.GetParameter("@RequstNo      ",DocRequstM.RequstNo      );
                param[10] = SqlHelper.GetParameter("@RequestDate", DocRequstM.RequestDate == null
                                       ? SqlDateTime.Null
                                       : SqlDateTime.Parse(DocRequstM.RequestDate.ToString()));
                param[11] = SqlHelper.GetParameter("@RequestDept      ", DocRequstM.RequestDept);
                param[12] = SqlHelper.GetParameter("@EmployeeID      ", DocRequstM.EmployeeID);
                param[13] = SqlHelper.GetParameter("@UploadUserID  ",DocRequstM.UploadUserID  );                
                param[14] = SqlHelper.GetParameter("@UploadDate", DocRequstM.UploadDate == null
                                        ? SqlDateTime.Null
                                        : SqlDateTime.Parse(DocRequstM.UploadDate.ToString()));
                param[15] = SqlHelper.GetParameter("@DocumentName  ",DocRequstM.DocumentName  );
                param[16] = SqlHelper.GetParameter("@DocumentURL   ",DocRequstM.DocumentURL   );               
                param[17] = SqlHelper.GetParameter("@ModifiedDate", DocRequstM.ModifiedDate == null
                                        ? SqlDateTime.Null
                                        : SqlDateTime.Parse(DocRequstM.ModifiedDate.ToString()));
                param[18] = SqlHelper.GetParameter("@ModifiedUserID",DocRequstM.ModifiedUserID);
                SqlHelper.ExecuteTransSql(sql.ToString(), param);
                return SqlHelper.Result.OprateCount > 0 ? true : false;
            }
            catch
            {
                return false;
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 导出请示列表
        /// </summary>
        /// <param name="DocRequstM"></param>
        /// <param name="FileDateBegin"></param>
        /// <param name="FileDateEnd"></param>
        /// <param name="ord"></param>
        /// <returns></returns>
        public static DataTable ExportDocRequst(DocRequstModel DocRequstM, string FileDateBegin, string FileDateEnd, string ord)
        {
            try
            {
                #region sql语句
                string sql = "select" +
                                    " dr.id,dr.DocumentNo,cp.TypeName,dr.RequestTitle,dr.RequestMoney,isnull(di.DeptName,'') DeptName," +
                                    " isnull(ei.EmployeeName,'') EmployeeName,isnull(CONVERT(varchar(100), dr.RequestDate, 23),'') RequestDate,"+
                                    " (case dr.EmerLevel when '1' then '特提' when '2' then '特急' when '3' then '加急' when '4' then '平急' end) EmerLevel " +
                               " from " +
                                   " officedba.DocRequstInfo dr" +
                               " left join officedba.CodePublicType cp" +
                               " on	cp.id = dr.RequstDocType" +
                               " left join officedba.DeptInfo di" +
                               " on dr.RequestDept = di.id" +
                               " left join officedba.EmployeeInfo ei" +
                               " on ei.id = dr.EmployeeID" +
                               " where dr.CompanyCD = '" + DocRequstM.CompanyCD + "'";
                
                if (FileDateBegin.ToString() != "")
                    sql += " and dr.RequestDate >= '" + FileDateBegin.ToString() + "'";                
                if (FileDateEnd.ToString() != "")
                    sql += " and dr.RequestDate <= '" + FileDateEnd.ToString() + "'";               
                if (DocRequstM.RequestDept != 0)
                    sql += " and dr.RequestDept = " + DocRequstM.RequestDept.ToString() + "";
                if (DocRequstM.EmployeeID != 0)
                    sql += " and dr.EmployeeID = " + DocRequstM.EmployeeID.ToString() + "";
                if (DocRequstM.RequestTitle != "")
                    sql += " and dr.RequestTitle like '%" + DocRequstM.RequestTitle + "%'";
                if (DocRequstM.RequstDocType != 0)
                    sql += " and dr.RequstDocType = " + DocRequstM.RequstDocType + "";
                if (DocRequstM.SecretLevel != "0")
                    sql += " and dr.SecretLevel = '" + DocRequstM.SecretLevel + "'";
                if (DocRequstM.EmerLevel != "0")
                    sql += " and dr.EmerLevel = '" + DocRequstM.EmerLevel + "'";

                #endregion

                return SqlHelper.ExecuteSql(sql);
            }
            catch
            {
                return null;
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 根据条件检索请示信息的方法
        /// </summary>
        /// <param name="DocRequstM">请示信息</param>
        /// <param name="FileDateBegin">开始时间</param>
        /// <param name="FileDateEnd">结束时间</param>
        /// <returns>请示列表信息</returns>
        public static DataTable GetDocRequstBycondition(DocRequstModel DocRequstM, string FileDateBegin, string FileDateEnd, int pageIndex, int pageCount, string ord, ref int TotalCount)
        {
            try
            {
                #region sql语句
                string sql = "select" +
                                    " dr.id,dr.DocumentNo,cp.TypeName,dr.RequestTitle,dr.RequestMoney,isnull(di.DeptName,'') DeptName," +
                                    " isnull(ei.EmployeeName,'') EmployeeName,isnull(CONVERT(varchar(100), dr.RequestDate, 23),'') RequestDate,dr.EmerLevel" +
                               " from " +
                                   " officedba.DocRequstInfo dr" +
                               " left join officedba.CodePublicType cp" +
                               " on	cp.id = dr.RequstDocType" +
                               " left join officedba.DeptInfo di" +
                               " on dr.RequestDept = di.id" +
                               " left join officedba.EmployeeInfo ei" +
                               " on ei.id = dr.EmployeeID" +
                               " where dr.CompanyCD = '" + DocRequstM.CompanyCD + "'";
                               // " or dr.RequestDate is null";
                if (FileDateBegin.ToString() != "")
                    sql += " and dr.RequestDate >= '" + FileDateBegin.ToString() + "'";
                //else
                //    sql += " and (dr.RequestDate >= '" + FileDateBegin.ToString() + "' or dr.RequestDate is null)";
                if (FileDateEnd.ToString() != "")
                    sql += " and dr.RequestDate <= '" + FileDateEnd.ToString() +"'";
                //else
                //    sql += " and (dr.RequestDate <= '" + FileDateEnd.ToString() + "' or dr.RequestDate is null)";
                if (DocRequstM.RequestDept != 0)
                    sql += " and dr.RequestDept = " + DocRequstM.RequestDept.ToString() + "";
                if (DocRequstM.EmployeeID != 0)
                    sql += " and dr.EmployeeID = " + DocRequstM.EmployeeID.ToString() + "";
                if (DocRequstM.RequestTitle != "")
                    sql += " and dr.RequestTitle like '%" + DocRequstM.RequestTitle + "%'";
                if (DocRequstM.RequstDocType != 0)
                    sql += " and dr.RequstDocType = " + DocRequstM.RequstDocType + "";
                if (DocRequstM.SecretLevel != "0")
                    sql += " and dr.SecretLevel = '" + DocRequstM.SecretLevel + "'";
                if (DocRequstM.EmerLevel != "0")
                    sql += " and dr.EmerLevel = '" + DocRequstM.EmerLevel + "'";

                #endregion

                //return SqlHelper.ExecuteSql(sql);
                return SqlHelper.CreateSqlByPageExcuteSql(sql.ToString(), pageIndex, pageCount, ord, null, ref TotalCount);
            }
            catch
            {
                return null;
            }
        }