Files
moadiran/Back/Services/servSendMsg.cs

42 lines
2.0 KiB
C#
Raw Normal View History

2024-04-17 15:49:34 +03:30
namespace Back.Services
{
public class servSendMsg
{
private readonly mpNuget.RestClient _restClient;
2024-09-23 13:03:53 +03:30
public servSendMsg(mpNuget.RestClient restClient) => _restClient = restClient;
2024-06-24 11:48:53 +03:30
//private void SendMsgByPatern(string Text, string To, int bodyID) {/*_restClient.SendByBaseNumber(Text, To, bodyID);*/ }
2024-09-23 13:03:53 +03:30
private void SendMsg(string Text, string To) => _restClient.Send(To, "50004001660045", Text, false);
private void SendByPattern(string[] bodys, int PatternCode, string To)
2024-06-24 11:48:53 +03:30
{
2024-09-23 13:03:53 +03:30
string text = "";
foreach (string body in bodys)
{
if (string.IsNullOrEmpty(text)) text += body.Trim();
else { text += ";" + body.Trim(); }
}
_restClient.SendByBaseNumber(text, To , PatternCode);
2024-06-24 11:48:53 +03:30
}
2024-09-23 13:03:53 +03:30
public void toContinue(string Code, string To, string title)
{
SendByPattern(new string[] { Code }, 251756, To);
// SendMsg($"برای ادامه {title} از کد {Code} استفاده کنید", To);
}
public void SuccessfulRegistration(string To, string Username, string Password)
{
SendByPattern(new string[] { Username,Password }, 251815, To);
//SendMsg("ثبت نام شما با موفقیت انجام شد" + '\n' +
// "اطلاعات کاربری:" + '\n' +
// $"نام کاربری : {Username}" +
// $"کلمه عبور : {Password}", to);
2024-10-14 15:56:45 +03:30
}
public void SuccessfulSubmitTicket(string To, string Code)
{
SendByPattern(new string[] { Code }, 258239, To);
2024-09-23 13:03:53 +03:30
}
//public void Authentication(string to,string code) => SendMsgByPatern(code, to, 0);
//
//public void SuccessfulPayment(string to, string code) => SendMsgByPatern(code, to, 2);
// public void firstEntry(string to, string code) => SendMsgByPatern(code, to, 3);
2024-06-24 11:48:53 +03:30
}
2024-04-17 15:49:34 +03:30
}