Пример #1
0
        /// <summary>
        /// 查询功能模块信息(增加一个全部选项)
        /// </summary>
        public DataTable QueryStnModule(bool addAllItem)
        {
            string sqlStr = "select AutoId, SMNo, FunctionDesc from SA_StnModule Order by AutoId";

            if (addAllItem)
            {
                sqlStr = "select 0 as AutoId, '全部' as SMNo, '全部' as FunctionDesc union " + sqlStr;
            }
            return(BaseSQL.GetTableBySql(sqlStr));
        }
Пример #2
0
        /// <summary>
        /// 查询出库类别(增加一个全部选项)
        /// </summary>
        public DataTable QueryWarehouseReceiptType(bool addAllItem)
        {
            string sqlStr = "select AutoId, WarehouseReceiptTypeNo, WarehouseReceiptTypeName, IsDefault from BS_WarehouseReceiptType Order by AutoId";

            if (addAllItem)
            {
                //sqlStr = "select 0 as AutoId, '全部' as WarehouseReceiptTypeNo, '全部' as WarehouseReceiptTypeName, 0 as IsDefault union " + sqlStr;
                sqlStr = "select 0 as AutoId, '" + f.tsmiQb.Text + "' as WarehouseReceiptTypeNo, '" + f.tsmiQb.Text + "' as WarehouseReceiptTypeName, 0 as IsDefault union " + sqlStr;
            }
            return(BaseSQL.GetTableBySql(sqlStr));
        }
Пример #3
0
        /// <summary>
        /// 查询制造工程信息(增加一个全部选项)
        /// </summary>
        public DataTable QueryManufactureInfo(bool addAllItem)
        {
            string sqlStr = "select AutoId, ManufactureNo, ManufactureName, ManufactureType, ManufactureTypeText from V_BS_ManufactureInfo Order by AutoId";

            if (addAllItem)
            {
                //sqlStr = "select 0 as AutoId, '全部' as ManufactureNo, '全部' as ManufactureName, 1 as ManufactureType, '正常' as ManufactureTypeText union " + sqlStr;
                sqlStr = "select 0 as AutoId, '" + f.tsmiQb.Text + "' as ManufactureNo, '" + f.tsmiQb.Text + "' as ManufactureName, 1 as ManufactureType, '" + f.tsmiZc.Text + "' as ManufactureTypeText union " + sqlStr;
            }
            return(BaseSQL.GetTableBySql(sqlStr));
        }
Пример #4
0
        /// <summary>
        /// 查询单据模板文件
        /// </summary>
        public Byte[] QueryDocTemplet_FileByte(string tableNameStr)
        {
            string    sqlStr   = string.Format("select TableName, FileByte from BS_DocumentTemplet where TableName = '{0}'", tableNameStr);
            DataTable docTable = BaseSQL.GetTableBySql(sqlStr);

            if (docTable.Rows.Count == 0)
            {
                //throw new Exception("查询模板文件异常。");
                throw new Exception(f.tsmiCxmbwj.Text);
            }
            return((byte[])docTable.Rows[0]["FileByte"]);
        }
Пример #5
0
        //打印预览功能
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string path = @"..\..\VIEW\REPORT\Report111.rdlc";
            string str  = @"select * from BS_Menu ";

            DataTable[] dt = new DataTable[1];//数据由报表数据集个数决定
            dt[0] = BaseSQL.GetTableBySql(str);
            string[] strRptDataSetName = new string[1];
            strRptDataSetName[0] = "Rpt1";                                               //"RptDt1":报表中的数据源名称
            FrmPrintPreview f = new BSVIEW.FrmPrintPreview(path, strRptDataSetName, dt); //数据源可以有多种形式

            f.ShowDialog();
        }
Пример #6
0
        //****直接打印功能***复杂表可以建视图作为数据源****************
        private void button5_Click(object sender, EventArgs e)
        {
            //打印清单
            string str = @"select * from BS_Menu ";

            DataTable[] dt = new DataTable[1];//数据由报表数据集个数决定
            dt[0] = BaseSQL.GetTableBySql(str);
            ReportViewer rvDoc = new ReportViewer();

            rvDoc.LocalReport.ReportPath = @"..\..\VIEW\REPORT\Report111.rdlc";//设置报表的路径
            rvDoc.LocalReport.DataSources.Add(new ReportDataSource("Rpt1", dt[0]));
            BSBLL.PrintStream(rvDoc.LocalReport);
        }
