コード例 #1
0
        private void LoadDataGrid()
        {
            try
            {
                BuildingSubjectSetStrategyBuilder sb = new BuildingSubjectSetStrategyBuilder();
                sb.AddStrategy(new Strategy(BuildingSubjectSetStrategyName.SubjectSetCode, txtSubjectSetCode.Value));

                sb.AddOrder("ProjectName", true);
                sb.AddOrder("BuildingName", true);
                string sql = sb.BuildQueryViewString();

                QueryAgent qa = new QueryAgent();
                DataTable  tb = qa.ExecSqlForDataSet(sql).Tables[0];
                qa.Dispose();

                this.dgList.DataSource = tb;
                this.dgList.DataBind();
                tb.Dispose();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "显示出错:" + ex.Message));
            }
        }
コード例 #2
0
ファイル: WBSRemindList.aspx.cs プロジェクト: ishui/rms2
        private void LoadData()
        {
            RemindObjectStrategyBuilder rsb = new RemindObjectStrategyBuilder();

            rsb.AddStrategy(new Strategy(DAL.QueryStrategy.RemindObjectName.User, ((User)Session["User"]).UserCode));
            if (this.txtRemindMessage.Value.Trim().Length > 0)
            {
                rsb.AddStrategy(new Strategy(DAL.QueryStrategy.RemindObjectName.Message, this.txtRemindMessage.Value));
            }
            if (this.ddlRemindType.SelectedIndex > 0)
            {
                rsb.AddStrategy(new Strategy(DAL.QueryStrategy.RemindObjectName.Type, this.ddlRemindType.SelectedValue));
            }
            if (this.dtbStartDate.Value != "")
            {
                rsb.AddStrategy(new Strategy(DAL.QueryStrategy.RemindObjectName.CreateDate, this.dtbStartDate.Value));
            }
            if (this.dtbEndDate.Value != "")
            {
                rsb.AddStrategy(new Strategy(DAL.QueryStrategy.RemindObjectName.EndDate, this.dtbEndDate.Value));
            }
            rsb.AddOrder("CreateDate", false);
            string     sql          = rsb.BuildMainQueryString();
            QueryAgent qa           = new QueryAgent();
            EntityData entityRemind = qa.FillEntityData("RemindObject", sql);

            qa.Dispose();
            this.dgRemindList.DataSource = DisposeRemind(entityRemind.CurrentTable);
            this.dgRemindList.DataBind();
            this.trNoRemind.Visible = (this.dgRemindList.Items.Count > 0)?false:true;
        }
