private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { string TimePhase = System.Configuration.ConfigurationSettings.AppSettings["TimePhase"].ToString(); if (DateTime.Now.ToString("HH:mm:ss") == TimePhase) { IConstructInterface construct = new ConstructService();; var result = construct.GetConstruct(); foreach (var model in result) { SmsMessage c = new SmsMessage(); var smsState = c.SendMessages(model.Phone, model.ConstName, model.Phase.Value, model.Role); //SmsMessage c = new SmsMessage(); //var smsState = "0";//c.SendMessages(model.Phone, model.ConstName, model.Phase.Value, model.Role); if (smsState == "0") { Mapper.Initialize(x => x.CreateMap <SMSEvalLogDTO, SMSEvalLog>()); SMSEvalLog sms = Mapper.Map <SMSEvalLogDTO, SMSEvalLog>(model); sms.CreateTime = DateTime.Now; construct.AddSMSLog(sms); } } } }
protected CommandTextEventInfo ConstructUpdateSql(TEntity entityToUpdate, IEnumerable <Expression <Func <TEntity, object> > > updateFields, WhereClauseResult whereClause) => ConstructService.ConstructUpdateSql <TKey, TEntity>(LogicFields, entityToUpdate, updateFields, whereClause);
protected CommandTextEventInfo ConstructUpdateSql(TEntity entityToUpdate, IEnumerable <Expression <Func <TEntity, object> > > updateFields, Expression <Func <TEntity, object> > id, TKey value) => ConstructService.ConstructUpdateSql(LogicFields, entityToUpdate, updateFields, id, value);
public Form1() { this.constructService = new ConstructService(); InitializeComponent(); }
protected CommandTextEventInfo ConstructSingleSql(IEnumerable <Expression <Func <TEntity, object> > > selectFields, Expression <Func <TEntity, object> > id, TKey value) => ConstructService.ConstructSingleSql(LogicFields, selectFields, id, value);
protected CommandTextEventInfo ConstructCountSql(Expression <Func <TEntity, object> > member, WhereClauseResult whereClause) => ConstructService.ConstructCountSql <TKey, TEntity>(member, whereClause);
protected CommandTextEventInfo ConstructExistsSql(WhereClauseResult whereClause) => ConstructService.ConstructExistsSql(typeof(TEntity), whereClause);
protected CommandTextEventInfo ConstructInsertSql(TEntity entityToInsert, IEnumerable <Expression <Func <TEntity, object> > > ignoredFields, bool autoIncrement) => ConstructService.ConstructInsertSql <TKey, TEntity>(LogicFields, entityToInsert, ignoredFields, autoIncrement);
protected CommandTextEventInfo ConstructTakeSql(int take, IEnumerable <Expression <Func <TEntity, object> > > selectFields, WhereClauseResult whereClause, OrderbyClauseResult orderbyClause) => ConstructService.ConstructTakeSql <TKey, TEntity>(LogicFields, take, selectFields, whereClause, orderbyClause);
protected OrderbyClauseResult CreateDefaultOrderbyClause() => ConstructService.ConstructOrderbyClause <TKey, TEntity>(DefaultOrderbyField, DefaultOrderbyType);
protected CommandTextEventInfo ConstructDeleteSql(Expression <Func <TEntity, object> > id, TKey value) => ConstructService.ConstructDeleteSql(id, value);