Пример #7
0
        /// <summary>
        /// 查询审批人的登陆号和角色名
        /// </summary>
        /// <param name="approverInt">审批人的AutoId</param>
        /// <param name="loginIdStr">返回审批人的登陆号</param>
        /// <param name="roleNoStr">返回审批人的角色名</param>
        private void QueryUserInfo_LoginIdAndRoleNo(int approverInt, ref string loginIdStr, ref string roleNoStr)
        {
            string    tmpSql = string.Format("select LoginId, RoleNo from BS_UserInfo left join BS_RoleUser on BS_RoleUser.UserNo = BS_UserInfo.AutoId where BS_UserInfo.AutoId = {0}", approverInt);
            DataTable userTable;

            userTable = BaseSQL.GetTableBySql(tmpSql);

            if (userTable.Rows.Count == 0)
            {
                throw new Exception("未查询到审批人的信息,请重新操作。");
            }
            loginIdStr = DataTypeConvert.GetString(userTable.Rows[0]["LoginId"]);
            roleNoStr  = DataTypeConvert.GetString(userTable.Rows[0]["RoleNo"]);
        }
Пример #8
0
        /// <summary>
        /// 查询流程图连接线下级状态节点是否停用
        /// </summary>
        /// <param name="orderType">订单类型  请购单 = 1,采购订单 = 2,工单 = 3,</param>
        /// <param name="lineType">操作类型删除 = -1,保存 = 0,提交 = 1,取消提交 = 2,审批 = 3,取消审批 = 4,关闭 = 5,取消关闭 = 6,拒绝 = 7,任务分配 = 8,取消分配 = 9</param>
        public bool QueryWorkFlowsLineNextNodeIsEnabled(OrderType orderType, LineType lineType)
        {
            using (SqlConnection conn = new SqlConnection(BaseSQL.connectionString))
            {
                conn.Open();
                using (SqlTransaction trans = conn.BeginTransaction())
                {
                    try
                    {
                        SqlCommand cmd = new SqlCommand("", conn, trans);

                        cmd.CommandText = string.Format("select * from BS_WorkFlowsLine where WorkFlowsId in (select AutoId from BS_WorkFlows where Enabled = 1 and WorkFlowsType = {0}) and LineType = {1}", (int)orderType, (int)lineType);
                        DataTable workFlowsTable = BaseSQL.GetTableBySql(cmd);
                        DataTable lineTable      = BaseSQL.GetTableBySql(cmd);
                        if (lineTable.Rows.Count > 0)
                        {
                            int nodeIdInt_Next = DataTypeConvert.GetInt(lineTable.Rows[0]["LevelNodeId"]);

                            cmd.CommandText = string.Format("select Enabled from BS_WorkFlowsNode where AutoId = {0}", nodeIdInt_Next);
                            DataTable nextNodeTable = BaseSQL.GetTableBySql(cmd);
                            if (nextNodeTable.Rows.Count > 0)
                            {
                                int nodeEnabledInt = DataTypeConvert.GetInt(nextNodeTable.Rows[0]["Enabled"]);
                                switch (lineType)
                                {
                                case LineType.提交:
                                    if (nodeEnabledInt == 0)
                                    {
                                        return(false);
                                    }
                                    break;
                                }
                            }
                        }

                        trans.Commit();
                        return(true);
                    }
                    catch (Exception ex)
                    {
                        trans.Rollback();
                        throw ex;
                    }
                    finally
                    {
                        conn.Close();
                    }
                }
            }
        }
Пример #9
0
        /// <summary>
        /// 根据模块查询所属节点信息
        /// </summary>
        public DataTable ModuleGetWorkFlowNode(SqlCommand cmd, string WorkFlowTypeText, string tableNameStr, int moduleTypeInt)
        {
            cmd.CommandText = string.Format("select AutoId from BS_WorkFlowType where WorkFlowTypeText = '{0}'", WorkFlowTypeText);
            int workFlowTypeAutoId = DataTypeConvert.GetInt(cmd.ExecuteScalar());

            if (workFlowTypeAutoId == 0)
            {
                throw new Exception("未查询到当前操作的流程类型信息,请设置流程信息后再进行操作。");
            }
            cmd.CommandText = string.Format("select AutoId, FlowModuleId from BS_WorkFlowNode where WorkFlowId in (select AutoId from BS_WorkFlow where WorkFlowTypeAutoId = {0}) and FlowModuleId in (select FlowModuleId from BS_WorkFlowModule where FlowModuleTableName = '{1}' and ModuleType = {2}) order by AutoId", workFlowTypeAutoId, tableNameStr, moduleTypeInt);
            DataTable wfNodeTable = BaseSQL.GetTableBySql(cmd);

            return(wfNodeTable);
        }
