コード例 #1
0
        /// <summary>
        /// Deletes a RuleSection record
        /// </summary>
        public static int Delete(RuleSectionDO DO)
        {
            SqlParameter _Section = new SqlParameter("Section", SqlDbType.VarChar);

            _Section.Value = DO.Section;

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

            return DataCommon.ExecuteScalar("[dbo].[RuleSection_Delete]", _params, "dbo");
        }
コード例 #2
0
 public ActionResult EditSection(RuleSectionDO RuleSection)
 {
     try
     {
         RuleBLL.Save(RuleSection);
         AjaxResult result = new AjaxResult(AjaxResult.AjaxStatus.OK, "The Section was updated");
         result.Data.Add("Section", RuleSection);
         return Json(result);
     }
     catch (Exception ex)
     {
         AjaxResult result = new AjaxResult(AjaxResult.AjaxStatus.ERROR, ex.Message);
         return Json(result);
     }
 }
コード例 #3
0
        /// <summary>
        /// Creates a new RuleSection record
        /// </summary>
        public static void Create(RuleSectionDO DO)
        {
            SqlParameter _Section = new SqlParameter("Section", SqlDbType.VarChar);
            SqlParameter _Description = new SqlParameter("Description", SqlDbType.VarChar);

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

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

            DataCommon.ExecuteNonQuery("[dbo].[RuleSection_Insert]", _params, "dbo");
        }
コード例 #4
0
        /// <summary>
        /// Gets all RuleSection records
        /// </summary>
        public static RuleSectionDO[] GetAll()
        {
            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[RuleSection_GetAll]", new SqlParameter[] { }, "dbo");

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

            while(sr.Read()){

                RuleSectionDO obj = new RuleSectionDO();

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

                objs.Add(obj);
            }

            return objs.ToArray();
        }
コード例 #5
0
        /// <summary>
        /// Selects RuleSection records by PK
        /// </summary>
        public static RuleSectionDO[] GetByPK(String Section)
        {
            SqlParameter _Section = new SqlParameter("Section", SqlDbType.VarChar);

            _Section.Value = Section;

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

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

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

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

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

                objs.Add(obj);
            }

            return objs.ToArray();
        }