Esempio n. 1
0
        public string UpdatePolicyType(PolicyType polType)
        {
            try
            {
                SqlCommand cmd = new SqlCommand("sp_UpdatePolicyType");
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter("@PolicyType", polType.PolicyTypeName));
                cmd.Parameters.Add(new SqlParameter("@PolicyTypeDesc", polType.PolicyTypeDesc));
                cmd.Parameters.Add(new SqlParameter("@PolicyTypeID", polType.PolicyTypeID));

                return ExecuteNonQuery(cmd);
            }
            catch (Exception ex)
            {
                return "Sorry, the system is down right now. Please contact your system administrator.";
            }
        }
Esempio n. 2
0
        public string AddPolicyType(PolicyType policyType)
        {
            string result = "";
            try
            {
                SqlCommand cmd = new SqlCommand("sp_AddPolicyType");
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter("@PolicyType", policyType.PolicyTypeName));
                cmd.Parameters.Add(new SqlParameter("@PolicyTypeDesc", policyType.PolicyTypeDesc));
                result = ExecuteNonQuery(cmd);

            }
            catch (Exception ex)
            {
                result = "Sorry, the system is down right now. Please try again later.";
            }
            return result;
        }