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

            model.ID            = ConvertToInt(rdr["ID"]);
            model.ClientID      = ConvertToInt(rdr["ClientID"]);
            model.Name          = ConverToStr(rdr["Name"]);
            model.Post          = ConverToStr(rdr["Post"]);
            model.Mobile1       = ConverToStr(rdr["Mobile1"]);
            model.Email         = ConverToStr(rdr["Email"]);
            model.Address       = ConverToStr(rdr["Address"]);
            model.Remind        = ConverToStr(rdr["Remind"]);
            model.DepName       = ConverToStr(rdr["DepName"]);
            model.CDate         = ConvertToDate(rdr["CDate"]);
            model.ZStatus       = ConvertToInt(rdr["ZStatus"]);
            model.ZType         = ConvertToInt(rdr["ZType"]);
            model.CUserID       = ConvertToInt(rdr["CUserID"]);
            model.CAdminID      = ConvertToInt(rdr["CAdminID"]);
            model.Mobile_Office = ConverToStr(rdr["Mobile_Office"]);
            model.Mobile_Home   = ConverToStr(rdr["Mobile_Home"]);
            model.Mobile2       = ConverToStr(rdr["Mobile2"]);
            model.QQ            = ConverToStr(rdr["QQ"]);
            model.Wechat        = ConverToStr(rdr["Wechat"]);
            model.SinaBlog      = ConverToStr(rdr["SinaBlog"]);
            model.Sex           = ConverToStr(rdr["Sex"]);
            return(model);
        }
Ejemplo n.º 2
0
        public override SqlParameter[] GetParameters()
        {
            M_CRMS_Contact model = this;

            if (model.CDate <= DateTime.MinValue)
            {
                model.CDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.ID;
            sp[1].Value  = model.ClientID;
            sp[2].Value  = model.Name;
            sp[3].Value  = model.Post;
            sp[4].Value  = model.Mobile1;
            sp[5].Value  = model.Email;
            sp[6].Value  = model.Address;
            sp[7].Value  = model.Remind;
            sp[8].Value  = model.DepName;
            sp[9].Value  = model.CDate;
            sp[10].Value = model.ZStatus;
            sp[11].Value = model.ZType;
            sp[12].Value = model.CUserID;
            sp[13].Value = model.CAdminID;
            sp[14].Value = model.Mobile_Office;
            sp[15].Value = model.Mobile_Home;
            sp[16].Value = model.Mobile2;
            sp[17].Value = model.QQ;
            sp[18].Value = model.Wechat;
            sp[19].Value = model.SinaBlog;
            sp[20].Value = model.Sex;
            return(sp);
        }