public static CRMPolicy PolicyTypeDataRowToObject(DataRow dr)
        {
            CRMPolicy TheCRMPolicyType = new CRMPolicy
            {
                PolicyID               = int.Parse(dr["PolicyID"].ToString()),
                PolicyName             = dr["PolicyName"].ToString(),
                PolicyFromOrganization = dr["PolicyFromOrganization"].ToString(),
                TenureInYears          = dr["TenureInYears"].ToString(),
                TenureInMonths         = int.Parse(dr["TenureInMonths"].ToString()),
                AllowDeathCompensation = bool.Parse(dr["AllowDeathCompensation"].ToString()),
                AllowMediclaim         = bool.Parse(dr["AllowMediclaim"].ToString()),
                AllowPolicySurrender   = bool.Parse(dr["AllowPolicySurrender"].ToString()),
                AllowPreMaturity       = bool.Parse(dr["AllowPreMaturity"].ToString()),
                AllowRevival           = bool.Parse(dr["AllowRevival"].ToString()),
                DatabaseTableName      = dr["DatabaseTableName"].ToString(),
                StoredProcedureName    = dr["StoredProcedureName"].ToString(),
                EffectiveDateFrom      = DateTime.Parse(dr["EffectiveDateFrom"].ToString()).ToString(MicroConstants.DateFormat),
                OfficeID               = int.Parse(dr["OfficeID"].ToString()),
                OfficeName             = dr["OfficeName"].ToString(),
                PolicyTypeID           = int.Parse(dr["PolicyTypeID"].ToString()),
                PolicyTypeDescription  = dr["PolicyTypeDescription"].ToString(),
                PolicySubType          = dr["PolicySubType"].ToString()
            };

            return(TheCRMPolicyType);
        }
