Example #1
0
 public DataTable SearchProductDetail(PropertyModels obj_BLL)
 {
     oDataTable = new DataTable();
     try
     {
         oBuilder     = new SqlConnectionStringBuilder(_connectionString);
         oConnection  = new SqlConnection(oBuilder.ConnectionString);
         oDataAdapter = new SqlDataAdapter("Jobs_SearchProductDetail", oConnection);
         oDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
         oDataAdapter.SelectCommand.Parameters.AddWithValue("@FT_FromAmt", obj_BLL.FT_FromAmt);
         oDataAdapter.SelectCommand.Parameters.AddWithValue("@FT_ToAmt", obj_BLL.FT_ToAmt);
         oDataAdapter.SelectCommand.Parameters.AddWithValue("@FT_NAME", obj_BLL.FT_NAME);
         oDataAdapter.SelectCommand.Parameters.AddWithValue("@FT_PROD_CODE", obj_BLL.FT_PROD_CODE);
         oDataAdapter.SelectCommand.Parameters.AddWithValue("@FT_CAT_ID", obj_BLL.FT_CAT_ID);
         oDataAdapter.SelectCommand.Parameters.AddWithValue("@FT_SUBCAT_ID", obj_BLL.FT_SUBCAT_ID);
         using (oConnection)
         {
             oConnection.Open();
             oDataAdapter.Fill(oDataTable);
         }
     }
     catch (Exception ex)
     {
         ApplicationError.LogErrors(ex);
     }
     return(oDataTable);
 }
Example #2
0
        public List <ProductModels> FetchProductList(string sSectionName, string id)
        {
            List <ProductModels> _ProductModels = new List <ProductModels>();

            oBuilder    = new SqlConnectionStringBuilder(_connectionString);
            oConnection = new SqlConnection(oBuilder.ConnectionString);
            oDataTable  = new DataTable();

            using (SqlCommand cmd = new SqlCommand())
            {
                try
                {
                    oBuilder     = new SqlConnectionStringBuilder(_connectionString);
                    oConnection  = new SqlConnection(oBuilder.ConnectionString);
                    oDataAdapter = new SqlDataAdapter("Jobs_MasterSelectDataByStr", oConnection);
                    oDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                    oDataAdapter.SelectCommand.Parameters.AddWithValue("@SectionName", sSectionName);
                    oDataAdapter.SelectCommand.Parameters.AddWithValue("@SectionId", id);
                    using (oConnection)
                    {
                        oConnection.Open();
                        oDataAdapter.Fill(oDataTable);
                    }
                    foreach (DataRow row in oDataTable.Rows)
                    {
                        ProductModels PM = new ProductModels();
                        PM.P_NAME        = row["P_NAME"].ToString();
                        PM.URL_NAME      = row["P_NAME"].ToString();
                        PM.P_IMAGE_THUMB = row["P_IMAGE_THUMB"].ToString();
                        PM.P_PRICE       = Convert.ToDecimal(row["P_PRICE"]);
                        _ProductModels.Add(PM);
                    }
                }
                catch (Exception ex)
                {
                    ApplicationError.LogErrors(ex);
                    oConnection.Close();
                }
                return(_ProductModels);
            }
        }
Example #3
0
        public List <MetaModels> FetchMetaData(string sSectionName, int id)
        {
            List <MetaModels> _MetaModels = new List <MetaModels>();

            oBuilder    = new SqlConnectionStringBuilder(_connectionString);
            oConnection = new SqlConnection(oBuilder.ConnectionString);
            oDataTable  = new DataTable();

            using (SqlCommand cmd = new SqlCommand())
            {
                try
                {
                    oBuilder     = new SqlConnectionStringBuilder(_connectionString);
                    oConnection  = new SqlConnection(oBuilder.ConnectionString);
                    oDataAdapter = new SqlDataAdapter("Jobs_MasterSelectDataById", oConnection);
                    oDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                    oDataAdapter.SelectCommand.Parameters.AddWithValue("@SectionName", sSectionName);
                    oDataAdapter.SelectCommand.Parameters.AddWithValue("@SectionId", id);
                    using (oConnection)
                    {
                        oConnection.Open();
                        oDataAdapter.Fill(oDataTable);
                    }
                    foreach (DataRow row in oDataTable.Rows)
                    {
                        MetaModels mm = new MetaModels();
                        mm.Title     = row["FT_NAME"].ToString();
                        mm.Keywords  = row["FT_NAME"].ToString();
                        mm.Descption = row["FT_NAME"].ToString();
                        _MetaModels.Add(mm);
                    }
                }
                catch (Exception ex)
                {
                    ApplicationError.LogErrors(ex);
                    oConnection.Close();
                }
                return(_MetaModels);
            }
        }
Example #4
0
 public DataTable MasterSelectData(string sSectionName)
 {
     oDataTable = new DataTable();
     try
     {
         oBuilder     = new SqlConnectionStringBuilder(_connectionString);
         oConnection  = new SqlConnection(oBuilder.ConnectionString);
         oDataAdapter = new SqlDataAdapter("Jobs_MasterSelectData", oConnection);
         oDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
         oDataAdapter.SelectCommand.Parameters.AddWithValue("@SectionName", sSectionName);
         using (oConnection)
         {
             oConnection.Open();
             oDataAdapter.Fill(oDataTable);
         }
     }
     catch (Exception ex)
     {
         ApplicationError.LogErrors(ex);
     }
     return(oDataTable);
 }
Example #5
0
 public DataTable GetTimeFrameData(int id, string SelectDT)
 {
     oDataTable = new DataTable();
     try
     {
         oBuilder     = new SqlConnectionStringBuilder(_connectionString);
         oConnection  = new SqlConnection(oBuilder.ConnectionString);
         oDataAdapter = new SqlDataAdapter("Jobs_GetTimeFrameData", oConnection);
         oDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
         oDataAdapter.SelectCommand.Parameters.AddWithValue("@SectionId", id);
         oDataAdapter.SelectCommand.Parameters.AddWithValue("@SelectDT", SelectDT);
         using (oConnection)
         {
             oConnection.Open();
             oDataAdapter.Fill(oDataTable);
         }
     }
     catch (Exception ex)
     {
         ApplicationError.LogErrors(ex);
     }
     return(oDataTable);
 }
Example #6
0
        public object SelectSingleData(string SectionName, string ValueData)
        {
            //int iVaule = 0;
            object obj = new object();

            try
            {
                oBuilder             = new SqlConnectionStringBuilder(_connectionString);
                oConnection          = new SqlConnection(oBuilder.ConnectionString);
                oCommand             = new SqlCommand("Jobs_SelectSingleData", oConnection);
                oCommand.CommandType = CommandType.StoredProcedure;
                oCommand.Parameters.AddWithValue("@SectionName", SectionName);
                oCommand.Parameters.AddWithValue("@ValueData", ValueData);
                using (oConnection)
                {
                    oConnection.Open();
                    obj = oCommand.ExecuteScalar();
                    //if (obj != null)
                    //{
                    //    iVaule = (int)obj;
                    //}
                    oConnection.Close();
                }
            }
            catch (Exception ex)
            {
                ApplicationError.LogErrors(ex);
            }
            finally
            {
                if (oConnection.State == ConnectionState.Open)
                {
                    oConnection.Close();
                }
            }
            return(obj);
        }