Exemplo n.º 1
0
        public List <StoreTypeMaster> GetStoreNameWithsStoreCode(int TenantID)
        {
            DataSet ds = new DataSet();
            List <StoreTypeMaster> storeMaster = new List <StoreTypeMaster>();

            try
            {
                conn = Db.Connection;

                MySqlCommand cmd = new MySqlCommand("SP_GetStoreCodewithStoreName", conn);
                cmd.Connection = conn;
                cmd.Parameters.AddWithValue("@Tenant_ID", TenantID);
                cmd.CommandType = CommandType.StoredProcedure;
                MySqlDataAdapter da = new MySqlDataAdapter();
                da.SelectCommand = cmd;
                da.Fill(ds);
                if (ds != null && ds.Tables[0] != null)
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        StoreTypeMaster storeType = new StoreTypeMaster();
                        storeType.StoreTypeID   = Convert.ToInt32(ds.Tables[0].Rows[i]["StoreID"]);
                        storeType.StoreTypeName = Convert.ToString(ds.Tables[0].Rows[i]["StoreNameWithCode"]);
                        storeMaster.Add(storeType);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(storeMaster);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get StoreType List
        /// </summary>
        /// <returns></returns>
        public List <StoreTypeMaster> GetStoreTypeList()
        {
            DataSet                ds              = new DataSet();
            MySqlCommand           cmd             = new MySqlCommand();
            List <StoreTypeMaster> storeTypeMaster = new List <StoreTypeMaster>();

            try
            {
                conn.Open();
                cmd.Connection = conn;
                MySqlCommand cmd1 = new MySqlCommand("SP_GetStoreTypeList", conn);
                cmd1.CommandType = CommandType.StoredProcedure;
                MySqlDataAdapter da = new MySqlDataAdapter();
                da.SelectCommand = cmd1;
                da.Fill(ds);
                if (ds != null && ds.Tables[0] != null)
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        StoreTypeMaster storeType = new StoreTypeMaster();
                        storeType.StoreTypeID   = Convert.ToInt32(ds.Tables[0].Rows[i]["StoreTypeID"]);
                        storeType.StoreTypeName = Convert.ToString(ds.Tables[0].Rows[i]["StoreTypeName"]);
                        storeTypeMaster.Add(storeType);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                if (conn != null)
                {
                    conn.Close();
                }
            }
            return(storeTypeMaster);
        }