Example #1
0
 //
 // GET: /Api/Test/
 public ActionResult Index()
 {
     CBK_SHERC_USERINFO model = new CBK_SHERC_USERINFO();
     model.ADDRESS = "";
     model.BIRTHDAY = DateTime.Now.ToString();
     model.DELFLAG = 0;
     model.EMAIL = "*****@*****.**";
     model.ENAME = "sad3k";
     model.ID = 334455;
     model.IDCARD = "32058119801238123X";
     model.IMAGES = "";
     model.ISNEWS = 1;
     model.LOGINNUMS = 0;
     model.LOGINTIMES = 0;
     model.ModifyDatetime = DateTime.Now;
     model.NATIONALID = 56;
     model.NIANJIID = "1";
     model.OLDID = "0";
     model.POLITICSID = 1;
     model.POST = "112233";
     model.PWD = "123456";
     model.QUXIANID = 14;
     model.REALNAME = "王尼玛";
     model.SCHOOL_TYPEID = 2;
     model.SCHOOLAGES = 10;
     model.SCHOOLID = 233;
     model.SchoolTag = "";
     model.SEX = "男";
     model.STATUS = "正常";
     model.TEACHNUMBER = "9638003823";
     model.TELE = "23093@03453";
     model.TIMESOFGRADUATE = DateTime.Now;
     model.TrainingObjectID = 1;
     model.TrainingTypeID = "1";
     model.USERGroupsID = "1";
     model.USERJOBID = "1";
     model.USERLEVES = "1";
     model.Usersessionid = "";
     model.WorkTerm = "1";
     model.XUEDUANID = "1";
     model.XUEKEID = "1";
     model.XUELIID = 1;
     model.XUEWEIID = 1;
     model.XUQUID = 1;
     model.ZHICHENGID = "1";
     model.ZYDM = 1;
     return View();
 }
Example #2
0
        private MemberBaseInfo ToMemberBaseInfo(CBK_SHERC_USERINFO model)
        {
            APIBLL api = new APIBLL();
            MemberBaseInfo info = new MemberBaseInfo();
            info.TeacherNo = model.TEACHNUMBER;
            info.RealName = model.REALNAME;
            if (!string.IsNullOrEmpty(model.TELE))
            {
                if (model.TELE.Split('@').Length == 2)
                {
                    info.Mobile = model.TELE.Split('@')[1];
                    info.Phone = model.TELE.Split('@')[0];
                }
                else
                {
                    info.Mobile = "";
                    info.Phone = "";
                }
            }
            else
            {
                info.Mobile = "";
                info.Phone = "";
            }
            info.Address = string.IsNullOrEmpty(model.ADDRESS) ? "" : model.ADDRESS;
            info.PostCode = model.POST;
            info.CredentialsType = 57;
            info.CredentialsNumber = model.IDCARD;

            if (model.SEX == "男")
                info.Sex = 1;
            else
                info.Sex = 0;

            if (string.IsNullOrEmpty(model.BIRTHDAY))
                info.Birthday = new DateTime(1900, 1, 1);
            else
                info.Birthday = Convert.ToDateTime(model.BIRTHDAY);

            string nation = model.NATIONALID == null ? "" : model.NATIONALID.ToString();
            nation = api.ConvertKey("Nation", nation);
            if (!string.IsNullOrEmpty(nation))
                info.Nation = Convert.ToInt32(nation);
            else
                info.Nation = 0;

            string political = model.POLITICSID == null ? "" : model.POLITICSID.ToString();
            political = api.ConvertKey("Political", political);
            if (!string.IsNullOrEmpty(political))
                info.PoliticalStatus = Convert.ToInt32(political);
            else
                info.PoliticalStatus = 0;

            string region = model.QUXIANID == null ? "" : model.QUXIANID.ToString();//RegionId是区县Id
            region = api.ConvertKey("Organ", region);
            if (!string.IsNullOrEmpty(region))
                info.RegionId = Convert.ToInt32(region);
            else
                info.RegionId = 0;

            string organ = model.SCHOOLID == null ? "" : model.SCHOOLID.ToString();
            organ = api.ConvertKey("Organ", organ);
            if (!string.IsNullOrEmpty(organ))
                info.Organid = Convert.ToInt32(organ);
            else
                info.Organid = 0;

            info.StudySection = model.XUEDUANID;
            info.TraningObject = model.TrainingObjectID;
            info.EduLevel = model.XUELIID;
            info.EduDegree = model.XUEWEIID;
            info.EduMajor = model.ZYDM;
            info.GraduateSchool = model.SchoolTag;
            info.GraduateTime = model.TIMESOFGRADUATE;
            info.CreateDate = DateTime.Now;
            return info;
        }
Example #3
0
        private Member_Account ToMemberAccount(CBK_SHERC_USERINFO model)
        {
            APIBLL api = new APIBLL();
            Member_Account account = new Member_Account();
            account.UserName = model.ENAME;
            account.Password = model.PWD;
            account.Email = model.EMAIL;
            account.Status = 2;
            string organ = model.SCHOOLID == null ? "" : model.SCHOOLID.ToString();
            organ = api.ConvertKey("Organ", organ);
            if (!string.IsNullOrEmpty(organ))
                account.OrganId = Convert.ToInt32(organ);

            account.Pic = model.IMAGES;
            account.Nickname = model.REALNAME;
            account.IsRealName = !string.IsNullOrEmpty(model.REALNAME);
            account.OutSourceId = model.ID;
            account.CreateDate = DateTime.Now;
            return account;
        }