Пример #10
0
        public bool InsertWorkFlowDataHandle(SqlCommand cmd, List <string> orderNoList, string flowModuleIdStr, int nodeIdInt, int stateInt, string approverStr, string approverOptionStr, int approverResultInt, bool allNewDataHandle)
        {
            foreach (string orderNo in orderNoList)
            {
                cmd.CommandText = string.Format("Select Count(*) from BS_DataCurrentNode where DataNo = '{0}'", orderNo);
                if (DataTypeConvert.GetInt(cmd.ExecuteScalar()) == 0)//新增
                {
                    cmd.CommandText = string.Format("Insert into BS_DataCurrentNode (DataNo, FlowModuleId, CurrentNodeId, currentState, isEnd) values ('{0}', '{1}', {2}, {3}, 0)", orderNo, flowModuleIdStr, nodeIdInt, stateInt);
                    cmd.ExecuteNonQuery();
                }
                else//修改
                {
                    cmd.CommandText = string.Format("update BS_DataCurrentNode set FlowModuleId = '{1}', CurrentNodeId = {2}, currentState = {3} where DataNo = '{0}'", orderNo, flowModuleIdStr, nodeIdInt, stateInt);
                    cmd.ExecuteNonQuery();
                }

                cmd.CommandText = string.Format("update BS_DataCurrentNode set isEnd = (case BS_WorkFlowNode.NodeCate when 3 then 1 else 0 end) from BS_DataCurrentNode left join BS_WorkFlowNode on BS_DataCurrentNode.CurrentNodeId = BS_WorkFlowNode.AutoId where DataNo = '{0}'", orderNo);
                cmd.ExecuteNonQuery();

                int count     = 0;
                int autoIdInt = 0;
                if (!allNewDataHandle)
                {
                    //cmd.CommandText = string.Format("select top 1 AutoId from BS_WorkFlowDataHandle where DataNo = '{0}' and NodeId = '{1}' and Approver = '{2}' order by AutoId desc", orderNo, nodeIdInt, approverStr);
                    cmd.CommandText = string.Format("select top 1 AutoId from BS_WorkFlowDataHandle where DataNo = '{0}' and NodeId = '{1}' and ApproverResult = {2} order by AutoId desc", orderNo, nodeIdInt, approverResultInt);
                    DataTable tempTable = BaseSQL.GetTableBySql(cmd);

                    count = tempTable.Rows.Count;
                    if (count > 0)
                    {
                        autoIdInt = DataTypeConvert.GetInt(tempTable.Rows[0]["AutoId"]);
                    }
                }

                if (count == 0)//新增
                {
                    cmd.CommandText = string.Format("Insert into BS_WorkFlowDataHandle (DataNo, FlowModuleId, NodeId, Approver, ApproverOption, ApproverResult) values ('{0}', '{1}', {2}, '{3}', '{4}', {5})", orderNo, flowModuleIdStr, nodeIdInt, approverStr, approverOptionStr, approverResultInt);
                    cmd.ExecuteNonQuery();
                }
                else//修改
                {
                    //cmd.CommandText = string.Format("Update BS_WorkFlowDataHandle set FlowModuleId = '{4}', ApproverOption = '{5}', ApproverResult = {6}, ApproverTime = getdate() where DataNo = '{0}' and NodeId = '{1}' and Approver = '{2}' and AutoId = {3}", orderNo, nodeIdInt, approverStr, autoIdInt, flowModuleIdStr, approverOptionStr, approverResultInt);
                    cmd.CommandText = string.Format("Update BS_WorkFlowDataHandle set Approver = '{3}', FlowModuleId = '{4}', ApproverOption = '{5}', ApproverResult = {6}, ApproverTime = getdate() where DataNo = '{0}' and NodeId = '{1}' and AutoId = {2}", orderNo, nodeIdInt, autoIdInt, approverStr, flowModuleIdStr, approverOptionStr, approverResultInt);
                    cmd.ExecuteNonQuery();
                }
            }
            return(true);
        }