コード例 #3
0
ファイル: SupplierRule.cs プロジェクト: ishui/rms2
 public static void DeleteAllSupplier()
 {
     try
     {
         QueryAgent agent = new QueryAgent();
         try
         {
             string  queryString = "select top 1 a.ContractName, b.SupplierName from Contract a, Supplier b where a.SupplierCode = b.SupplierCode";
             DataSet set         = agent.ExecSqlForDataSet(queryString);
             try
             {
                 if (set.Tables[0].Rows.Count > 0)
                 {
                     throw new Exception(string.Format("供应商“{0}”已生成合同,不能删除", ConvertRule.ToString(set.Tables[0].Rows[0]["SupplierName"])));
                 }
             }
             finally
             {
                 set.Dispose();
             }
             agent.ExecuteSql("delete SupplierSubjectSet");
             agent.ExecuteSql("delete Supplier");
         }
         finally
         {
             agent.Dispose();
         }
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }
コード例 #4
0
ファイル: ContractPaySchedule.cs プロジェクト: ishui/rms2
 private void FillContractChangeCostCode(DataTable tbTemp)
 {
     try
     {
         QueryAgent agent = new QueryAgent();
         foreach (DataRow row in tbTemp.Rows)
         {
             if (ConvertRule.ToString(row["ContractCostCode"]) == "")
             {
                 string    text        = ConvertRule.ToString(row["ContractCode"]);
                 string    text2       = ConvertRule.ToString(row["CostCode"]);
                 string    text3       = ConvertRule.ToString(row["CostBudgetSetCode"]);
                 string    text4       = "";
                 string    queryString = string.Format("select ContractCostCode from ContractCost where ContractCode = '{0}' and CostCode = '{1}' and CostBudgetSetCode = '{2}'", text, text2, text3);
                 DataTable table       = agent.ExecSqlForDataSet(queryString).Tables[0];
                 foreach (DataRow row2 in table.Rows)
                 {
                     text4 = text4 + ((text4 == "") ? "" : ",");
                     text4 = text4 + ConvertRule.ToString(row2["ContractCostCode"]);
                 }
                 row["ContractCostCode"] = text4;
             }
         }
         agent.Dispose();
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }
コード例 #5
0
ファイル: SalRule.cs プロジェクト: riyuexing/rms
        public static DataTable GetSalBudgetBeforePeriodSum(string ProjectCode, int IYear)
        {
            DataTable table2;

            try
            {
                SalBudgetDtlStrategyBuilder builder = new SalBudgetDtlStrategyBuilder();
                builder.AddStrategy(new Strategy(SalBudgetDtlStrategyName.ProjectCode, ProjectCode));
                ArrayList pas = new ArrayList();
                pas.Add("0");
                pas.Add(IYear.ToString());
                builder.AddStrategy(new Strategy(SalBudgetDtlStrategyName.IYearRange, pas));
                builder.AddStrategy(new Strategy(SalBudgetDtlStrategyName.IMonth, "0"));
                string     queryString = builder.BuildQuerySumString();
                QueryAgent agent       = new QueryAgent();
                DataTable  table       = agent.ExecSqlForDataSet(queryString).Tables[0];
                agent.Dispose();
                table2 = table;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(table2);
        }
コード例 #6
0
ファイル: WorkFlowQuery.aspx.cs プロジェクト: riyuexing/rms
        private void LoadData()
        {
            try
            {
                //temp,天阳要求时间较紧 update by kenny 20070209
                string company = System.Configuration.ConfigurationManager.AppSettings["PMName"].ToLower();
                switch (company)
                {
                case "tianyangoa":
                    this.dgList.Columns[7].Visible = true;
                    break;

                default:
                    this.dgList.Columns[7].Visible = false;
                    break;
                }

                string     sql = (string)this.ViewState["SqlString"];
                QueryAgent qa  = new QueryAgent();
                DataSet    ds  = qa.ExecSqlForDataSet(sql);
                //EntityData entity = qa.FillEntityData( "V_WorkFlowHistory",sql );
                qa.Dispose();
                this.dgList.DataSource = ds;
                this.dgList.DataBind();
                this.GridPagination1.RowsCount = ds.Tables[0].Rows.Count.ToString();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
            }
        }
コード例 #7
0
ファイル: User.cs プロジェクト: riyuexing/rms
        /// <summary>
        /// 判断该用户是否能访问这个资源, 如果找不到该资源返回 true;
        /// </summary>
        /// <param name="code"></param>
        /// <param name="operationCode"></param>
        /// <returns></returns>
        public bool HasResourceRight(string code, string operationCode)
        {
            if (!AvailableFunction.isAvailableFunction(operationCode))
            {
                return(false);
            }

            string classCode    = operationCode.Substring(0, 4);
            string resourceCode = BLL.ResourceRule.GetResourceCode(code, classCode);

            if (resourceCode == "")
            {
                return(true);
            }
            AccessRangeStrategyBuilder sb = new AccessRangeStrategyBuilder();

            sb.AddStrategy(new Strategy(AccessRangeStrategyName.ResourceCode, resourceCode));
            ArrayList ar = new ArrayList();

            ar.Add(this.m_UserCode);
            ar.Add(BuildStationCodes());
            sb.AddStrategy(new Strategy(AccessRangeStrategyName.AccessRelation1, ar));
            sb.AddStrategy(new Strategy(AccessRangeStrategyName.OperationCode, operationCode));
            QueryAgent qa     = new QueryAgent();
            string     sql    = sb.BuildMainQueryString();
            EntityData entity = qa.FillEntityData("AccessRange", sql);

            qa.Dispose();
            bool canAccess = entity.HasRecord();

            entity.Dispose();
            return(canAccess);
        }
コード例 #8
0
ファイル: ConstructReportRule.cs プロジェクト: ishui/rms2
        public static DataTable GetSystemReportDtl(string ReportCode, int ShowFlag)
        {
            DataTable table2;

            try
            {
                DataTable  table = null;
                QueryAgent agent = new QueryAgent();
                try
                {
                    string queryString = string.Format("select * from SystemReportDtl where ReportCode = '{0}' and isnull(ShowFlag, 0) = {1} order by SortNo", ReportCode, ShowFlag);
                    table = agent.ExecSqlForDataSet(queryString).Tables[0];
                }
                finally
                {
                    agent.Dispose();
                }
                table2 = table;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(table2);
        }
コード例 #9
0
ファイル: CL_CarRegister.aspx.cs プロジェクト: riyuexing/rms
        private void LoadDataGrid()
        {
            try
            {
                string     sql = (string)this.ViewState["SearchString"];
                QueryAgent qa  = new QueryAgent();
                //
                // EntityData entity = qa.GetCachetManageList(sql); //孙权2007-9-28下午注视
                EntityData entity = null;
                qa.Dispose();

                //string[] arrField = {"TotalMoney","AHMoney","APMoney"};
                //decimal[] arrSum = BLL.MathRule.SumColumn(entity.CurrentTable, arrField);
                //ViewState["SumTotalMoney"] = arrSum[0];
                //ViewState["SumPayment"] = arrSum[1];
                //ViewState["SumAPMoney"] = arrSum[2];
                //ViewState["SumUPMoney"] = arrSum[0] - arrSum[2];

                DataView ud_dvContract = new DataView(entity.CurrentTable);

                //ud_dvContract.Sort = "Car_Type";

                this.dgList.DataSource = ud_dvContract;
                this.dgList.DataBind();
                this.GridPagination1.RowsCount = entity.CurrentTable.Rows.Count.ToString();

                entity.Dispose();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "加载合同列表错误。");
                Response.Write(Rms.Web.JavaScript.Alert(true, "加载合同列表错误:" + ex.Message));
            }
        }
コード例 #10
0
        public string BuildAccessTypeString(string operationCode, string userCode, string codes, string createUserColumnName)
        {
            string     text = "";
            string     functionStructureParentCode = SystemManageDAO.GetFunctionStructureParentCode(operationCode);
            string     queryString = string.Format(" select accessRange.groupCode,SystemGroup.FullID,RoleLevel from accessRange left join SystemGroup on accessRange.GroupCode=SystemGroup.GroupCode where OperationCode = '{0}' and (( AccessRangeType=0 and relationCode = '{1}' ) or ( AccessRangeType=1 and relationCode in ( {2} ) )  ) ", new object[] { operationCode, userCode, codes });
            QueryAgent agent       = new QueryAgent();
            DataSet    set         = agent.ExecSqlForDataSet(queryString);

            agent.Dispose();
            foreach (DataRow row in set.Tables[0].Rows)
            {
                if (!row.IsNull("FullID"))
                {
                    string text4 = row["FullID"].ToString();
                    int    num   = 0;
                    if (!row.IsNull("RoleLevel"))
                    {
                        num = (int)row["RoleLevel"];
                    }
                    if (num == 0)
                    {
                        text = text + string.Format("or (CaseCode in ( Select a2.CaseCode from  workflowCase a2 where a2.ProcedureCode in(select c1.ProcedureCode from WorkFlowProcedure c1 where isnull(c1.SysType, '') = '') and exists(select 1 from SystemGroup a1 where a1.GroupName in\t(dbo.GetProcedureNameByCaseCode(a2.CaseCode))\tand a1.ParentCode in (select a.GroupCode from SystemGroup a where a.GroupName =dbo.GetProjectNameByCaseCode(a2.CaseCode) and a.classcode='{1}') and a1.FullID like '{0}%'))\t)", text4, functionStructureParentCode);
                    }
                }
            }
            return(text);
        }
コード例 #11
0
ファイル: RoomModelList.aspx.cs プロジェクト: riyuexing/rms
        private void LoadData()
        {
            try
            {
                ModelStrategyBuilder sb = new ModelStrategyBuilder();

                sb.AddStrategy(new Strategy(ModelStrategyName.ProjectCode, txtProjectCode.Value));

                sb.AddOrder("ModelName", true);
                string sql = sb.BuildQueryDoorNumString();

                QueryAgent qa     = new QueryAgent();
                EntityData entity = qa.FillEntityData("Model", sql);
                qa.Dispose();

                this.dgList.DataSource = entity.CurrentTable;
                this.dgList.DataBind();
                entity.Dispose();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "初始化页面出错:" + ex.Message));
            }
        }
コード例 #12
0
ファイル: PaymentInfo.aspx.cs プロジェクト: riyuexing/rms
        /// <summary>
        /// 显示付款单明细
        /// </summary>
        private void BindPayoutDataGrid()
        {
            try
            {
                string PaymentCode = this.txtPaymentCode.Value;

                PayoutItemStrategyBuilder sb = new PayoutItemStrategyBuilder("V_PayoutItem");
                sb.AddStrategy(new Strategy(PayoutItemStrategyName.PaymentCode, PaymentCode));
//				sb.AddStrategy( new Strategy( PayoutItemStrategyName.Status,"1"));
                sb.AddOrder("PayoutDate", true);
                sb.AddOrder("PayoutItemCode", true);
                string sql = sb.BuildMainQueryString();

                QueryAgent qa     = new QueryAgent();
                EntityData entity = qa.FillEntityData("V_PayoutItem", sql);
                qa.Dispose();

                DataTable tb = entity.CurrentTable;
                BLL.PaymentRule.VoucherDetailAddColumnSubjectName(tb, this.txtSubjectSetCode.Value);

                this.dgPayoutItem.Columns[4].FooterText = BLL.MathRule.SumColumn(tb, "PayoutCash").ToString("N");
                this.dgPayoutItem.DataSource            = tb;
                this.dgPayoutItem.DataBind();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "显示列表出错:" + ex.Message));
            }
        }
