Example #1
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!");
     }
 }
Example #2
0
        public static void log_sms_into_db(int booking_id, string mobile_no, string url, int is_sent)
        {
            int sms_id=0;
            string str_error="";
            DB.clsDB db = new DB.clsDB();

            db.AddParameter("SMS_ID", sms_id);
            db.AddParameter("BOOKING_ID", booking_id);
            db.AddParameter("MOBILE_NO", mobile_no,20);
            db.AddParameter("URL", url,500);
            db.AddParameter("URL_DEPART", "",20);
            db.AddParameter("SEND_TIME", DateTime.Now);
            db.AddParameter("ERR_MSG", str_error, 20);
            db.AddParameter("IS_SENT", is_sent);
            db.ExecuteDML("spSMSLog_Insert", CommandType.StoredProcedure, 30);
        }
Example #3
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!");
     }
 }