Пример #1
0
        public static string get_sms_template(string template_name)
        {
            string sms_template = null;

            DB.clsDB db = new DB.clsDB();
            db.AddParameter("TEMPLATE_NAME", template_name, 30);
            DataSet ds = db.ExecuteSelect("GET_GDS_SMS_TEMPLATE", System.Data.CommandType.StoredProcedure, 30);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                sms_template = ds.Tables[0].Rows[0]["TEMPLATE"].ToString();
            }
            if (sms_template != null && sms_template.Trim().Length > 0)
            {
                return(sms_template);
            }
            else
            {
                throw new System.Exception("Template Not Found!");
            }
        }
Пример #2
0
        public SMS_Data(int booking_id, string method)
        {
            DB.clsDB db = new DB.clsDB();
            content = new Dictionary <string, string>();
            db.AddParameter("BOOKING_ID", booking_id);
            DataSet ds = db.ExecuteSelect(method, System.Data.CommandType.StoredProcedure, 30);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                details_list = ds.Tables[0].AsEnumerable().Select(dr => ds.Tables[0].Columns.Cast <DataColumn>().ToDictionary(dc => dc.ColumnName, dc => dr[dc])).ToList();
                foreach (Dictionary <string, object> elements in details_list)
                {
                    foreach (KeyValuePair <string, object> entry in elements)
                    {
                        content[entry.Key] = entry.Value.ToString();
                    }
                }
            }
            else
            {
                throw new System.Exception("Booking ID Not Found!");
            }
        }