示例#1
0
            public static List <clsDetails> getListOriginalDetails(clsScheme Scheme)
            {
                string strClientID = Scheme.propClient.propClientID;
                string strSchemeID = Scheme.propSchemeID;

                SqlConnection con = new clsScheme().con;
                SqlCommand    cmd = new SqlCommand();
                SqlDataReader dr;

                con.Open();
                cmd.Connection  = con;
                cmd.CommandType = System.Data.CommandType.StoredProcedure;
                cmd.CommandText = "SWITCHScheme_DetailsGetOriginal";

                cmd.Parameters.Add("@param_strClientID", System.Data.SqlDbType.NVarChar).Value = strClientID;
                cmd.Parameters.Add("@param_strSchemeID", System.Data.SqlDbType.NVarChar).Value = strSchemeID;

                dr = cmd.ExecuteReader();

                List <clsDetails> newListDetails = new List <clsDetails>();

                while (dr.Read())
                {
                    clsDetails newDetails = new clsDetails();


                    newDetails.propClient             = dr["ClientID"] != System.DBNull.Value ? new clsClient(dr["ClientID"].ToString()) : null;
                    newDetails.propClientCurrency     = newDetails.propClient.propCurrency;
                    newDetails.propCurrentValueClient = dr["CurrentValueClient"] != System.DBNull.Value ? float.Parse(dr["CurrentValueClient"].ToString()) : 0;
                    newDetails.propCurrentValueScheme = dr["CurrentValueScheme"] != System.DBNull.Value ? float.Parse(dr["CurrentValueScheme"].ToString()) : 0;
                    newDetails.propExchangeRate       = dr["ExchangeRate"] != System.DBNull.Value ? float.Parse(dr["ExchangeRate"].ToString()) : 0;
                    newDetails.propFund             = dr["FundNameID"] != System.DBNull.Value ? new clsFund(int.Parse(dr["FundNameID"].ToString())) : null;
                    newDetails.propFundExchangeRate = dr["FundExchangeRate"] != System.DBNull.Value ? float.Parse(dr["FundExchangeRate"].ToString()) : 0;
                    newDetails.propIsOLDeleted      = dr["OLDeleted"] != System.DBNull.Value ? Boolean.Parse(dr["OLDeleted"].ToString()) : false;
                    newDetails.propScheme           = Scheme;
                    newDetails.propSEDOL            = dr["SEDOL"] != System.DBNull.Value ? dr["SEDOL"].ToString() : "";
                    newDetails.propUnits            = dr["NumberOfUnits"] != System.DBNull.Value ? float.Parse(dr["NumberOfUnits"].ToString()) : 0;
                    newDetails.propValue            = dr["Value"] != System.DBNull.Value ? float.Parse(dr["Value"].ToString()) : 0;
                    newDetails.propAllocation       = (newDetails.propCurrentValueScheme / Scheme.propSC_TotalValue) * 100;

                    newListDetails.Add(newDetails);
                }

                con.Close();
                cmd.Dispose();

                return(newListDetails);
            }
示例#2
0
            public static List<clsDetails> getListOriginalDetails(clsScheme Scheme)
            {

                string strClientID = Scheme.propClient.propClientID;
                string strSchemeID = Scheme.propSchemeID;

                SqlConnection con = new clsScheme().con;
                SqlCommand cmd = new SqlCommand();
                SqlDataReader dr;

                con.Open();
                cmd.Connection = con;
                cmd.CommandType = System.Data.CommandType.StoredProcedure;
                cmd.CommandText = "SWITCHScheme_DetailsGetOriginal";

                cmd.Parameters.Add("@param_strClientID", System.Data.SqlDbType.NVarChar).Value = strClientID;
                cmd.Parameters.Add("@param_strSchemeID", System.Data.SqlDbType.NVarChar).Value = strSchemeID;

                dr = cmd.ExecuteReader();

                List<clsDetails> newListDetails = new List<clsDetails>();

                while (dr.Read())
                {
                    clsDetails newDetails = new clsDetails();

                                                           
                    newDetails.propClient = dr["ClientID"] != System.DBNull.Value ? new clsClient(dr["ClientID"].ToString()) : null;
                    newDetails.propClientCurrency = newDetails.propClient.propCurrency;
                    newDetails.propCurrentValueClient = dr["CurrentValueClient"] != System.DBNull.Value ? float.Parse(dr["CurrentValueClient"].ToString()) : 0;
                    newDetails.propCurrentValueScheme = dr["CurrentValueScheme"] != System.DBNull.Value ? float.Parse(dr["CurrentValueScheme"].ToString()) : 0;
                    newDetails.propExchangeRate = dr["ExchangeRate"] != System.DBNull.Value ? float.Parse(dr["ExchangeRate"].ToString()) : 0;
                    newDetails.propFund = dr["FundNameID"] != System.DBNull.Value ? new clsFund(int.Parse(dr["FundNameID"].ToString())) : null;
                    newDetails.propFundExchangeRate = dr["FundExchangeRate"] != System.DBNull.Value ? float.Parse(dr["FundExchangeRate"].ToString()) : 0;
                    newDetails.propIsOLDeleted = dr["OLDeleted"] != System.DBNull.Value ? Boolean.Parse(dr["OLDeleted"].ToString()) : false;
                    newDetails.propScheme = Scheme;
                    newDetails.propSEDOL = dr["SEDOL"] != System.DBNull.Value ? dr["SEDOL"].ToString() : "";
                    newDetails.propUnits = dr["NumberOfUnits"] != System.DBNull.Value ? float.Parse(dr["NumberOfUnits"].ToString()) : 0;
                    newDetails.propValue = dr["Value"] != System.DBNull.Value ? float.Parse(dr["Value"].ToString()) : 0;
                    newDetails.propAllocation = (newDetails.propCurrentValueScheme / Scheme.propSC_TotalValue) * 100;                    
                    
                    newListDetails.Add(newDetails);
                }

                con.Close();
                cmd.Dispose();

                return newListDetails;
            }