示例#1
0
        public M_Design_Question GetModelFromReader(DataRow rdr)
        {
            M_Design_Question model = new M_Design_Question();

            model.ID       = Convert.ToInt32(rdr["ID"]);
            model.AskID    = Convert.ToInt32(rdr["AskID"]);
            model.QTitle   = ConverToStr(rdr["QTitle"]);
            model.QContent = ConverToStr(rdr["QContent"]);
            model.QOption  = ConverToStr(rdr["QOption"]);
            model.QType    = ConverToStr(rdr["QType"]);
            model.QFlag    = ConverToStr(rdr["QFlag"]);
            model.Required = ConverToBool(rdr["Required"]);
            model.CDate    = ConvertToDate(rdr["CDate"]);
            model.OrderID  = ConvertToInt(rdr["OrderID"]);
            model.CUser    = ConvertToInt(rdr["CUser"]);
            return(model);
        }
示例#2
0
        public override SqlParameter[] GetParameters()
        {
            M_Design_Question model = this;

            if (model.CDate <= DateTime.MinValue)
            {
                model.CDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.ID;
            sp[1].Value  = model.AskID;
            sp[2].Value  = model.QTitle;
            sp[3].Value  = model.QContent;
            sp[4].Value  = model.QOption;
            sp[5].Value  = model.QType;
            sp[6].Value  = model.QFlag;
            sp[7].Value  = model.Required ? 1 : 0;
            sp[8].Value  = model.CDate;
            sp[9].Value  = model.OrderID;
            sp[10].Value = model.CUser;
            return(sp);
        }