Exemplo n.º 1
0
 private void AddBDParametrUserInfo(string[] ParametrUserInfo)
 {
     using (ContextUserInfo db = new ContextUserInfo())
     {
         int      User_id = Convert.ToInt32(ParametrUserInfo[0]);
         string[] tt      = UserBDCheked(User_id);
         if (tt[0] == "null" || tt[1] == null || tt[2] == null || tt[3] == null)
         {
             UserInfo UI = new UserInfo
             {
                 User_Id    = Convert.ToInt32(ParametrUserInfo[0]),
                 first_name = ParametrUserInfo[1],
                 last_name  = ParametrUserInfo[2],
                 sex        = Convert.ToInt32(ParametrUserInfo[3]),
                 bdate      = ParametrUserInfo[4],
                 city_Id    = Convert.ToInt32(ParametrUserInfo[5]),
                 country_Id = Convert.ToInt32(ParametrUserInfo[6]),
                 photo_200  = ParametrUserInfo[7]
             };
             db.UserInfos.Add(UI);
             db.SaveChanges();
         }
         else
         {
         }
     }
 }
Exemplo n.º 2
0
 private void AddBdUserId(string[] ProfileInformation)
 {
     if (UserAndGroupAddBd(Convert.ToInt32(ProfileInformation[0]), Convert.ToInt32(ProfileInformation[5])))
     {
         using (ContextUserInfo db = new ContextUserInfo())
         {
             string[] tt = UserBDCheked(Convert.ToInt32(ProfileInformation[0]));
             if (tt[0] == "null")
             {
                 UserInfo UI = new UserInfo
                 {
                     User_Id    = Convert.ToInt32(ProfileInformation[0]),
                     first_name = ProfileInformation[1],
                     last_name  = ProfileInformation[2],
                     sex        = Convert.ToInt32(ProfileInformation[3]),
                 };
                 db.UserInfos.Add(UI);
                 db.SaveChanges();
             }
         }
     }
 }