示例#1
0
        public M_IDC_DomPrice GetModelFromReader(DbDataReader rdr)
        {
            M_IDC_DomPrice model = new M_IDC_DomPrice();

            model.ID         = Convert.ToInt32(rdr["ID"]);
            model.DomName    = ConverToStr(rdr["DomName"]);
            model.DomPrice   = ConverToDec(rdr["DomPrice"]);
            model.DomType    = ConvertToInt(rdr["DomType"]);
            model.CreateDate = ConvertToDate(rdr["CreateDate"] == DBNull.Value ? DateTime.Now : rdr["CreateDate"]);
            model.Status     = ConvertToInt(rdr["Status"] == DBNull.Value?"0":"1");
            model.ProDetail  = ConverToStr(rdr["ProDetail"]);
            model.IFSupplier = ConvertToInt(rdr["IFSupplier"] == DBNull.Value ? "0" : "1");
            rdr.Close();
            return(model);
        }
示例#2
0
        public override SqlParameter[] GetParameters()
        {
            M_IDC_DomPrice model = this;

            if (model.CreateDate <= DateTime.MinValue)
            {
                model.CreateDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value = model.ID;
            sp[1].Value = model.DomName;
            sp[2].Value = model.DomPrice;
            sp[3].Value = model.DomType;
            sp[4].Value = model.CreateDate;
            sp[5].Value = model.Status;
            sp[6].Value = model.ProDetail;
            sp[7].Value = model.IFSupplier;
            return(sp);
        }