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

            model.ID             = Convert.ToInt32(rdr["ID"]);
            model.ProNum         = ConvertToInt(rdr["ProNum"]);
            model.Deailt         = ConverToStr(rdr["Deailt"]);
            model.ProImgs        = ConverToStr(rdr["ProImgs"]);
            model.CretType       = ConverToStr(rdr["CretType"]);
            model.ReProType      = ConvertToInt(rdr["ReProType"]);
            model.TakeProCounty  = ConverToStr(rdr["TakeProCounty"]);
            model.TakeProAddress = ConverToStr(rdr["TakeProAddress"]);
            model.ReProCounty    = ConverToStr(rdr["ReProCounty"]);
            model.ReProAddress   = ConverToStr(rdr["ReProAddress"]);
            model.UserName       = ConverToStr(rdr["UserName"]);
            model.Phone          = ConverToStr(rdr["Phone"]);
            model.ProID          = ConvertToInt(rdr["ProID"]);
            model.CDate          = ConvertToDate(rdr["CDate"]);
            model.TakeTime       = ConvertToDate(rdr["TakeTime"]);
            model.Status         = ConvertToInt(rdr["Status"]);
            model.UserID         = ConvertToInt(rdr["UserID"]);
            model.ServiceType    = ConverToStr(rdr["ServiceType"]);
            model.OrderNO        = ConverToStr(rdr["OrderNO"]);
            model.CartID         = ConvertToInt(rdr["CartID"]);
            model.ApplyType      = ConvertToInt(rdr["ApplyType"]);
            model.AdminRemind    = ConverToStr(rdr["AdminRemind"]);
            model.AdminDate      = ConverToStr(rdr["AdminDate"]);
            rdr.Close();
            return(model);
        }
Example #2
0
        public override SqlParameter[] GetParameters()
        {
            M_Order_Repair model = this;

            if (model.CDate <= DateTime.MinValue)
            {
                model.CDate = DateTime.Now;
            }
            if (model.TakeTime <= DateTime.MinValue)
            {
                model.TakeTime = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.ID;
            sp[1].Value  = model.ProNum;
            sp[2].Value  = model.Deailt;
            sp[3].Value  = model.ProImgs;
            sp[4].Value  = model.CretType;
            sp[5].Value  = model.ReProType;
            sp[6].Value  = model.TakeProCounty;
            sp[7].Value  = model.TakeProAddress;
            sp[8].Value  = model.ReProCounty;
            sp[9].Value  = model.ReProAddress;
            sp[10].Value = model.UserName;
            sp[11].Value = model.Phone;
            sp[12].Value = model.ProID;
            sp[13].Value = model.CDate;
            sp[14].Value = model.TakeTime;
            sp[15].Value = model.Status;
            sp[16].Value = model.UserID;
            sp[17].Value = model.ServiceType;
            sp[18].Value = model.OrderNO;
            sp[19].Value = model.CartID;
            sp[20].Value = model.ApplyType;
            sp[21].Value = model.AdminRemind;
            sp[22].Value = model.AdminDate;
            return(sp);
        }