Beispiel #1
0
        public AssessmentLabour(String argConnection, Int32 argAssessmentLabourId)
        {
            mConnection = argConnection;
            string        pstrSql = "SELECT * FROM AssessmentLabour WHERE AssessmentLabourId=" + argAssessmentLabourId;
            SqlDataReader dr      = SqlHelper.ExecuteReader(Connection, CommandType.Text, pstrSql);

            if (dr.Read())
            {
                mAssessmentLabourId = (System.Int32)dr["AssessmentLabourId"];
                mAssessment         = new Assessment(Connection, (int)dr["AssessmentId"]);
                mSrNo         = (System.String)dr["SrNo"];
                mClaimId      = (System.Int32)dr["ClaimId"];
                mDescClaimed  = dr["DescClaimed"].GetType() == typeof(System.DBNull) ? "" : (System.String)dr["DescClaimed"];
                mClaimed      = (System.Double)dr["Claimed"];
                mPart         = new Part(Connection, (int)dr["PartId"]);
                mDescAssessed = dr["DescAssessed"].GetType() == typeof(System.DBNull) ? "" : (System.String)dr["DescAssessed"];
                mAssessedRR   = (System.Double)dr["AssessedRR"];
                mAssessedDB   = (System.Double)dr["AssessedDB"];
                mPaintType    = new PaintType(Connection, (int)dr["PaintTypeId"]);
                mAssessedPT   = (System.Double)dr["AssessedPT"];
                mNetAssessed  = System.Double.Parse(dr["NetAssessed"].ToString());
                mWorkshop     = new Workshop(Connection, dr.GetInt32(dr.GetOrdinal("WorkshopId")));
                mEstimate     = new Estimate(Connection, dr.GetInt32(dr.GetOrdinal("EstimateId")));
            }
            else
            {
                Exception ex = new Exception("Identifier does not exist.");
                ex.Source = "AssessmentLabour.AssessmentLabour()";
                throw ex;
            }
            dr.Close();
        }
        public AssessmentPart(String argConnection, Int32 argAssessmentPartId)
        {
            TransactionType = enumDBTransaction.spNull;
            mConnection     = argConnection;
            string        pstrSql = "SELECT * FROM AssessmentPart WHERE AssessmentPartId=" + argAssessmentPartId;
            SqlDataReader dr      = SqlHelper.ExecuteReader(Connection, CommandType.Text, pstrSql);

            if (dr.Read())
            {
                mAssessmentPartId = (System.Int32)dr["AssessmentPartId"];
                mSrNo             = (System.String)dr["SrNo"];
                mPart             = new Part(Connection, (int)dr["PartId"]);
                mDescription      = (System.String)dr["Description"];
                mClaimed          = (System.Single)dr["Claimed"];
                mAssessed         = (System.Single)dr["Assessed"];
                mVATRate          = (System.Single)dr["VATRate"];
                mVAT = float.Parse(dr["VAT"].ToString());
                mDepreciationRate = (System.Single)dr["DepreciationRate"];
                mDepreciation     = (System.Single)dr["Depreciation"];
                mNetAssessed      = (System.Single)dr["NetAssessed"];
                mWorkshop         = new Workshop(Connection, dr.GetInt32(dr.GetOrdinal("WorkshopId")));
                mEstimate         = new Estimate(Connection, dr.GetInt32(dr.GetOrdinal("EstimateId")));
            }
            else
            {
                Exception ex = new Exception("Identifier does not exist.");
                ex.Source = "AssessmentPart.AssessmentPart()";
                throw ex;
            }
            dr.Close();
        }
 public PartEstimate(Estimate estimate, Workshop workshop, AssessmentParts assessmentParts)
 {
     this.Estimate        = estimate;
     this.Workshop        = workshop;
     this.AssessmentParts = assessmentParts;
 }
 public LabourEstimate(Estimate estimate, Workshop workshop, AssessmentLabours assessmentParts)
 {
     this.Estimate          = estimate;
     this.Workshop          = workshop;
     this.AssessmentLabours = assessmentParts;
 }