Пример #1
0
    public List<CarsInfo.MobileUserRegData> GetUserRegistrationDetailsByID(string UID, string AuthenticationID, string CustomerID,string SessionID)
    {
        List<CarsInfo.MobileUserRegData> obj = new List<CarsInfo.MobileUserRegData>();

        MobileBL objReg = new MobileBL();
        try
        {
            if (CustomerID.Trim() != "")
            {
                DataSet dsSaveCustInfo = objReg.SaveMobileCustomerInfo("GetUserRegistrationDetailsByID", CustomerID,AuthenticationID,UID);
            }
            bool bnew = objReg.CheckMobileAuthorizeUSer(SessionID,Convert.ToInt32(UID));
            if (bnew)
            {
                if (AuthenticationID == ConfigurationManager.AppSettings["AppleID"].ToString())
                {
                    obj = (List<CarsInfo.MobileUserRegData>)objReg.GetUSerDetailsByUserID(Convert.ToInt32(UID));

                }
            }
            else
            {
                var obj1= new CarsInfo.MobileUserRegData();
                obj1.AASucess = "Session timed out";
                obj.Add(obj1);

            }
        }
        catch (Exception ex)
        {
        }
        return obj;
    }
Пример #2
0
 public IList<MobileUserRegData> GetUSerDetailsByUserID(int UID)
 {
     IList<MobileUserRegData> obj = new List<MobileUserRegData>();
     try
     {
         DataSet dsCars = new DataSet();
         string spNameString = string.Empty;
         Database dbDatabase = DatabaseFactory.CreateDatabase(Global.CarsConnTest);
         spNameString = "USP_GetUSerDetailsByUserID";
         DbCommand dbCommand = null;
         dbCommand = dbDatabase.GetStoredProcCommand(spNameString);
         dbDatabase.AddInParameter(dbCommand, "@UID", System.Data.DbType.Int32, UID);
         dsCars = dbDatabase.ExecuteDataSet(dbCommand);
         MobileUserRegData objRegInfo = new MobileUserRegData();
         if (dsCars.Tables.Count > 0)
         {
             if (dsCars.Tables[0].Rows.Count > 0)
             {
                 objRegInfo.UId = dsCars.Tables[0].Rows[0]["UId"].ToString() == "" ? 0 : Convert.ToInt32(dsCars.Tables[0].Rows[0]["UId"].ToString());
                 objRegInfo.UserID = dsCars.Tables[0].Rows[0]["UserID"].ToString() == "" ? "Emp" : dsCars.Tables[0].Rows[0]["UserID"].ToString();
                 objRegInfo.Name = dsCars.Tables[0].Rows[0]["Name"].ToString() == "" ? "Emp" : dsCars.Tables[0].Rows[0]["Name"].ToString();
                 objRegInfo.BusinessName = dsCars.Tables[0].Rows[0]["BusinessName"].ToString() == "" ? "Emp" : dsCars.Tables[0].Rows[0]["BusinessName"].ToString();
                 objRegInfo.UserName = dsCars.Tables[0].Rows[0]["UserName"].ToString() == "" ? "Emp" : dsCars.Tables[0].Rows[0]["UserName"].ToString();
                 objRegInfo.AltEmail = dsCars.Tables[0].Rows[0]["AltEmail"].ToString() == "" ? "Emp" : dsCars.Tables[0].Rows[0]["AltEmail"].ToString();
                 objRegInfo.PhoneNumber = dsCars.Tables[0].Rows[0]["PhoneNumber"].ToString() == "" ? "Emp" : dsCars.Tables[0].Rows[0]["PhoneNumber"].ToString();
                 objRegInfo.AltPhone = dsCars.Tables[0].Rows[0]["AltPhone"].ToString() == "" ? "Emp" : dsCars.Tables[0].Rows[0]["AltPhone"].ToString();
                 objRegInfo.Address = dsCars.Tables[0].Rows[0]["Address"].ToString() == "" ? "Emp" : dsCars.Tables[0].Rows[0]["Address"].ToString();
                 objRegInfo.City = dsCars.Tables[0].Rows[0]["City"].ToString() == "" ? "Emp" : dsCars.Tables[0].Rows[0]["City"].ToString();
                 objRegInfo.StateCode = dsCars.Tables[0].Rows[0]["State_Code"].ToString() == "" ? "Emp" : dsCars.Tables[0].Rows[0]["State_Code"].ToString();
                 objRegInfo.StateID = dsCars.Tables[0].Rows[0]["StateID"].ToString() == "" ? 0 : Convert.ToInt32(dsCars.Tables[0].Rows[0]["StateID"].ToString());
                 objRegInfo.Zip = dsCars.Tables[0].Rows[0]["Zip"].ToString() == "" ? "Emp" : dsCars.Tables[0].Rows[0]["Zip"].ToString();
                 string StrCarIDs = string.Empty;
                 if (dsCars.Tables[1].Rows.Count > 0)
                 {
                     for (int i = 0; i < dsCars.Tables[1].Rows.Count; i++)
                     {
                         if (StrCarIDs == "")
                         {
                             StrCarIDs = dsCars.Tables[1].Rows[i]["carid"].ToString();
                         }
                         else
                         {
                             StrCarIDs = StrCarIDs + "," + dsCars.Tables[1].Rows[i]["carid"].ToString();
                         }
                     }
                 }
                 objRegInfo.CarIDs = StrCarIDs == "" ? "Emp" : StrCarIDs;
                 obj.Add(objRegInfo);
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return obj;
 }