public override ICallHandler CreateHandler(IUnityContainer container) { ICallHandler callHandler = new SmsHandler() { Order = this.Order }; return(callHandler); }
static void Main(string[] args) { IBus bus = new AzureBus(); IMovieBookingService movieBookingService = new MovieBookingService(bus); ICommonWorkflowService commonWorkflowService = new CommonWorkflowService(bus); IStateMachineMapper stateMachineMapper = new StateMachineMapper(bus, commonWorkflowService); WorkflowInstanceRepository instanceRepository = new WorkflowInstanceRepository(); SmsHandler smsHandler = new SmsHandler(stateMachineMapper, bus, instanceRepository); ForkHandler forkHandler = new ForkHandler(instanceRepository, stateMachineMapper); DisambiguateMovieBookingHandler disambiguateHandler = new DisambiguateMovieBookingHandler(instanceRepository, stateMachineMapper); bus.Subscribe <SmsReceived>("workflow-service", smsHandler.Handle); bus.Subscribe <ForkFinished>("workflow-service", forkHandler.Handle); bus.Subscribe <StartDisambiguateMovieBooking>("workflow-service", disambiguateHandler.Handle); bus.Subscribe <DisambiguateMovieBookingFinished>("workflow-service", disambiguateHandler.Handle); Console.ReadKey(); }
static void Main(string[] args) { SmsHandler hand = new SmsHandler(inSmsProcessor); smsProcessor(hand); }
static void smsProcessor(SmsHandler hand) { hand(new Message(), MessageType.inComing); }
public Sms2pspService() { strCon = string.Format("application name=PSP_SMS_Interface;persist security info=true;packet size=4096;data source={0};initial catalog=PSP;user id={1};password={2};", ConfigurationManager.AppSettings["PspServer"], ConfigurationManager.AppSettings["DataUser"], DecryptPassword(ConfigurationManager.AppSettings["DataPassword"])); smsHandler = new SmsHandler(HandleSMS); rechargeHandler = new RechargeHandler(HandleRecharge); }
private void btnSendSMS_Click(object sender, EventArgs e) { string subject = (!string.IsNullOrEmpty(txtSubject.Text)) ? txtSubject.Text : "No subject"; SmsHandler smsobj = new SmsHandler(); SMSObjRepository smsobjRepo = new SMSObjRepository(); AdministratorRepository ARepo = new AdministratorRepository(); ObjLogin adm = (ObjLogin)Session["objLogin"]; string SMSCode = Guid.NewGuid().ToString().ToLower(); string listPhone = hdfPhoneNumbers.Value; if (string.IsNullOrEmpty(listPhone)) { ShowErrorMessage("Please provide recipient to send"); return; } char[] separator = new char[] { ',' }; string[] phoneList = listPhone.Split(separator); bool flag = false; string PhoneNotExist = string.Empty; foreach (string phone in phoneList) { if (SRepo.CheckSalemenByPhoneNumber(phone)) { smsobjRepo.InsertSMS(SMSCode, 0, adm.Phone, Constant.SalemenType, phone, Constant.SalemenType, DateTime.Now, subject, txtContent.Text, true, false, false, 1, int.Parse(ddlPromotion.SelectedValue)); flag = true; } else { if (CRepo.IsExistedCustomerByPhone(phone)) { smsobjRepo.InsertSMS(SMSCode, 0, adm.Phone, Constant.SalemenType, phone, Constant.CustomerType, DateTime.Now, subject, txtContent.Text, true, false, false, 1, int.Parse(ddlPromotion.SelectedValue)); flag = true; } else { if (ARepo.GetAdminByPhoneNumber(phone)) { smsobjRepo.InsertSMS(SMSCode, 0, adm.Phone, Constant.SalemenType, phone, Constant.AdminType, DateTime.Now, subject, txtContent.Text, true, false, false, 1, int.Parse(ddlPromotion.SelectedValue)); flag = true; } } } if (flag == false) { PhoneNotExist += phone + ", "; } } if (!string.IsNullOrEmpty(PhoneNotExist)) { ShowErrorMessage(PhoneNotExist.Substring(0, PhoneNotExist.Length - 2) + " not found in database."); } else { ShowErrorMessage("Send success"); } }