Пример #11
0
 /// <summary>
 /// 获取指定项目对应本地路径
 /// </summary>
 /// <param name="iProjectID"></param>
 /// <returns></returns>
 public static string GetProjectLocalPath(int iProjectID)
 {
     try
     {
         string    sSql = "select top 1 a.Path from SA_Projects a where a.ProjectID=" + iProjectID;
         DataTable dt;
         dt = BaseSQL.GetTableBySql(sSql);
         DataRow dr = dt.Rows[0];
         return(dr["path"].ToString());
     }
     catch (Exception ex)
     {
         ExceptionHandler.HandleException("获取指定项目对应本地路径错误。", ex);
         return(null);
     }
 }
Пример #12
0
 /// <summary>
 /// 获取项目信息
 /// </summary>
 /// <param name="projectID"></param>
 /// <returns></returns>
 public static DataRow GetProjectInfo(int projectID)
 {
     try
     {
         string    sSql = "select * from SA_Projects a where a.projectID =" + projectID;
         DataTable dt;
         dt = BaseSQL.GetTableBySql(sSql);
         DataRow dr;
         return(dr = dt.Rows[0]);
     }
     catch (Exception ex)
     {
         ExceptionHandler.HandleException("获取项目信息错误。", ex);
         return(null);
     }
 }
Пример #13
0
 /// <summary>
 /// 获取指定项目对应本地路径
 /// </summary>
 /// <param name="iProjectID"></param>
 /// <returns></returns>
 public static string GetProjectLocalPath(int iProjectID)
 {
     try
     {
         string    sSql = "select top 1 a.Path from SA_Projects a where a.ProjectID=" + iProjectID;
         DataTable dt;
         dt = BaseSQL.GetTableBySql(sSql);
         DataRow dr = dt.Rows[0];
         return(dr["path"].ToString());
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, f.tsmiTs.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
         return(null);
     }
 }
