Exemplo n.º 1
0
 public void SendDiscordWebHook(string webhook, string msg)
 {
     SENDER.Post(webhook, new NameValueCollection
     {
         {
             "content",
             msg
         }
     });
 }
Exemplo n.º 2
0
        private int GetDataForm()
        {
            int iret = 1;

            try
            {
                objTinNhanDi = new TIN_NHAN_DI();
                List <SENDER> lstSenders = new List <SENDER>();
                objTinNhanDi.LoaiTinNhan = "MU";
                if (rdoNhapTay.IsChecked.Value)
                {
                    SENDER objSender = new SENDER();
                    objSender.CONTENTS = txtContents.Text;
                    objSender.MOBILE   = txtMobile.Text;
                    string tgianGui =
                        radNgayGui.Value.GetValueOrDefault().ToString(ApplicationConstant.defaultDateTimeFormat);
                    tgianGui           += radThoiGianGui.Value.GetValueOrDefault().ToString("HHmmss");
                    objSender.SEND_TIME = tgianGui.StringToDate("yyyyMMddHHmmss");
                    objSender.DATA_DATE = DateTime.Now;
                    lstSenders.Add(objSender);
                }
                else
                {
                    foreach (DataRow dtw in grdTinNhanDenDS.SelectedItems)
                    {
                        SENDER objSender = new SENDER();
                        objSender.CONTENTS  = dtw["CONTENTS"].ToString();
                        objSender.MOBILE    = dtw["MOBILE"].ToString();
                        objSender.SEND_TIME = Convert.ToDateTime(dtw["TIMESEND"]);
                        objSender.DATA_DATE = DateTime.Now;
                        lstSenders.Add(objSender);
                    }
                }

                objTinNhanDi.LstSenders = lstSenders.ToArray();
            }
            catch (Exception ex)
            {
                iret = 0;
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }

            return(iret);
        }
Exemplo n.º 3
0
 public void setSender(SENDER _sender)
 {
     sender = _sender;
 }