Пример #1
0
        public M_Blog_Sdl GetModelFromReader(DbDataReader rdr)
        {
            M_Blog_Sdl model = new M_Blog_Sdl();

            model.ID        = Convert.ToInt32(rdr["ID"]);
            model.Name      = ConverToStr(rdr["Name"]);
            model.StartDate = ConvertToDate(rdr["StartDate"]);
            model.EndDate   = ConvertToDate(rdr["EndDate"]);
            model.AllDay    = ConvertToInt(rdr["AllDay"]);
            model.Repeat    = ConvertToInt(rdr["Repeat"]);
            model.Place     = ConverToStr(rdr["Place"]);
            model.Describe  = ConverToStr(rdr["Describe"]);
            model.TaskType  = ConvertToInt(rdr["TaskType"]);
            model.LeaderIDS = ConverToStr(rdr["LeaderIDS"]);
            model.ParterIDS = ConverToStr(rdr["ParterIDS"]);
            model.UserID    = ConvertToInt(rdr["UserID"]);
            return(model);
        }
Пример #2
0
        public override SqlParameter[] GetParameters()
        {
            M_Blog_Sdl model = this;

            if (model.StartDate <= DateTime.MinValue)
            {
                model.StartDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.ID;
            sp[1].Value  = model.Name;
            sp[2].Value  = model.StartDate;
            sp[3].Value  = model.EndDate;
            sp[4].Value  = model.AllDay;
            sp[5].Value  = model.Repeat;
            sp[6].Value  = model.Place;
            sp[7].Value  = model.Describe;
            sp[8].Value  = model.TaskType;
            sp[9].Value  = model.LeaderIDS;
            sp[10].Value = model.ParterIDS;
            sp[11].Value = model.UserID;
            return(sp);
        }