Пример #14
0
        /// <summary>
        /// 检查请购单明细是否已经生成采购订单
        /// </summary>
        private bool CheckPrIsPO(SqlCommand cmd, string autoIdListStr)
        {
            cmd.CommandText = string.Format("select PrReqNo, CodeFileName from PUR_PrReqList join PUR_PRPO on PUR_PrReqList.AutoId = PUR_PRPO.PRListId where PUR_PrReqList.AutoId in ({0}) group by PrReqNo, CodeFileName", autoIdListStr);
            DataTable orderPrTable = BaseSQL.GetTableBySql(cmd);

            if (orderPrTable.Rows.Count > 0)
            {
                cmd.Transaction.Rollback();
                MessageHandler.ShowMessageBox(string.Format("请购单[{0}]中的[{1}]已经生成采购订单,不可以再进行操作。", orderPrTable.Rows[0]["PrReqNo"], orderPrTable.Rows[0]["CodeFileName"]));
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #15
0
 /// <summary>
 /// 获取项目信息
 /// </summary>
 /// <param name="projectID"></param>
 /// <returns></returns>
 public static DataRow GetProjectInfo(int projectID)
 {
     try
     {
         string    sSql = "select * from SA_Projects a where a.projectID =" + projectID;
         DataTable dt;
         dt = BaseSQL.GetTableBySql(sSql);
         DataRow dr;
         return(dr = dt.Rows[0]);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, f.tsmiTs.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
         return(null);
     }
 }
Пример #16
0
 /// <summary>
 /// 获得取消隐藏的文件列表(未应用于菜单Enable)
 /// </summary>
 /// <param name="projectID"></param>
 /// <returns>大于0时包含</returns>
 public static DataTable GetCancelHideFiles(int projectID)
 {
     try
     {
         string sSql = "select b.ProjectID,c.ChildProjectID,c.ParentProjectID,c.Level,a.* " +
                       "from SA_Documents a " +
                       "inner join SA_DocumentsInProjects b on a.DocumentID = b.DocumentID " +
                       "inner join SA_ProjectTreeRec c on b.projectID = c.childProjectID and c.ParentProjectID =" + projectID + " " +
                       "where a.Deleted = 0 and b.Deleted = 0 " +
                       "and  a.hidden=1";
         return(BaseSQL.GetTableBySql(sSql));
     }
     catch (Exception ex)
     {
         ExceptionHandler.HandleException("获得取消隐藏的文件列表错误。", ex);
         return(null);
     }
 }
Пример #17
0
 /// <summary>
 /// 获得添加到库的文件列表
 /// </summary>
 /// <param name="projectID"></param>
 /// <returns>大于0时包含</returns>
 public static DataTable GetAddToFtp(int projectID, int userID, string lockDomain)
 {
     try
     {
         string sSql = "select b.ProjectID,c.ChildProjectID,c.ParentProjectID,c.Level,a.* " +
                       "from SA_Documents a " +
                       "inner join SA_DocumentsInProjects b on a.DocumentID = b.DocumentID " +
                       "inner join SA_ProjectTreeRec c on b.projectID = c.childProjectID and c.ParentProjectID =" + projectID + " " +
                       "where a.Deleted = 0 and b.Deleted = 0 " +
                       "and  a.userID=" + userID + " and a.lockDomain like '" + lockDomain + "' and a.defValStored=0 ";
         return(BaseSQL.GetTableBySql(sSql));
     }
     catch (Exception ex)
     {
         ExceptionHandler.HandleException("获得添加到库的文件列表错误。", ex);
         return(null);
     }
 }
Пример #18
0
        /// <summary>
        /// 获取指定项目所有层次的项目列表(含指定项目)
        /// </summary>
        /// <param name="iProjectID"></param>
        /// <returns></returns>
        public static DataTable GetAllLevelProjects(int iProjectID)
        {
            try
            {
                string sSql = "select a.ChildProjectID,a.ParentProjectID,a.Level,b.* " +
                              "from SA_ProjectTreeRec a " +
                              "left join SA_Projects b on a.ChildProjectID=b.ProjectID " +
                              "where b.Deleted = 0 " +
                              "and a.ParentProjectID = " + iProjectID;

                return(BaseSQL.GetTableBySql(sSql));
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException("获取指定项目所有层次的项目列表错误。", ex);
                return(null);
            }
        }
Пример #19
0
 /// <summary>
 /// 获得取消隐藏的文件列表(未应用于菜单Enable)
 /// </summary>
 /// <param name="projectID"></param>
 /// <returns>大于0时包含</returns>
 public static DataTable GetCancelHideFiles(int projectID)
 {
     try
     {
         string sSql = "select b.ProjectID,c.ChildProjectID,c.ParentProjectID,c.Level,a.* " +
                       "from SA_Documents a " +
                       "inner join SA_DocumentsInProjects b on a.DocumentID = b.DocumentID " +
                       "inner join SA_ProjectTreeRec c on b.projectID = c.childProjectID and c.ParentProjectID =" + projectID + " " +
                       "where a.Deleted = 0 and b.Deleted = 0 " +
                       "and  a.hidden=1";
         return(BaseSQL.GetTableBySql(sSql));
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, f.tsmiTs.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
         return(null);
     }
 }
Пример #20
0
 /// <summary>
 /// 获得完整的项目树
 /// </summary>
 /// <returns></returns>
 public static DataTable GetCompleteProjectTree()
 {
     try
     {
         string sSql = "select a.ChildProject, a.ProjectID, b.Name, " +
                       "b.Path " +
                       "from SA_ProjectTree a  left join SA_Projects b " +
                       "on a.ChildProject = b.ProjectID " +
                       "where b.Deleted = 0 and (b.FolderType = 1 or b.folderType=3) " +
                       "order by b.name";
         return(BaseSQL.GetTableBySql(sSql));
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, f.tsmiTs.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
         return(null);
     }
 }
Пример #21
0
 /// <summary>
 /// 获取项目子文件夹列表
 /// </summary>
 /// <param name="queryString"></param>
 /// <returns></returns>
 public static DataTable QueryAllProjects(string queryString)
 {
     try
     {
         string sSql = "select a.ChildProject, a.ProjectID, b.Name, b.StatusID, b.StartTime, b.Deadline, " +
                       "b.TimeEstimate, b.Busy, b.MoveCount, b.Path, b.Deleted, b.FolderType " +
                       "from SA_ProjectTree a  left join SA_Projects b on a.ChildProject = b.ProjectID " +
                       "where b.Deleted = 0 and (b.FolderType = 1 or b.folderType=3) " +
                       "and upper(b.name) like '%" + queryString.ToUpper() + "%' " +
                       "order by b.name";
         return(BaseSQL.GetTableBySql(sSql));
     }
     catch (Exception ex)
     {
         ExceptionHandler.HandleException("获取项目子文件夹列表错误。", ex);
         return(null);
     }
 }
Пример #22
0
 /// <summary>
 /// 获得添加到库的文件列表
 /// </summary>
 /// <param name="projectID"></param>
 /// <returns>大于0时包含</returns>
 public static DataTable GetAddToFtp(int projectID, int userID, string lockDomain)
 {
     try
     {
         string sSql = "select b.ProjectID,c.ChildProjectID,c.ParentProjectID,c.Level,a.* " +
                       "from SA_Documents a " +
                       "inner join SA_DocumentsInProjects b on a.DocumentID = b.DocumentID " +
                       "inner join SA_ProjectTreeRec c on b.projectID = c.childProjectID and c.ParentProjectID =" + projectID + " " +
                       "where a.Deleted = 0 and b.Deleted = 0 " +
                       "and  a.userID=" + userID + " and a.lockDomain like '" + lockDomain + "' and a.defValStored=0 ";
         return(BaseSQL.GetTableBySql(sSql));
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, f.tsmiTs.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
         return(null);
     }
 }
Пример #23
0
 /// <summary>
 /// 获取项目子文件夹列表
 /// </summary>
 /// <param name="queryString"></param>
 /// <returns></returns>
 public static DataTable QueryAllProjects(string queryString)
 {
     try
     {
         string sSql = "select a.ChildProject, a.ProjectID, b.Name, b.StatusID, b.StartTime, b.Deadline, " +
                       "b.TimeEstimate, b.Busy, b.MoveCount, b.Path, b.Deleted, b.FolderType " +
                       "from SA_ProjectTree a  left join SA_Projects b on a.ChildProject = b.ProjectID " +
                       "where b.Deleted = 0 and (b.FolderType = 1 or b.folderType=3) " +
                       "and upper(b.name) like '%" + queryString.ToUpper() + "%' " +
                       "order by b.name";
         return(BaseSQL.GetTableBySql(sSql));
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, f.tsmiTs.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
         return(null);
     }
 }
Пример #24
0
        /// <summary>
        /// 获取指定项目所有层次的项目列表(含指定项目)
        /// </summary>
        /// <param name="iProjectID"></param>
        /// <returns></returns>
        public static DataTable GetAllLevelProjects(int iProjectID)
        {
            try
            {
                string sSql = "select a.ChildProjectID,a.ParentProjectID,a.Level,b.* " +
                              "from SA_ProjectTreeRec a " +
                              "left join SA_Projects b on a.ChildProjectID=b.ProjectID " +
                              "where b.Deleted = 0 " +
                              "and a.ParentProjectID = " + iProjectID;

                return(BaseSQL.GetTableBySql(sSql));
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, f.tsmiTs.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(null);
            }
        }
Пример #25
0
 /// <summary>
 /// 获得完整的项目树
 /// </summary>
 /// <returns></returns>
 public static DataTable GetCompleteProjectTree()
 {
     try
     {
         string sSql = "select a.ChildProject, a.ProjectID, b.Name, " +
                       "b.Path " +
                       "from SA_ProjectTree a  left join SA_Projects b " +
                       "on a.ChildProject = b.ProjectID " +
                       "where b.Deleted = 0 and (b.FolderType = 1 or b.folderType=3) " +
                       "order by b.name";
         return(BaseSQL.GetTableBySql(sSql));
     }
     catch (Exception ex)
     {
         ExceptionHandler.HandleException("获得完整的项目树错误。", ex);
         return(null);
     }
 }
Пример #26
0
        /// <summary>
        /// 获取文件信息
        /// </summary>
        /// <param name="documentID"></param>
        /// <returns></returns>
        public static DataRow GetDocumentInfo(int documentID)
        {
            try
            {
                string sSql = "select distinct a.*,b.fileSize,b.fileDate from SA_Documents a left join SA_Revisions b " +
                              "on a.documentID=b.documentID and a.LatestRevisionNo=b.RevNr where a.documentID =" + documentID;
                //b影响速度

                DataTable dt;
                dt = BaseSQL.GetTableBySql(sSql);
                DataRow dr;
                return(dr = dt.Rows[0]);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, f.tsmiTs.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(null);
            }
        }
Пример #27
0
        /// <summary>
        /// 获取文件信息
        /// </summary>
        /// <param name="documentID"></param>
        /// <returns></returns>
        public static DataRow GetDocumentInfo(int documentID)
        {
            try
            {
                string sSql = "select distinct a.*,b.fileSize,b.fileDate from SA_Documents a left join SA_Revisions b " +
                              "on a.documentID=b.documentID and a.LatestRevisionNo=b.RevNr where a.documentID =" + documentID;
                //b影响速度

                DataTable dt;
                dt = BaseSQL.GetTableBySql(sSql);
                DataRow dr;
                return(dr = dt.Rows[0]);
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException("获取文件信息错误。", ex);
                return(null);
            }
        }
Пример #28
0
        /// <summary>
        /// 获取项目子文件夹列表
        /// </summary>
        /// <param name="iProjectID"></param>
        /// <returns></returns>
        public static DataTable GetProjectDir(int iProjectID)
        {
            try
            {
                string sSql = "select a.ChildProject, a.ProjectID, b.Name, b.StatusID, b.StartTime, b.Deadline, " +
                              "b.TimeEstimate, b.Busy, b.MoveCount, b.Path, b.Deleted, b.FolderType " +
                              "from SA_ProjectTree a  left join SA_Projects b " +
                              "on a.ChildProject = b.ProjectID " +
                              "where a.ProjectID =" + iProjectID + " and b.Deleted = 0 and (b.FolderType = 1 or b.folderType=3) " +
                              "order by b.name";

                return(BaseSQL.GetTableBySql(sSql));
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException("获取项目子文件夹列表错误。", ex);
                return(null);
            }
        }
Пример #29
0
        /// <summary>
        /// 获取当前项目子文件夹列表
        /// </summary>
        /// <param name="queryString"></param>
        /// <returns></returns>
        public static DataTable QueryCurrentProjects(string queryString)
        {
            try
            {
                string sql = "select a.ChildProjectID, b.ProjectID, b.Name, b.StatusID, b.StartTime, b.Deadline, " +
                             "b.TimeEstimate, b.Busy, b.MoveCount, b.Path, b.Deleted, b.FolderType " +
                             "from SA_ProjectTreeRec a left join SA_Projects b on b.projectID = a.childProjectID and a.ParentProjectID!=a.childProjectID and a.ParentProjectID =" + FrmProjectDocument.curPathNode.iProjectID + " " +
                             "where b.Deleted = 0 and (b.FolderType = 1 or b.folderType=3) " +
                             "and upper(b.name) like '%" + queryString.ToUpper() + "%' " +
                             "order by b.name";

                return(BaseSQL.GetTableBySql(sql));
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException("获取当前项目子文件夹列表错误。", ex);
                return(null);
            }
        }
Пример #30
0
        /// <summary>
        /// 获取文件列表
        /// </summary>
        /// <param name="queryString"></param>
        /// <returns></returns>
        public static DataTable QueryAllDocuments(string queryString)
        {
            try
            {
                string sSql = "select b.lockOpened,b.DocumentID,b.Deleted,b.Filename,b.LockProject,b.UserID,b.LockDomain,b.LockPath,b.Busy," +
                              "b.Flushed,b.DefValStored,b.RevGenCounter,b.LatestRevisionNo,b.CurrentStatusID,b.WorkingVersionModified," +
                              "c.Extension,c.Flags,b.LockDate,b.UserDocRefsModified,b.Shared,b.LockViewID,b.Link,b.DocTypeID,b.ObjectTypeID,b.Flags,b.hidden " +
                              "from SA_Documents b " +
                              "left join SA_FileExtension c on b.ExtensionID = c.ExtensionID " +
                              "where b.Deleted = 0 and upper(b.filename) like '%" + queryString.ToUpper() + "%' " +
                              "order by b.Filename";

                return(BaseSQL.GetTableBySql(sSql));
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException("获取文件列表错误。", ex);
                return(null);
            }
        }