Ejemplo n.º 1
0
        //public string DataTableToJSON(DataTable table)
        //{
        //    string JSONString = string.Empty;
        //    JSONString = JsonConvert.SerializeObject(table);
        //    return JSONString;
        //}
        public string GetCompanyDetails(string license_no)
        {
            SQLHelper dbo = new SQLHelper();
            DataSet   ds  = null;

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

                ds = dbo.RunProcedure("usp_Company_Details", parameters, "usp_Company_Details");

                if (ds != null && ds.Tables[0] != null)
                {
                    return(common.DatatableToJson(ds.Tables[0]));
                }

                return(null);
            }
            catch (Exception ex)
            {
                return(null);
            }
            finally
            {
                dbo = null;
            }
        }
Ejemplo n.º 2
0
        public static List <AutoModelMaster> AutoModelMaster_selectall()
        {
            SQLHelper dbo = new SQLHelper();
            DataSet   ds  = new DataSet();
            DataTable dt  = new DataTable();
            List <AutoModelMaster> modellist = new List <AutoModelMaster>();

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

                ds = dbo.RunProcedure("usp_AutoModelMaster", parameters, "AutoFeatures");
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0] != null)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        AutoModelMaster model = new AutoModelMaster();
                        model.Id = Convert.ToInt32(dr["Id"]);
                        model.AutoMakeMasterId     = Convert.ToInt32(dr["AutoMakeMasterId"]);
                        model.AutoModelName        = Convert.ToString(dr["AutoModelName"]);
                        model.AutoModelCode        = Convert.ToString(dr["AutoModelCode"]);
                        model.AutoModelDescription = Convert.ToString(dr["AutoModelDescription"]);
                        model.IsActive             = Convert.ToBoolean(dr["IsActive"]);
                        if (dr["CreatedDateTime"] != DBNull.Value)
                        {
                            model.CreatedDateTime = Convert.ToDateTime(dr["CreatedDateTime"]);
                        }

                        if (dr["UpdatedDateTime"] != DBNull.Value)
                        {
                            model.UpdatedDateTime = Convert.ToDateTime(dr["UpdatedDateTime"]);
                        }
                        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;
                }
            }
        }
Ejemplo n.º 3
0
        public static List <AutoAttachments> AutoAttachments_selectall()
        {
            SQLHelper dbo = new SQLHelper();
            DataSet   ds  = new DataSet();
            DataTable dt  = new DataTable();
            List <AutoAttachments> modellist = new List <AutoAttachments>();

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

                ds = dbo.RunProcedure("usp_AutoAttachments", parameters, "AutoAttachments");
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0] != null)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        AutoAttachments model = new AutoAttachments();
                        model.Id          = Convert.ToInt32(dr["Id"]);
                        model.AutoInfoId  = Convert.ToInt32(dr["AutoInfoId"]);
                        model.FileName    = Convert.ToString(dr["FileName"]);
                        model.FileType    = Convert.ToString(dr["FileType"]);
                        model.FileContent = Convert.ToString(dr["FileContent"]);
                        model.FileDesc    = Convert.ToString(dr["FileDesc"]);
                        model.FilePath    = Convert.ToString(dr["FilePath"]);
                        model.FolderPath  = Convert.ToString(dr["FolderPath"]);
                        model.FileContent = Convert.ToString(dr["FileContent"]);
                        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;
                }
            }
        }
Ejemplo n.º 4
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;
                }
            }
        }
Ejemplo n.º 5
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;
                }
            }
        }