Ejemplo n.º 1
0
        public M_Pro_Project GetModelFromReader(DbDataReader rdr)
        {
            M_Pro_Project model = new M_Pro_Project();

            model.ID              = ConvertToInt(rdr["ID"]);
            model.ProName         = ConverToStr(rdr["ProName"]);
            model.ZType           = ConvertToInt(rdr["ZType"]);
            model.ProPrice        = ConverToDouble(rdr["ProPrice"]);
            model.ProManageer     = ConvertToInt(rdr["ProManageer"]);
            model.TecDirector     = ConverToStr(rdr["TecDirector"]);
            model.CustomerID      = ConvertToInt(rdr["CustomerID"]);
            model.CustomerCompany = ConverToStr(rdr["CustomerCompany"]);
            model.CustomerTele    = ConverToStr(rdr["CustomerTele"]);
            model.CustomerMobile  = ConverToStr(rdr["CustomerMobile"]);
            model.CustomerQQ      = ConverToStr(rdr["CustomerQQ"]);
            model.CustomerMSN     = ConverToStr(rdr["CustomerMSN"]);
            model.CustomerAddress = ConverToStr(rdr["CustomerAddress"]);
            model.CustomerEmail   = ConverToStr(rdr["CustomerEmail"]);
            model.Requirements    = ConverToStr(rdr["Requirements"]);
            model.ZStatus         = ConvertToInt(rdr["ZStatus"]);
            model.CDate           = ConvertToDate(rdr["CDate"]);
            model.Remind          = ConverToStr(rdr["Remind"]);
            rdr.Close();
            return(model);
        }
Ejemplo n.º 2
0
        public override SqlParameter[] GetParameters()
        {
            M_Pro_Project model = this;

            if (CDate <= DateTime.MinValue)
            {
                CDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.ID;
            sp[1].Value  = model.ProName;
            sp[2].Value  = model.ZType;
            sp[3].Value  = model.ProPrice;
            sp[4].Value  = model.ProManageer;
            sp[5].Value  = model.TecDirector;
            sp[6].Value  = model.CustomerID;
            sp[7].Value  = model.CustomerCompany;
            sp[8].Value  = model.CustomerTele;
            sp[9].Value  = model.CustomerMobile;
            sp[10].Value = model.CustomerQQ;
            sp[11].Value = model.CustomerMSN;
            sp[12].Value = model.CustomerAddress;
            sp[13].Value = model.CustomerEmail;
            sp[14].Value = model.Requirements;
            sp[15].Value = model.ZStatus;
            sp[16].Value = model.CDate;
            sp[17].Value = model.Remind;

            return(sp);
        }