Exemplo n.º 1
0
        public int UpdatePremium(CRMPremium theCrmPremium)
        {
            int ReturnValue = 0;

            SqlCommand UpdateCommand = new SqlCommand();

            UpdateCommand.CommandType = CommandType.StoredProcedure;

            UpdateCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;
            UpdateCommand.Parameters.Add(GetParameter("PremiumTableID", SqlDbType.Int, theCrmPremium.PremiumTableID));

            UpdateCommand.Parameters.Add(GetParameter("PremiumTableReferenceName", SqlDbType.VarChar, theCrmPremium.PremiumTableReferenceName));
            UpdateCommand.Parameters.Add(GetParameter("PremiumTableDescriptiveName", SqlDbType.VarChar, theCrmPremium.PremiumTableDescriptiveName));
            UpdateCommand.Parameters.Add(GetParameter("TenureInYears", SqlDbType.Decimal, theCrmPremium.TenureInYears));
            UpdateCommand.Parameters.Add(GetParameter("EffectiveDateFrom", SqlDbType.VarChar, theCrmPremium.EffectiveDateFrom));

            UpdateCommand.Parameters.Add(GetParameter("PolicyID", SqlDbType.Int, theCrmPremium.PolicyID));

            UpdateCommand.Parameters.Add(GetParameter("@OfficeId", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID));

            UpdateCommand.Parameters.Add(GetParameter("@ModifiedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID));


            UpdateCommand.CommandText = "pCRM_PremiumTables_Update";

            ExecuteStoredProcedure(UpdateCommand);
            ReturnValue = int.Parse(UpdateCommand.Parameters[0].Value.ToString());

            return(ReturnValue);
        }
Exemplo n.º 2
0
        public int DeletePremium(CRMPremium theCrmPremium)
        {
            int ReturnValue = 0;

            SqlCommand DeleteCommand = new SqlCommand();

            DeleteCommand.CommandType = CommandType.StoredProcedure;
            DeleteCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;

            DeleteCommand.Parameters.Add(GetParameter("@PremiumTableID", SqlDbType.Int, theCrmPremium.PremiumTableID));
            DeleteCommand.CommandText = "pCRM_PremiumTables_Delete";

            ExecuteStoredProcedure(DeleteCommand);
            ReturnValue = int.Parse(DeleteCommand.Parameters[0].Value.ToString());

            return(ReturnValue);
        }
Exemplo n.º 3
0
        public static CRMPremium GetPremiumById(int recordId)
        {
            DataRow CRMPolicyRow = CrmPremiumDataAccess.GetInstance.GetPremiumById(recordId);

            CRMPremium TheCRMPremium = new CRMPremium
            {
                PremiumTableID              = int.Parse(CRMPolicyRow["PremiumTableID"].ToString()),
                PolicyID                    = int.Parse(CRMPolicyRow["PolicyID"].ToString()),
                PremiumTableReferenceName   = CRMPolicyRow["PremiumTableReferenceName"].ToString(),
                PremiumTableDescriptiveName = CRMPolicyRow["PremiumTableDescriptiveName"].ToString(),
                TenureInYears               = double.Parse(CRMPolicyRow["TenureInYears"].ToString())
            };

            //TheCRMPremium.EffectiveDateFrom = CRMPolicyRow["EffectiveDateFrom"].ToString();


            return(TheCRMPremium);
        }
Exemplo n.º 4
0
        public static List <CRMPremium> GetPremium()
        {
            List <CRMPremium> CRMPremiumList = new List <CRMPremium>();

            DataTable GetPremiumTable = CrmPremiumDataAccess.GetInstance.GetPremium();

            foreach (DataRow dr in GetPremiumTable.Rows)
            {
                CRMPremium ThePremium = new CRMPremium
                {
                    PremiumTableID              = int.Parse(dr["PremiumTableID"].ToString()),
                    PolicyID                    = int.Parse(dr["PolicyID"].ToString()),  /*ThePremium.PolicyName = dr["PolicyName"].ToString();*/
                    PremiumTableReferenceName   = dr["PremiumTableReferenceName"].ToString(),
                    PremiumTableDescriptiveName = dr["PremiumTableDescriptiveName"].ToString(),
                    TenureInYears               = double.Parse(dr["TenureInYears"].ToString()),
                    EffectiveDateFrom           = dr["EffectiveDateFrom"].ToString()
                };

                CRMPremiumList.Add(ThePremium);
            }
            return(CRMPremiumList);
        }
Exemplo n.º 5
0
 public static int DeletePremium(CRMPremium theCrmPremium)
 {
     return(CrmPremiumDataAccess.GetInstance.DeletePremium(theCrmPremium));
 }
Exemplo n.º 6
0
 public static int InsertPremium(CRMPremium theCrmPremium)
 {
     return(CrmPremiumDataAccess.GetInstance.InsertPremium(theCrmPremium));
 }
 public int DeletePremium(CRMPremium theCrmPremium)
 {
     return(CrmPremiumIntegration.DeletePremium(theCrmPremium));
 }
 public int UpdatePremium(CRMPremium theCrmPremium)
 {
     return(CrmPremiumIntegration.UpdatePremium(theCrmPremium));
 }
 public int InsertPremium(CRMPremium theCrmPremium)
 {
     return(CrmPremiumIntegration.InsertPremium(theCrmPremium));
 }