Example #1
0
        public M_IServer GetModelFromReader(DbDataReader rdr)
        {
            M_IServer model = new M_IServer();

            model.QuestionId  = Convert.ToInt32(rdr["QuestionId"]);
            model.UserId      = ConvertToInt(rdr["UserId"]);
            model.Title       = ConverToStr(rdr["Title"]);
            model.Content     = ConverToStr(rdr["Content"]);
            model.Priority    = ConverToStr(rdr["Priority"]);
            model.Type        = ConverToStr(rdr["Type"]);
            model.ReadCount   = ConvertToInt(rdr["ReadCount"]);
            model.SubTime     = ConvertToDate(rdr["SubTime"]);
            model.State       = ConverToStr(rdr["State"]);
            model.SolveTime   = ConvertToDate(rdr["SolveTime"]);
            model.Path        = ConverToStr(rdr["path"]);
            model.Root        = ConverToStr(rdr["Root"]);
            model.RootInfo    = ConverToStr(rdr["RootInfo"]);
            model.RequestTime = ConvertToDate(rdr["RequestTime"]);
            model.OrderType   = ConvertToInt(rdr["OrderType"]);
            model.Remind      = ConverToStr(rdr["Remind"]);
            model.CCUser      = ConverToStr(rdr["CCUser"]);
            model.UserName    = ConverToStr(rdr["UserName"]);
            rdr.Dispose();
            return(model);
        }
Example #2
0
        public override SqlParameter[] GetParameters()
        {
            M_IServer model = this;

            if (model.RequestTime <= DateTime.MinValue)
            {
                model.RequestTime = DateTime.Now.AddDays(1);
            }
            if (model.SubTime <= DateTime.MinValue)
            {
                model.SubTime = DateTime.Now;
            }
            if (model.SolveTime <= DateTime.MinValue)
            {
                model.SolveTime = DateTime.Now;
            }
            model.Type     = HttpUtility.HtmlEncode(model.Type);
            model.Title    = HttpUtility.HtmlEncode(model.Title);
            model.Root     = HttpUtility.HtmlEncode(model.Root);
            model.State    = HttpUtility.HtmlEncode(model.State);
            model.Priority = HttpUtility.HtmlEncode(model.Priority);
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.QuestionId;
            sp[1].Value  = model.UserId;
            sp[2].Value  = model.Title;
            sp[3].Value  = model.Content;
            sp[4].Value  = model.Priority;
            sp[5].Value  = model.Type;
            sp[6].Value  = model.ReadCount;
            sp[7].Value  = model.SubTime;
            sp[8].Value  = model.State;
            sp[9].Value  = model.SolveTime;
            sp[10].Value = model.Path;
            sp[11].Value = model.Root;
            sp[12].Value = model.RootInfo;
            sp[13].Value = model.RequestTime;
            sp[14].Value = model.OrderType;
            sp[15].Value = model.Remind;
            sp[16].Value = model.CCUser;
            sp[17].Value = model.UserName;
            return(sp);
        }