コード例 #13
0
        /// ****************************************************************************
        /// <summary>
        /// 数据加载
        /// </summary>
        /// ****************************************************************************
        private void LoadData()
        {
            try
            {
                WorkFlowActStrategyBuilder sb = new WorkFlowActStrategyBuilder();
                sb.AddStrategy(new Strategy(DAL.QueryStrategy.WorkFlowActStrategyName.ActCode, this.ActCode));

                string sql = sb.BuildMainQueryString();

                QueryAgent QA     = new QueryAgent();
                EntityData entity = QA.FillEntityData("WorkFlowAct", sql);
                this.ViewState["_CaseCode"] = entity.CurrentRow["CaseCode"].ToString();
                QA.Dispose();
                entity.Dispose();

                WorkCase workCase = Rms.WorkFlow.WorkCaseManager.GetWorkCase(this.ViewState["_CaseCode"].ToString());

                this.ViewState["_ApplicationCode"] = workCase.ApplicationCode;

                Act currentAct = workCase.GetAct(this.ActCode);

                Procedure procedure = DefinitionManager.GetProcedureDifinition(workCase.ProcedureCode, true);

                this.ViewState["_ProcedureCode"] = procedure.ProcedureCode;

                Task currentTask = procedure.GetTask(currentAct.ToTaskCode);

                this.contentspan.InnerHtml = WriteOpinion(workCase, currentTask, currentAct);
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
            }
        }