Пример #2
0
        public int UpdateCRMPolicy(CRMPolicy theCRMPolicy)
        {
            int ReturnValue = 0;

            using (SqlCommand UpdateCommand = new SqlCommand())
            {
                UpdateCommand.CommandType = CommandType.StoredProcedure;
                UpdateCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;
                UpdateCommand.Parameters.Add(GetParameter("@PolicyID", SqlDbType.Int, theCRMPolicy.PolicyID));
                UpdateCommand.Parameters.Add(GetParameter("@PolicyName", SqlDbType.VarChar, theCRMPolicy.PolicyName));
                UpdateCommand.Parameters.Add(GetParameter("@PolicyFromOrganization", SqlDbType.VarChar, theCRMPolicy.PolicyFromOrganization));
                UpdateCommand.Parameters.Add(GetParameter("@TenureInYears", SqlDbType.Decimal, theCRMPolicy.TenureInYears));
                UpdateCommand.Parameters.Add(GetParameter("@TenureInMonths", SqlDbType.Int, theCRMPolicy.TenureInMonths));
                UpdateCommand.Parameters.Add(GetParameter("@AllowDeathCompensation", SqlDbType.Bit, theCRMPolicy.AllowDeathCompensation));
                UpdateCommand.Parameters.Add(GetParameter("@AllowMediclaim", SqlDbType.Bit, theCRMPolicy.AllowMediclaim));
                UpdateCommand.Parameters.Add(GetParameter("@AllowPolicySurrender", SqlDbType.Bit, theCRMPolicy.AllowPolicySurrender));
                UpdateCommand.Parameters.Add(GetParameter("@AllowPreMaturity", SqlDbType.Bit, theCRMPolicy.AllowPreMaturity));
                UpdateCommand.Parameters.Add(GetParameter("@AllowRevival", SqlDbType.Bit, theCRMPolicy.AllowRevival));
                UpdateCommand.Parameters.Add(GetParameter("@DatabaseTableName", SqlDbType.VarChar, theCRMPolicy.DatabaseTableName));
                UpdateCommand.Parameters.Add(GetParameter("@StoredProcedureName", SqlDbType.VarChar, theCRMPolicy.StoredProcedureName));
                UpdateCommand.Parameters.Add(GetParameter("@EffectiveDateFrom", SqlDbType.VarChar, theCRMPolicy.EffectiveDateFrom));
                UpdateCommand.Parameters.Add(GetParameter("@OfficeId", SqlDbType.Int, theCRMPolicy.OfficeID));
                UpdateCommand.Parameters.Add(GetParameter("@ModifiedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID));
                UpdateCommand.CommandText = "pCRM_Policies_Update";
                ExecuteStoredProcedure(UpdateCommand);
                ReturnValue = int.Parse(UpdateCommand.Parameters[0].Value.ToString());
                return(ReturnValue);
            }
        }
        public static List <CRMPolicy> GetCRMPolicyTypeList()
        {
            List <CRMPolicy> CRMPolicyList      = new List <CRMPolicy>();
            DataTable        CRMPolicyTypeTable = CRMPolicyDataAccess.GetInstance.GetCRMPolicyTypeList();

            foreach (DataRow dr in CRMPolicyTypeTable.Rows)
            {
                CRMPolicy TheCRMPolicy = PolicyTypeDataRowToObject(dr);

                CRMPolicyList.Add(TheCRMPolicy);
            }

            return(CRMPolicyList);
        }
        public static List <CRMPolicy> GetCRMPolicyTypeOfficewiseList(bool allOffices = false, bool showDeleted = false)
        {
            List <CRMPolicy> CRMPolicyList      = new List <CRMPolicy>();
            DataTable        CRMPolicyTableType = CRMPolicyDataAccess.GetInstance.GetCRMPolicyTypeOfficewiseList(allOffices, showDeleted);

            foreach (DataRow dr in CRMPolicyTableType.Rows)
            {
                CRMPolicy TheCRMPolicy = PolicyTypeDataRowToObject(dr);

                CRMPolicyList.Add(TheCRMPolicy);
            }

            return(CRMPolicyList);
        }
        public static List <CRMPolicy> GetCRMPolicyTypeListByOfficeID(bool showInOfficewise = false)
        {
            List <CRMPolicy> CRMPolicyList      = new List <CRMPolicy>();
            DataTable        CRMPolicyTableType = CRMPolicyDataAccess.GetInstance.GetCRMPolicyTypeListByOfficeID(showInOfficewise);

            foreach (DataRow dr in CRMPolicyTableType.Rows)
            {
                CRMPolicy TheCRMPolicy = PolicyTypeDataRowToObject(dr);

                CRMPolicyList.Add(TheCRMPolicy);
            }

            return(CRMPolicyList);
        }
        public static CRMPolicy GetCRMPolicyTypeByID(int policyTypeID)
        {
            CRMPolicy TheCRMPolicyType;
            DataRow   CRMPolicyTypeRow = CRMPolicyDataAccess.GetInstance.GetCRMPolicyTypeByID(policyTypeID);

            if (CRMPolicyTypeRow != null)
            {
                TheCRMPolicyType = PolicyTypeDataRowToObject(CRMPolicyTypeRow);
            }
            else
            {
                TheCRMPolicyType = new CRMPolicy();
            }

            return(TheCRMPolicyType);
        }
Пример #7
0
        public int DeleteCRMPolicy(CRMPolicy theCRMPolicy)
        {
            int ReturnValue = 0;

            using (SqlCommand DeleteCommand = new SqlCommand())
            {
                DeleteCommand.CommandType = CommandType.StoredProcedure;
                DeleteCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;
                DeleteCommand.Parameters.Add(GetParameter("@PolicyID", SqlDbType.Int, theCRMPolicy.PolicyID));
                DeleteCommand.Parameters.Add(GetParameter("@ModifiedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID));
                DeleteCommand.CommandText = "pCRM_Policies_Delete";
                ExecuteStoredProcedure(DeleteCommand);
                ReturnValue = int.Parse(DeleteCommand.Parameters[0].Value.ToString());
                return(ReturnValue);
            }
        }
Пример #8
0
        public static List <CRMPolicy> GetPolicy()
        {
            List <CRMPolicy> CRMPolicyList = new List <CRMPolicy>();

            DataTable GetPolicyTable = CrmPremiumDataAccess.GetInstance.GetPolicy();

            foreach (DataRow dr in GetPolicyTable.Rows)
            {
                CRMPolicy ThePolicy = new CRMPolicy
                {
                    PolicyID   = int.Parse(dr["PolicyID"].ToString()),
                    PolicyName = dr["PolicyName"].ToString(),
                    PremiumTableReferenceName   = dr["PremiumTableReferenceName"].ToString(),
                    PremiumTableDescriptiveName = dr["PremiumTableDescriptiveName"].ToString(),
                    TenureInYears     = dr["TenureInYears"].ToString(),
                    EffectiveDateFrom = dr["EffectiveDateFrom"].ToString()
                };



                CRMPolicyList.Add(ThePolicy);
            }
            return(CRMPolicyList);
        }
 public static int DeleteCRMPolicy(CRMPolicy theCRMPolicy)
 {
     return(CRMPolicyDataAccess.GetInstance.DeleteCRMPolicy(theCRMPolicy));
 }
 public static int InsertCRMPolicy(CRMPolicy theCRMPolicy)
 {
     return(CRMPolicyDataAccess.GetInstance.InsertCRMPolicy(theCRMPolicy));
 }
 public int DeleteCRMPolicy(CRMPolicy theCRMPolicy)
 {
     return(CRMPolicyIntegration.DeleteCRMPolicy(theCRMPolicy));
 }
 public int UpdateCRMPolicy(CRMPolicy theCRMPolicy)
 {
     return(CRMPolicyIntegration.UpdateCRMPolicy(theCRMPolicy));
 }
 public int InsertCRMPolicy(CRMPolicy theCRMPolicy)
 {
     return(CRMPolicyIntegration.InsertCRMPolicy(theCRMPolicy));
 }