示例#1
0
        public Office(String argConnection, Int32 argOfficeId)
        {
            mConnection = argConnection;
            string        pstrSql = "SELECT * FROM Office WHERE OfficeId=" + argOfficeId;
            SqlDataReader dr      = SqlHelper.ExecuteReader(Connection, CommandType.Text, pstrSql);

            if (dr.Read())
            {
                mOfficeId         = (System.Int32)dr["OfficeId"];
                mDefault          = (System.String)dr["Office"];
                mAddress          = (System.String)dr["Address"];
                mMilestone        = (System.String)dr["Milestone"];
                mCity             = (System.String)dr["City"];
                mPhone1           = (System.String)dr["Phone1"];
                mPhone2           = (System.String)dr["Phone2"];
                mContact          = (System.String)dr["Contact"];
                mContactRank      = (System.String)dr["ContactRank"];
                mContactEmail     = (System.String)dr["ContactEmail"];
                mContactMobile    = (System.String)dr["ContactMobile"];
                mGSTNo            = (System.String)dr["GSTNo"];
                mCompanyCode      = (System.String)dr["CompanyCode"];
                mInsuranceCompany = new InsuranceCompany(Connection, (int)dr["InsuranceCompanyId"]);
                mOfficeType       = new OfficeType(Connection, (int)dr["OfficeTypeId"]);
                mOfficeGST        = new OfficeGST(Connection, (int)dr["OfficeGSTID"]);
                mOfficeCode       = (System.String)dr["OfficeCode"];
            }
            else
            {
                Exception ex = new Exception("Identifier does not exist.");
                ex.Source = "Office.Office()";
                throw ex;
            }
            dr.Close();
        }
示例#2
0
 public PartCategory GetPartCategory(InsuranceCompany argCompany)
 {
     foreach (PartCategoryCompany var in this.PartCategoryCompanies.Values)
     {
         if (argCompany.InsuranceCompanyId == var.InsuranceCompany.InsuranceCompanyId)
         {
             return(var.PartCategory);
         }
     }
     return(this.PartCategory);
 }
示例#3
0
        public PartCategoryCompany(String argConnection, Int32 argPartCategoryCompanyId)
        {
            mConnection = argConnection;
            string        pstrSql = "SELECT * FROM PartCategoryCompany WHERE PartCategoryCompanyId=" + argPartCategoryCompanyId;
            SqlDataReader dr      = SqlHelper.ExecuteReader(Connection, CommandType.Text, pstrSql);

            if (dr.Read())
            {
                mPartCategoryCompanyId = (System.Int32)dr["PartCategoryCompanyId"];
                mPart             = new Part(Connection, (int)dr["PartId"]);
                mInsuranceCompany = new InsuranceCompany(Connection, (int)dr["InsuranceCompanyId"]);
                mPartCategory     = new PartCategory(Connection, (int)dr["PartCategoryId"]);
            }
            else
            {
                Exception ex = new Exception("Identifier does not exist.");
                ex.Source = "PartCategoryCompany.PartCategoryCompany()";
                throw ex;
            }
            dr.Close();
        }
示例#4
0
        public FeeSchedule(String argConnection, Int32 argFeeScheduleId)
        {
            mConnection = argConnection;
            string        pstrSql = "SELECT * FROM FeeSchedule WHERE FeeScheduleId=" + argFeeScheduleId;
            SqlDataReader dr      = SqlHelper.ExecuteReader(Connection, CommandType.Text, pstrSql);

            if (dr.Read())
            {
                mFeeScheduleId    = (System.Int32)dr["FeeScheduleId"];
                mInsuranceCompany = new InsuranceCompany(Connection, (int)dr["InsuranceCompanyId"]);
                mAssessmentType   = new AssessmentType(Connection, (int)dr["AssessmentTypeId"]);
                mDtWEF            = (System.DateTime)dr["DtWEF"];
                mIsEstimateBased  = (System.Boolean)dr["IsEstimateBased"];
            }
            else
            {
                Exception ex = new Exception("Identifier does not exist.");
                ex.Source = "FeeSchedule.FeeSchedule()";
                throw ex;
            }
            dr.Close();
        }
示例#5
0
        public FeeSchedule(String argConnection, AssessmentType assessmentType, Office office, DateTime dtAsOn)
        {
            mConnection = argConnection;
            string pstrSql = System.String.Format("SELECT * FROM FeeSchedule WHERE AssessmentTypeId={0} AND InsuranceCompanyId={1} AND DtWEF <= '{2:yyyyMMdd}' ORDER BY DtWEF DESC", assessmentType.AssessmentTypeId, office.InsuranceCompany.InsuranceCompanyId, dtAsOn);

            SqlDataReader dr = SqlHelper.ExecuteReader(Connection, CommandType.Text, pstrSql);

            if (dr.Read())
            {
                mFeeScheduleId    = (System.Int32)dr["FeeScheduleId"];
                mInsuranceCompany = new InsuranceCompany(Connection, (int)dr["InsuranceCompanyId"]);
                mAssessmentType   = new AssessmentType(Connection, (int)dr["AssessmentTypeId"]);
                mDtWEF            = (System.DateTime)dr["DtWEF"];
                mIsEstimateBased  = (System.Boolean)dr["IsEstimateBased"];
            }
            else
            {
                Exception ex = new Exception("Identifier does not exist.");
                ex.Source = "FeeSchedule.FeeSchedule()";
                throw ex;
            }
            dr.Close();
        }