コード例 #14
0
ファイル: CostRule.cs プロジェクト: riyuexing/rms
        public static decimal GetTotalCost(string projectCode)
        {
            decimal num2;

            try
            {
                decimal    num   = 0M;
                QueryAgent agent = new QueryAgent();
                try
                {
                    string format = "select sum(isnull(money, 0)) as TotalCost from Payout where ProjectCode = '{0}'";
                    num = ConvertRule.ToDecimal(agent.ExecuteScalar(string.Format(format, projectCode)));
                }
                finally
                {
                    agent.Dispose();
                }
                num2 = num;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(num2);
        }
コード例 #15
0
ファイル: WorkFlowCommon.aspx.cs プロジェクト: ishui/rms
    private void initDDLWorkFlowCommonByRight(DropDownList pm_ddlWorkFlowCommon)
    {
        RmsPM.DAL.QueryStrategy.WorkFlowProcedureStrategyBuilder WFPSB = new RmsPM.DAL.QueryStrategy.WorkFlowProcedureStrategyBuilder();

        ArrayList arA = new ArrayList();

        arA.Add("090202");
        arA.Add(user.UserCode);
        arA.Add(user.BuildStationCodes());
        WFPSB.AddStrategy(new Strategy(WorkFlowProcedureStrategyName.AccessRange, arA));
        WFPSB.AddStrategy(new Strategy(WorkFlowProcedureStrategyName.Activity, "1"));

        WFPSB.IsNeedWhere = false;

        string sql = WFPSB.BuildQueryViewString();

        QueryAgent qa     = new QueryAgent();
        EntityData entity = qa.FillEntityData("WorkFlowProcedure", sql);

        qa.Dispose();

        pm_ddlWorkFlowCommon.DataSource     = entity.CurrentTable;
        pm_ddlWorkFlowCommon.DataTextField  = "ProcedureName";
        pm_ddlWorkFlowCommon.DataValueField = "ProcedureCode";
        pm_ddlWorkFlowCommon.DataBind();
    }
コード例 #16
0
        private void LoadData()
        {
            //初始化符合条件的数据列表
            string Name = this.txtUserName.Text.Trim();

            try
            {
                RmsPM.DAL.QueryStrategy.UserStrategyBuilder USB = new RmsPM.DAL.QueryStrategy.UserStrategyBuilder();
                if (Name.Length > 0)
                {
                    USB.AddStrategy(new Strategy(RmsPM.DAL.QueryStrategy.UserStrategyName.UserName, "%" + Name + "%"));
                }
                string     Sql = USB.BuildMainQueryString();
                QueryAgent QA  = new QueryAgent();
                EntityData ds  = QA.FillEntityData("SystemUser", Sql);
                QA.Dispose();

                this.dgPersonList.DataSource = new DataView(ds.CurrentTable);
                this.dgPersonList.DataBind();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "加载人员列表失败");
            }
        }
