Beispiel #1
0
        public static List <AutoInfoMaster> AutoInfoMaster_selectall()
        {
            SQLHelper             dbo       = new SQLHelper();
            DataSet               ds        = new DataSet();
            List <AutoInfoMaster> modellist = new List <AutoInfoMaster>();

            try
            {
                SqlParameter[] parameters = new SqlParameter[] {
                    new SqlParameter("action", "selectall"),
                };

                ds = dbo.RunProcedure("usp_AutoInfoMaster", parameters, "AutoFeatures");
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0] != null)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        AutoInfoMaster model = new AutoInfoMaster();
                        model.Id              = Convert.ToInt32(dr["Id"]);
                        model.AutoDealerId    = Convert.ToInt32(dr["AutoDealerId"]);
                        model.AutoDealerName  = Convert.ToString(dr["AutoDealerName"]);
                        model.AutoName        = Convert.ToString(dr["AutoName"]);
                        model.AutoDescription = Convert.ToString(dr["AutoDescription"]);
                        model.AutoLocation    = Convert.ToString(dr["AutoLocation"]);
                        model.AutoMake        = Convert.ToString(dr["AutoMake"]);
                        model.AutoModel       = Convert.ToString(dr["AutoModel"]);
                        model.Price           = Convert.ToString(dr["Price"]);
                        model.Year            = Convert.ToInt32(dr["Year"]);
                        model.Kilometers      = Convert.ToInt32(dr["Kilometers"]);
                        model.AutoType        = Convert.ToString(dr["AutoType"]);
                        model.Color           = Convert.ToString(dr["Color"]);
                        model.InteriorColor   = Convert.ToString(dr["InteriorColor"]);
                        model.GearBox         = Convert.ToString(dr["GearBox"]);
                        model.Seats           = Convert.ToInt32(dr["Seats"]);
                        model.Specs           = Convert.ToString(dr["Specs"]);
                        model.Doors           = Convert.ToInt32(dr["Doors"]);
                        model.Cylinders       = Convert.ToInt32(dr["Cylinders"]);
                        model.Wheels          = Convert.ToInt32(dr["Wheels"]);
                        model.FuelType        = Convert.ToString(dr["FuelType"]);
                        model.IsActive        = Convert.ToBoolean(dr["IsActive"]);
                        if (dr["CreatedDateTime"] != DBNull.Value)
                        {
                            model.CreatedDateTime = Convert.ToDateTime(dr["CreatedDateTime"]);
                        }
                        model.CreatedBy = Convert.ToString(dr["CreatedBy"]);
                        if (dr["UpdatedDateTime"] != DBNull.Value)
                        {
                            model.UpdatedDateTime = Convert.ToDateTime(dr["UpdatedDateTime"]);
                        }
                        model.UpdatedBy      = Convert.ToString(dr["UpdatedBy"]);
                        model.FirstImage     = Convert.ToString(dr["FirstImage"]);
                        model.DealerImage    = Convert.ToString(dr["DealerImage"]);
                        model.AutoFeatures   = Convert.ToString(dr["AutoFeatures"]);
                        model.AutoLatitude   = Convert.ToString(dr["AutoLatitude"]);
                        model.AutoLongitude  = Convert.ToString(dr["AutoLongitude"]);
                        model.AutoMakeId     = Convert.ToInt32(dr["AutoMakeId"]);
                        model.Comments       = Convert.ToString(dr["Comments"]);
                        model.AutoModelId    = Convert.ToInt32(dr["AutoModelId"]);
                        model.AutoFolderPath = Convert.ToString(dr["AutoFolderPath"]);
                        model.Condition      = Convert.ToString(dr["Condition"]);
                        model.AutoTypeId     = Convert.ToInt32(dr["AutoTypeId"]);
                        modellist.Add(model);
                    }
                }
                return(modellist);
            }
            catch (Exception ex)
            {
                throw new ArgumentException("Error Occured in " + System.Reflection.MethodBase.GetCurrentMethod().Name.ToString() + " Error Message: " + ex.Message);
            }
            finally
            {
                if (ds != null)
                {
                    ds.Dispose();
                }

                if (modellist != null)
                {
                    modellist = null;
                }
            }
        }
