예제 #1
0
        /// <summary>
        /// Bind IDataReader to Entity
        /// </summary>
        public static CateGoryTicketEntity ReaderBind(IDataReader dataReader)
        {
            CateGoryTicketEntity model = new CateGoryTicketEntity();
            object ojb;

            ojb = dataReader["CGTID"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CGTID = (int)ojb;
            }
            ojb = dataReader["GategoryID"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.GategoryID = (int)ojb;
            }
            ojb = dataReader["TicketID"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.TicketID = (int)ojb;
            }
            ojb = dataReader["CreatedOn"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CreatedOn = (DateTime)ojb;
            }
            return(model);
        }
예제 #2
0
        public int AssignTicketToCateGory(CateGoryTicketEntity model)
        {
            this.ClearBrokenRuleMessages();
            int id = cgtRepo.Insert(model);

            if (id <= 0)
            {
                this.AddBrokenRuleMessage();
                return(0);
            }
            model.ID = id;
            return(id);
        }