Пример #1
0
        /// <summary>
        /// Deletes a RuleSubSection record
        /// </summary>
        public static int Delete(RuleSubSectionDO DO)
        {
            SqlParameter _SubSection = new SqlParameter("SubSection", SqlDbType.VarChar);

            _SubSection.Value = DO.SubSection;

            SqlParameter[] _params = new SqlParameter[] {
                _SubSection
            };

            return DataCommon.ExecuteScalar("[dbo].[RuleSubSection_Delete]", _params, "dbo");
        }
 public ActionResult EditSubSection(RuleSubSectionDO RuleSubSection)
 {
     try
     {
         RuleBLL.Save(RuleSubSection);
         AjaxResult result = new AjaxResult(AjaxResult.AjaxStatus.OK, "The SubSection was updated");
         result.Data.Add("SubSection", RuleSubSection);
         return Json(result);
     }
     catch (Exception ex)
     {
         AjaxResult result = new AjaxResult(AjaxResult.AjaxStatus.ERROR, ex.Message);
         return Json(result);
     }
 }
Пример #3
0
        /// <summary>
        /// Creates a new RuleSubSection record
        /// </summary>
        public static void Create(RuleSubSectionDO DO)
        {
            SqlParameter _Section = new SqlParameter("Section", SqlDbType.VarChar);
            SqlParameter _SubSection = new SqlParameter("SubSection", SqlDbType.VarChar);
            SqlParameter _Description = new SqlParameter("Description", SqlDbType.VarChar);

            _Section.Value = DO.Section;
            _SubSection.Value = DO.SubSection;
            _Description.Value = DO.Description;

            SqlParameter[] _params = new SqlParameter[] {
                _Section,
                _SubSection,
                _Description
            };

            DataCommon.ExecuteNonQuery("[dbo].[RuleSubSection_Insert]", _params, "dbo");
        }
Пример #4
0
        /// <summary>
        /// Gets all RuleSubSection records
        /// </summary>
        public static RuleSubSectionDO[] GetAll()
        {
            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[RuleSubSection_GetAll]", new SqlParameter[] { }, "dbo");

            List<RuleSubSectionDO> objs = new List<RuleSubSectionDO>();

            while(sr.Read()){

                RuleSubSectionDO obj = new RuleSubSectionDO();

                obj.Section = sr.GetString(sr.GetOrdinal("Section"));
                obj.SubSection = sr.GetString(sr.GetOrdinal("SubSection"));
                obj.Description = sr.GetString(sr.GetOrdinal("Description"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }
Пример #5
0
        /// <summary>
        /// Selects RuleSubSection records by PK
        /// </summary>
        public static RuleSubSectionDO[] GetByPK(String SubSection)
        {
            SqlParameter _SubSection = new SqlParameter("SubSection", SqlDbType.VarChar);

            _SubSection.Value = SubSection;

            SqlParameter[] _params = new SqlParameter[] {
                _SubSection
            };

            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[RuleSubSection_GetByPK]", _params, "dbo");

            List<RuleSubSectionDO> objs = new List<RuleSubSectionDO>();

            while(sr.Read())
            {
                RuleSubSectionDO obj = new RuleSubSectionDO();

                obj.Section = sr.GetString(sr.GetOrdinal("Section"));
                obj.SubSection = sr.GetString(sr.GetOrdinal("SubSection"));
                obj.Description = sr.GetString(sr.GetOrdinal("Description"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }