예제 #1
0
        public static string GetSubjectSetName(string subjectSetCode)
        {
            string text2;

            try
            {
                string text = "";
                if (subjectSetCode == "")
                {
                    return(text);
                }
                EntityData subjectSetByCode = SubjectDAO.GetSubjectSetByCode(subjectSetCode);
                if (subjectSetByCode.HasRecord())
                {
                    text = subjectSetByCode.GetString("SubjectSetName");
                }
                subjectSetByCode.Dispose();
                text2 = text;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(text2);
        }
예제 #2
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                string unitCode       = Request["CorpCode"] + "";
                int    isSelfAccount  = 0;
                string subjectSetCode = Request["SubjectSetCode"] + "";
                if (subjectSetCode == "" && unitCode != "")
                {
                    subjectSetCode = BLL.SubjectRule.GetUnitSubjectSet(unitCode, ref isSelfAccount);
                }

                this.txtSubjectSetCode.Value = subjectSetCode;
//				this.txtSelfAccount.Value = isSelfAccount.ToString();
//				if ( isSelfAccount == 0 )
//				{
//					this.btnAdd.Visible = false;
//					this.btnImport.Visible = false;
//				}

                Rms.ORMap.EntityData m_SubjectSet = SubjectDAO.GetSubjectSetByCode(this.txtSubjectSetCode.Value);
                this.LabelSubjectSetName.Text = m_SubjectSet.GetString("SubjectSetName");
                m_SubjectSet.Dispose();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
            }
        }
예제 #3
0
        public static EntityData GetFinanceSubjectSetWithProject(DataTable tbRelation, string SubjectSetCode, string ProjectCode)
        {
            EntityData data3;

            try
            {
                EntityData allSubjectSet;
                EntityData data = new EntityData("SupplierSubjectSet");
                data.CurrentTable.Columns.Add("SubjectSetName");
                data.CurrentTable.Columns.Add("ProjectName");
                if (SubjectSetCode == "")
                {
                    allSubjectSet = SubjectDAO.GetAllSubjectSet();
                }
                else
                {
                    allSubjectSet = SubjectDAO.GetSubjectSetByCode(SubjectSetCode);
                }
                QueryAgent agent = new QueryAgent();
                try
                {
                    foreach (DataRow row in allSubjectSet.CurrentTable.Rows)
                    {
                        string text        = ConvertRule.ToString(row["FinanceInterfaceSupplierCode"]);
                        string queryString = "select * from ( select a.SubjectSetCode + '_' + p.ProjectCode as SupplierSubjectSetCode, a.SubjectSetCode, a.SubjectSetName, p.ProjectCode, p.ProjectName from SubjectSet a, Project p where a.SubjectSetCode = p.SubjectSetCode union all select a.SubjectSetCode + '_' as SupplierSubjectSetCode, a.SubjectSetCode, a.SubjectSetName, '', '集团' from SubjectSet a) as a where 1 = 1 and SubjectSetCode = '" + ConvertRule.ToString(row["SubjectSetCode"]) + "'";
                        if (text.ToUpper() == "ByGroup".ToUpper())
                        {
                            queryString = queryString + " and ProjectCode = ''";
                        }
                        else if (ProjectCode != "")
                        {
                            queryString = queryString + " and ProjectCode = '" + ProjectCode + "'";
                        }
                        else
                        {
                            queryString = queryString + " and ProjectCode <> ''";
                        }
                        queryString = queryString + " order by SubjectSetName, ProjectName";
                        DataTable tbSrc = agent.ExecSqlForDataSet(queryString).Tables[0];
                        foreach (DataRow row2 in tbSrc.Rows)
                        {
                            DataRow drDst = data.CurrentTable.NewRow();
                            ConvertRule.DataRowCopy(row2, drDst, tbSrc, data.CurrentTable);
                            data.CurrentTable.Rows.Add(drDst);
                        }
                    }
                }
                finally
                {
                    agent.Dispose();
                }
                foreach (DataRow row4 in tbRelation.Rows)
                {
                    string    text3    = ConvertRule.ToString(row4["SubjectSetCode"]);
                    string    text4    = ConvertRule.ToString(row4["ProjectCode"]);
                    string    text5    = ConvertRule.ToString(row4["U8Code"]);
                    DataRow[] rowArray = data.CurrentTable.Select(string.Format("SubjectSetCode='{0}' and ProjectCode='{1}'", text3, text4));
                    if (rowArray.Length > 0)
                    {
                        rowArray[0]["U8Code"] = text5;
                    }
                }
                allSubjectSet.Dispose();
                data3 = data;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data3);
        }