Пример #1
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, "");
            }
        }
Пример #2
0
 public override void FillEntity(string sqlString, string Param, object Value, EntityData entitydata, string tableName)
 {
     if (sqlString.Length != 0)
     {
         try
         {
             this.Open();
             SqlCommand selectCommand = this.BuildSqlCommand(sqlString);
             if (Param != null)
             {
                 selectCommand.Parameters.Add(Param, Value);
             }
             SqlDataAdapter adapter = new SqlDataAdapter(selectCommand);
             adapter.Fill(entitydata, tableName);
             selectCommand.Dispose();
             adapter.Dispose();
         }
         catch (Exception exception)
         {
             exception.HelpLink = " 相关sql语句: " + sqlString;
             throw exception;
         }
     }
 }
Пример #3
0
 public override void FillEntity(string sqlString, string[] Params, object[] Values, EntityData entitydata, string tableName)
 {
     if (sqlString.Length != 0)
     {
         try
         {
             this.Open();
             SqlCommand selectCommand = this.BuildSqlCommand(sqlString);
             if ((Params != null) && (Values != null))
             {
                 if (Params.Length != Values.Length)
                 {
                     throw new ApplicationException("参数和参数值不匹配");
                 }
                 int length = Params.Length;
                 if (length != 0)
                 {
                     for (int i = 0; i < length; i++)
                     {
                         if (Params[i] != null)
                         {
                             selectCommand.Parameters.Add(Params[i], Values[i]);
                         }
                     }
                 }
             }
             SqlDataAdapter adapter = new SqlDataAdapter(selectCommand);
             adapter.Fill(entitydata, tableName);
             selectCommand.Dispose();
             adapter.Dispose();
         }
         catch (Exception exception)
         {
             exception.HelpLink = " 相关sql语句: " + sqlString;
             throw exception;
         }
     }
 }