コード例 #17
0
ファイル: WorkFlowCommon.aspx.cs プロジェクト: ishui/rms
    private void LoadDataGrid()
    {
        try
        {
            string     sql    = (string)this.ViewState["SearchString"];
            QueryAgent qa     = new QueryAgent();
            EntityData entity = qa.FillEntityData("WorkFlowCommon", sql);
            qa.Dispose();


            DataView ud_dvWorkFlowCommon = new DataView(entity.CurrentTable);

            ud_dvWorkFlowCommon.Sort = "WorkFlowID";

            this.dgList.DataSource = ud_dvWorkFlowCommon;
            this.dgList.DataBind();
            this.GridPagination1.RowsCount = entity.CurrentTable.Rows.Count.ToString();

            entity.Dispose();
        }
        catch (Exception ex)
        {
            ApplicationLog.WriteLog(this.ToString(), ex, "加载通用流程列表错误。");
            Response.Write(Rms.Web.JavaScript.Alert(true, "加载通用流程列表错误:" + ex.Message));
        }
    }
コード例 #18
0
ファイル: ConstructRule.cs プロジェクト: riyuexing/rms
        public static decimal CalcInvestByVisualProgress(decimal TotalInvest, string VisualProgress, int TotalFloorCount, int CurrFloorCount)
        {
            decimal num2;

            try
            {
                decimal    num   = 0M;
                QueryAgent agent = new QueryAgent();
                try
                {
                    string format = "select dbo.GetTotalCompleteInvestNew({0}, '{1}', {2}, {3})";
                    format = string.Format(format, new object[] { TotalInvest, VisualProgress, TotalFloorCount, CurrFloorCount });
                    num    = ConvertRule.ToDecimal(agent.ExecuteScalar(format));
                }
                finally
                {
                    agent.Dispose();
                }
                num2 = num;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(num2);
        }
コード例 #19
0
ファイル: User.cs プロジェクト: riyuexing/rms
        public string GetOperationType()
        {
            string temp = "";

            /*if(HasOperationRight("200101"))
             *      temp += "Y1";
             * if(HasOperationRight("200102"))
             *      temp += "Y2";
             * if(HasOperationRight("200103"))
             *      temp += "Y3";
             * if(HasOperationRight("200201"))
             *      temp += "N1";
             * if(HasOperationRight("200202"))
             *      temp += "N2";*/

            AccessRangeStrategyBuilder sb = new AccessRangeStrategyBuilder();
            ArrayList ar = new ArrayList();

            ar.Add(this.m_UserCode);
            ar.Add(BuildStationCodes());
            sb.AddStrategy(new Strategy(AccessRangeStrategyName.AccessRelation1, ar));
            sb.AddStrategy(new Strategy(AccessRangeStrategyName.OperationCodeIn, "'Y1','Y2','Y3','N1','N2'"));
            QueryAgent qa     = new QueryAgent();
            string     sql    = sb.BuildMainQueryString();
            EntityData entity = qa.FillEntityData("AccessRange", sql);

            qa.Dispose();

            for (int i = 0; i < entity.CurrentTable.Rows.Count; i++)
            {
                temp += "," + entity.CurrentTable.Rows[i]["OperationCode"].ToString();
            }
            return(temp);
        }
コード例 #20
0
ファイル: ConstructRule.cs プロジェクト: riyuexing/rms
        public static EntityData GetConstructProgressReportFirstKg(string PBSUnitCode)
        {
            EntityData data2;

            try
            {
                string visualProgressNotStartInStr       = PBSRule.GetVisualProgressNotStartInStr();
                ConstructProgressStrategyBuilder builder = new ConstructProgressStrategyBuilder();
                builder.AddStrategy(new Strategy(ConstructProgressStrategyName.PBSUnitCode, PBSUnitCode));
                builder.AddStrategy(new Strategy(ConstructProgressStrategyName.VisualProgressNotIn, visualProgressNotStartInStr));
                builder.AddOrder("ReportDate", true);
                builder.AddOrder("ProgressCode", true);
                string     queryString = builder.BuildQueryViewString();
                QueryAgent agent       = new QueryAgent();
                agent.SetTopNumber(1);
                EntityData data = agent.FillEntityData("ConstructProgress", queryString);
                agent.Dispose();
                data2 = data;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
コード例 #21
0
ファイル: User.cs プロジェクト: riyuexing/rms
        /// <summary>
        /// 取有权限的操作列表(仅资源权限)
        /// </summary>
        /// <param name="code"></param>
        /// <param name="className"></param>
        /// <returns></returns>
        public EntityData GetOperationEntityDataOfResource(string code, string className)
        {
            try
            {
                string stationCodes = BuildStationCodeString(this.BuildStationCodes());

                object[] ooo = new object[] { code
                                              , SystemClassDescription.GetItemClassCode(className)
                                              , this.UserCode
                                              , stationCodes
                                              , SystemClassDescription.GetItemTableName(className)
                                              , SystemClassDescription.GetItemKeyColumnName(className)
                                              , SystemClassDescription.GetItemTypeColumnName(className)
                                              , SystemClassDescription.GetItemCreateUserColumnName(className) };

                string selfAccessString = String.Format(" ( AccessRange.ResourceCode = ( Select ResourceCode from Resource where RelationCode='{0}' and ClassCode='{1}' ) and ( ( AccessRange.AccessRangeType=0 and AccessRange.relationCode = '{2}' )  or ( AccessRange.AccessRangeType=1 and AccessRange.relationCode in ( {3} ) and ( RoleLevel <> 1 or RoleLevel is null ) )   or ( AccessRange.AccessRangeType=1 and AccessRange.relationCode in ( {3} ) and  RoleLevel = 1 and {4}.{7}='{2}'  )  )  ) "
                                                        , ooo);

                string sss = String.Format("select accessrange.* from accessrange , {4} where substring (AccessRange.operationCode,1,4 )='{1}' and {4}.{5} = '{0}' and ( " + selfAccessString + " )"
                                           , ooo);

                QueryAgent qa     = new QueryAgent();
                EntityData entity = qa.FillEntityData("AccessRange", sss);
                qa.Dispose();
                return(entity);
            }
            catch (Exception ex)
            { throw ex; }
        }
コード例 #22
0
ファイル: ConstructRule.cs プロジェクト: riyuexing/rms
        public static object GetConstructProgressStepFirstKg(string PBSUnitCode)
        {
            object obj3;

            try
            {
                object obj2 = DBNull.Value;
                string visualProgressNotStartInStr           = PBSRule.GetVisualProgressNotStartInStr();
                ConstructProgressStepStrategyBuilder builder = new ConstructProgressStepStrategyBuilder();
                builder.AddStrategy(new Strategy(ConstructProgressStepStrategyName.PBSUnitCode, PBSUnitCode));
                builder.AddStrategy(new Strategy(ConstructProgressStepStrategyName.VisualProgressNotIn, visualProgressNotStartInStr));
                builder.AddStrategy(new Strategy(ConstructProgressStepStrategyName.StartDateNotNull));
                builder.AddOrder("StartDate", true);
                string     queryString = builder.BuildMainQueryString();
                QueryAgent agent       = new QueryAgent();
                agent.SetTopNumber(1);
                EntityData data = agent.FillEntityData("ConstructProgressStep", queryString);
                agent.Dispose();
                if (data.HasRecord())
                {
                    obj2 = data.CurrentRow["StartDate"];
                }
                obj3 = obj2;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(obj3);
        }
コード例 #23
0
ファイル: SalRule.cs プロジェクト: riyuexing/rms
        public static decimal GetSalTotalAreaByProjectBuilding(string ProjectCode, string BuildingName)
        {
            decimal num2;

            try
            {
                decimal    num   = 0M;
                QueryAgent agent = new QueryAgent();
                try
                {
                    object obj2 = agent.ExecuteScalar(string.Format("select sum(isnull(BuildDim, 0)) from SalContract where ProjectCode = '{0}' and BuildingName = '{1}'", ProjectCode, BuildingName));
                    if ((obj2 != null) && (obj2 != DBNull.Value))
                    {
                        try
                        {
                            num = decimal.Parse(obj2.ToString());
                        }
                        catch
                        {
                        }
                    }
                }
                finally
                {
                    agent.Dispose();
                }
                num2 = num;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(num2);
        }
コード例 #24
0
ファイル: ConstructRule.cs プロジェクト: riyuexing/rms
        public static EntityData GetLastConstructProgressReport(string PBSUnitCode, string EndDate, int n)
        {
            EntityData data2;

            try
            {
                ConstructProgressStrategyBuilder builder = new ConstructProgressStrategyBuilder();
                builder.AddStrategy(new Strategy(ConstructProgressStrategyName.PBSUnitCode, PBSUnitCode));
                ArrayList pas = new ArrayList();
                pas.Add("");
                pas.Add(EndDate);
                builder.AddStrategy(new Strategy(ConstructProgressStrategyName.ReportDateRange, pas));
                builder.AddOrder("ReportDate", false);
                builder.AddOrder("ProgressCode", false);
                string     queryString = builder.BuildQueryViewString();
                QueryAgent agent       = new QueryAgent();
                agent.SetTopNumber(n);
                EntityData data = agent.FillEntityData("ConstructProgress", queryString);
                agent.Dispose();
                data2 = data;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
コード例 #25
0
ファイル: SalRule.cs プロジェクト: riyuexing/rms
        public static string GetSalCBVoucherCode(string BuildingName, string ProjectCode)
        {
            string text2;

            try
            {
                string     text  = "";
                QueryAgent agent = new QueryAgent();
                try
                {
                    object obj2 = agent.ExecuteScalar(string.Format("select dbo.GetSalCBVoucherCode('{0}', '{1}')", BuildingName, ProjectCode));
                    if ((obj2 != null) && (obj2 != DBNull.Value))
                    {
                        text = obj2.ToString();
                    }
                }
                finally
                {
                    agent.Dispose();
                }
                text2 = text;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(text2);
        }
コード例 #26
0
        private void LoadData()
        {
            try
            {
                //temp,天阳要求时间较紧 update by kenny 20070209
                string company = System.Configuration.ConfigurationManager.AppSettings["PMName"].ToLower();
                switch (company)
                {
                case "tianyangoa":
                    this.dgList.Columns[7].Visible = true;
                    break;

                default:
                    this.dgList.Columns[7].Visible = false;
                    break;
                }
                string     sql    = (string)this.ViewState["SqlString"];
                QueryAgent qa     = new QueryAgent();
                EntityData entity = qa.FillEntityData("WorkFlowAct", sql);
                qa.Dispose();
                this.dgList.DataSource = entity.CurrentTable;
                this.dgList.DataBind();
                this.gpControl.RowsCount = entity.CurrentTable.Rows.Count.ToString();
                entity.Dispose();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
            }
        }
コード例 #27
0
ファイル: SubjectRule.cs プロジェクト: riyuexing/rms
        public static string GetSelfAccountUnitName(string subjectSetCode)
        {
            string text3;

            try
            {
                string text = "";
                UnitStrategyBuilder builder = new UnitStrategyBuilder();
                builder.AddStrategy(new Strategy(UnitStrategyName.SubjectSetCode, subjectSetCode));
                builder.AddStrategy(new Strategy(UnitStrategyName.SelfAccount, "1"));
                string     queryString = builder.BuildMainQueryString();
                QueryAgent agent       = new QueryAgent();
                EntityData data        = agent.FillEntityData("Unit", queryString);
                agent.Dispose();
                if (data.HasRecord())
                {
                    text = data.GetString("UnitName");
                }
                text3 = text;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(text3);
        }
コード例 #28
0
        private void LoadData()
        {
            string projectCode = Request["ProjectCode"] + "";

            try
            {
                string isDynamic         = Request["IsDynamic"] + "";
                BudgetStrategyBuilder sb = new BudgetStrategyBuilder();
                sb.AddStrategy(new Strategy(BudgetStrategyName.ProjectCode, projectCode));
                if (isDynamic != "")
                {
                    sb.AddStrategy(new Strategy(BudgetStrategyName.IsDynamic, isDynamic));
                }

                string     sql = sb.BuildMainQueryString();
                QueryAgent qa  = new QueryAgent();
                qa.SetTopNumber(1);
                EntityData budget = qa.FillEntityData("Budget", sql);
                qa.Dispose();

                this.dgList.DataSource = budget.CurrentTable;
                this.dgList.DataBind();
                budget.Dispose();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "加载列表错误");
            }
        }
コード例 #29
0
ファイル: ConstructDAO.cs プロジェクト: ishui/rms2
        public static EntityData GetLastVisualProgress(string ProgressType)
        {
            EntityData data2;

            try
            {
                VisualProgressStrategyBuilder builder = new VisualProgressStrategyBuilder();
                if (ProgressType != "")
                {
                    builder.AddStrategy(new Strategy(VisualProgressStrategyName.ProgressType, ProgressType.ToString()));
                }
                builder.AddOrder("SortID", false);
                string     queryString = builder.BuildMainQueryString();
                QueryAgent agent       = new QueryAgent();
                agent.SetTopNumber(1);
                EntityData data = agent.FillEntityData("VisualProgress", queryString);
                agent.Dispose();
                data2 = data;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
コード例 #30
0
ファイル: SystemGroupRule.cs プロジェクト: riyuexing/rms
        public static string GetSystemGroupSortIDByGroupNameAndClassCode(string pm_sGroupName, string pm_sClassCode)
        {
            string text3;

            try
            {
                string text = "";
                SystemGroupStrategyBuilder builder = new SystemGroupStrategyBuilder();
                builder.AddStrategy(new Strategy(SystemGroupStrategyName.GroupName, pm_sGroupName));
                builder.AddStrategy(new Strategy(SystemGroupStrategyName.ClassCode, pm_sClassCode));
                string     queryString = builder.BuildMainQueryString();
                QueryAgent agent       = new QueryAgent();
                EntityData data        = agent.FillEntityData("SystemGroup", queryString);
                agent.Dispose();
                if (data.HasRecord())
                {
                    text = data.GetString("SortID");
                }
                data.Dispose();
                text3 = text;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(text3);
        }