Beispiel #2
0
        public static List <DealersInfoMaster> DealersInfoMaster_selectall()
        {
            SQLHelper dbo = new SQLHelper();
            DataSet   ds  = new DataSet();
            DataTable dt  = new DataTable();
            List <DealersInfoMaster> modellist = new List <DealersInfoMaster>();

            try
            {
                SqlParameter[] parameters = new SqlParameter[] {
                    new SqlParameter("action", "selectall"),
                };

                ds = dbo.RunProcedure("usp_DealersInfoMaster", parameters, "AutoFeatures");
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0] != null)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        DealersInfoMaster model = new DealersInfoMaster();
                        model.Id            = Convert.ToInt32(dr["Id"]);
                        model.FirstName     = Convert.ToString(dr["FirstName"]);
                        model.LastName      = Convert.ToString(dr["LastName"]);
                        model.CompanyName   = Convert.ToString(dr["CompanyName"]);
                        model.ContactPerson = Convert.ToString(dr["ContactPerson"]);
                        model.Email         = Convert.ToString(dr["Email"]);
                        model.Telephone     = Convert.ToString(dr["Telephone"]);
                        model.TradeLicense  = Convert.ToString(dr["TradeLicense"]);
                        model.Password      = Convert.ToString(dr["Password"]);
                        model.DealerImage   = Convert.ToString(dr["DealerImage"]);
                        model.Comments      = Convert.ToString(dr["Comments"]);
                        model.IsActive      = Convert.ToBoolean(dr["IsActive"]);
                        if (dr["CreatedDateTime"] != DBNull.Value)
                        {
                            model.CreatedDateTime = Convert.ToDateTime(dr["CreatedDateTime"]);
                        }
                        model.CreatedBy = Convert.ToString(dr["CreatedBy"]);
                        if (dr["UpdatedDateTime"] != DBNull.Value)
                        {
                            model.UpdatedDateTime = Convert.ToDateTime(dr["UpdatedDateTime"]);
                        }
                        model.UpdatedBy = Convert.ToString(dr["UpdatedBy"]);
                        if (dr["IsConfirm"] != DBNull.Value)
                        {
                            model.IsConfirm = Convert.ToBoolean(dr["IsConfirm"]);
                        }
                        modellist.Add(model);
                    }
                }
                return(modellist);
            }
            catch (Exception ex)
            {
                throw new ArgumentException("Error Occured in " + System.Reflection.MethodBase.GetCurrentMethod().Name.ToString() + " Error Message: " + ex.Message);
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                    dt = null;
                }

                if (modellist != null)
                {
                    modellist = null;
                }
            }
        }
Beispiel #3
0
        public static List <AutoFeatures> AutoFeatures_selectall()
        {
            SQLHelper           dbo       = new SQLHelper();
            DataSet             ds        = new DataSet();
            DataTable           dt        = new DataTable();
            List <AutoFeatures> modellist = new List <AutoFeatures>();

            try
            {
                SqlParameter[] parameters = new SqlParameter[] {
                    new SqlParameter("action", "selectall"),
                };

                ds = dbo.RunProcedure("usp_AutoFeatures", parameters, "AutoFeatures");
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0] != null)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        AutoFeatures model = new AutoFeatures();
                        model.Id                  = Convert.ToInt64(dr["Id"]);
                        model.AutoMakeId          = Convert.ToInt32(dr["AutoMakeId"]);
                        model.AutoModelId         = Convert.ToInt32(dr["AutoModelId"]);
                        model.InteriorDesign      = Convert.ToString(dr["InteriorDesign"]);
                        model.SpecialFeatures     = Convert.ToString(dr["SpecialFeatures"]);
                        model.ExteriorFeatures    = Convert.ToString(dr["ExteriorFeatures"]);
                        model.SecurityEnvironment = Convert.ToString(dr["SecurityEnvironment"]);
                        model.IsActive            = Convert.ToBoolean(dr["IsActive"]);
                        if (dr["CreatedDateTime"] != DBNull.Value)
                        {
                            model.CreatedDateTime = Convert.ToDateTime(dr["CreatedDateTime"]);
                        }
                        model.CreatedBy = Convert.ToString(dr["CreatedBy"]);
                        if (dr["UpdatedDateTime"] != DBNull.Value)
                        {
                            model.UpdatedDateTime = Convert.ToDateTime(dr["UpdatedDateTime"]);
                        }
                        model.UpdatedBy        = Convert.ToString(dr["UpdatedBy"]);
                        model.ModelDescription = Convert.ToString(dr["ModelDescription"]);
                        modellist.Add(model);
                    }
                }
                return(modellist);
            }
            catch (Exception ex)
            {
                throw new ArgumentException("Error Occured in " + System.Reflection.MethodBase.GetCurrentMethod().Name.ToString() + " Error Message: " + ex.Message);
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                    dt = null;
                }

                if (modellist != null)
                {
                    modellist = null;
                }
            }
        }