コード例 #1
0
        //[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        public static string GetOffices()
        {
            SessionManager sessions = null;

            sessions = new SessionManager(); String daresult = null;

            CollectionRanking bn = new CollectionRanking();

            SqlCommand _command; SqlDataAdapter _adp; System.Data.DataSet responses = new System.Data.DataSet();

            using (SqlConnection connect = new SqlConnection(ConfigurationManager.ConnectionStrings["Registration2ConnectionString"].ConnectionString))
            {
                connect.Open();
                _command = new SqlCommand(String.Format("SELECT  LTRIM(RTRIM(RevenueOfficeName)) RevenueOfficeName,RevenueOfficeID FROM Setting.RevenueOffice WHERE MerchantCode='{0}' ORDER BY  LTRIM(RTRIM(RevenueOfficeName)) ASC ", sessions.MerchantCode.ToString()), connect)
                {
                    CommandType = CommandType.Text
                };
                _command.CommandTimeout = 0;
                responses.Clear();
                _adp = new SqlDataAdapter(_command);
                _adp.Fill(responses);

                connect.Close();
            }
            return(JsonConvert.SerializeObject(responses));
        }
コード例 #2
0
        public static string GetAgency()
        {
            SessionManager sessions = null;

            sessions = new SessionManager(); String daresult = null;

            CollectionRanking bn = new CollectionRanking();

            SqlCommand _command; SqlDataAdapter _adp; System.Data.DataSet responses = new System.Data.DataSet();

            using (SqlConnection connect = new SqlConnection(ConfigurationManager.ConnectionStrings["Registration2ConnectionString"].ConnectionString))
            {
                connect.Open();
                _command = new SqlCommand(String.Format("SELECT AgencyCode,AgencyName FROM ViewAgency ORDER BY AgencyName ASC "), connect)
                {
                    CommandType = CommandType.Text
                };
                _command.CommandTimeout = 0;
                responses.Clear();
                _adp = new SqlDataAdapter(_command);
                _adp.Fill(responses);

                connect.Close();
            }

            return(JsonConvert.SerializeObject(responses));
        }
コード例 #3
0
        public static string GetRevenueType()
        {
            SessionManager sessions = null;

            string strvalue = String.Empty;

            sessions = new SessionManager(); String daresult = null;

            CollectionRanking bn = new CollectionRanking();

            string value = ConfigurationManager.AppSettings["IsRevenueProvider"].ToString();

            string[] val = value.Split(',');

            int j = 0;

            foreach (var words in val)
            {
                strvalue += String.Format("'{0}'", words);

                if (j + 1 < val.Count())
                {
                    strvalue += ",";
                    ++j;
                }
            }



            SqlCommand _command; SqlDataAdapter _adp; System.Data.DataSet responses = new System.Data.DataSet();

            using (SqlConnection connect = new SqlConnection(ConfigurationManager.ConnectionStrings["Registration2ConnectionString"].ConnectionString))
            {
                connect.Open();
                _command = new SqlCommand(String.Format("SELECT RevenueCode,RevenueName FROM vwCollectionRevenue WHERE RevenueCode IN ({0}) ORDER BY RevenueName ASC", strvalue), connect)
                {
                    CommandType = CommandType.Text
                };
                _command.CommandTimeout = 0;
                responses.Clear();
                _adp = new SqlDataAdapter(_command);
                _adp.Fill(responses);

                connect.Close();
            }

            return(JsonConvert.SerializeObject(responses));
        }