Example #1
0
    private void FillStates()
    {
        DropdownBL objdropdownBL = new DropdownBL();

        DataSet dsDropDown = new DataSet();

        try
        {
            if (Session["DsDropDown"] == null)
            {
                dsDropDown = objdropdownBL.Usp_Get_DropDown();
                Session["DsDropDown"] = dsDropDown;
            }
            else
            {
                dsDropDown = (DataSet)Session["DsDropDown"];
            }

            grdAssign.DataSource = dsDropDown.Tables[1];
            grdAssign.DataBind();

        }
        catch (Exception ex)
        {
        }
    }
    private string GetStateName(string StateID)
    {
        string sState = string.Empty;
        try
        {
            DropdownBL objdropdownBL = new DropdownBL();
            DataSet dsDropDown = new DataSet();

            if (System.Web.HttpContext.Current.Session["DsDropDown"] == null)
            {
                dsDropDown = objdropdownBL.Usp_Get_DropDown();
                System.Web.HttpContext.Current.Session["DsDropDown"] = dsDropDown;
            }
            else
            {
                dsDropDown = (DataSet)System.Web.HttpContext.Current.Session["DsDropDown"];
            }
            DataTable dt = new DataTable();
            DataView dv = new DataView();
            dv = dsDropDown.Tables[1].DefaultView;
            dv.RowFilter = "State_ID='" + StateID + "'";

            dt = dv.ToTable();

            if (dt.Rows.Count > 0)
            {
                sState = dt.Rows[0]["State_Code"].ToString();
            }

            //ddlLocationState.Items.Insert(0, new ListItem("Unspecified", "0"));
        }
        catch (Exception ex)
        {
        }
        return sState;
    }
Example #3
0
    public string UpdateCarDetails(string UID, string Year, string ExteriorColor, string InteriorColor, string Transmission, string DriveTrain, string NumberOfDoors, string MakeModelID,
                                    string BodyTypeID, string CarID, string Price, string Mileage, string VIN, string NumberOfCylinder, string FueltypeID, string zip,
                                    string City, string Description, string VehicleCondition, string Title, string StateID, string AuthenticationID, string CustomerID, string SessionID)
    {
        string returnCarID = "Failed";
        DropdownBL objdropdownBL = new DropdownBL();
        CarsInfo.CarsInfo objcarsInfo = new CarsInfo.CarsInfo();

        MobileBL objMobileBL = new MobileBL();
        if (CustomerID.Trim() != "")
        {
            DataSet dsSaveCustInfo = objMobileBL.SaveMobileCustomerInfo("UpdateCarDetails", CustomerID, AuthenticationID,CarID);
        }
        bool bnew = objMobileBL.CheckMobileAuthorizeUSer(SessionID, Convert.ToInt32(UID));
        if (bnew)
        {
            try
            {
                if (AuthenticationID == ConfigurationManager.AppSettings["AppleID"].ToString())
                {
                    int Uid = Convert.ToInt32(UID);
                    objcarsInfo.YearOfMake = Convert.ToInt32(Year);
                    objcarsInfo.MakeModelID = Convert.ToInt32(MakeModelID);
                    objcarsInfo.BodyTypeID = Convert.ToInt32(BodyTypeID);
                    objcarsInfo.CarID = Convert.ToInt32(CarID);
                    //Check for same make,model year of car
                    DataSet dsCarID = objMobileBL.CheckMobileCarDetailsByCarID(Convert.ToInt32(CarID), objcarsInfo.MakeModelID, objcarsInfo.YearOfMake);
                    if (dsCarID.Tables.Count > 0)
                    {
                        if (dsCarID.Tables[0].Rows.Count > 0)
                        {
                            if (Price == "")
                            {
                                objcarsInfo.Price = "0";
                            }
                            else
                            {
                                objcarsInfo.Price = Price;
                            }
                            if (Mileage == "")
                            {
                                objcarsInfo.Mileage = "0";
                            }
                            else
                            {
                                objcarsInfo.Mileage = Mileage;
                            }
                            objcarsInfo.ExteriorColor = ExteriorColor;
                            objcarsInfo.InteriorColor = InteriorColor;
                            objcarsInfo.Transmission = Transmission;
                            objcarsInfo.DriveTrain = DriveTrain;
                            objcarsInfo.NumberOfDoors = NumberOfDoors;
                            objcarsInfo.VIN = VIN;
                            objcarsInfo.NumberOfCylinder = NumberOfCylinder;
                            objcarsInfo.FuelTypeID = Convert.ToInt32(FueltypeID);
                            if (zip.Length == 4)
                            {
                                objcarsInfo.Zipcode = "0" + zip;
                            }
                            else
                            {
                                objcarsInfo.Zipcode = zip;
                            }
                            objcarsInfo.City = GeneralFunc.ToProper(City);
                            objcarsInfo.StateID = Convert.ToInt32(StateID);
                            string Condition = GeneralFunc.ToProper(Description);
                            DataSet dsCarsDetails = objdropdownBL.USP_SaveCarDetails(objcarsInfo, Condition, VehicleCondition, Title, Uid);
                            if (dsCarsDetails.Tables.Count > 0)
                            {
                                if (dsCarsDetails.Tables[0].Rows.Count > 0)
                                {
                                    returnCarID = "Success";
                                }
                                else
                                 {
                                    returnCarID = "Failed";
                                }
                            }
                            else
                            {
                                returnCarID = "Failed";
                            }
                        }
                        else
                        {
                            returnCarID = "Sorry we are not able to change year,make and model of your car";
                        }
                    }
                    else
                    {
                        returnCarID = "Sorry we are not able to change year,make and model of your car";
                    }
                }

            }

            catch (Exception ex)
            {
            }
        }
        else
        {
            returnCarID = "Session timed out";
        }
        return returnCarID;
    }