public ActionResult Index() { //each scheduler must have unique name var scheduler = new DHXScheduler("sched1"); var scheduler2 = new DHXScheduler("sched2"); scheduler.DataAction = Url.Action("Data", "OffDays"); scheduler.SaveAction = Url.Action("Save", "OffDays"); scheduler2.DataAction = Url.Action("Data1", "OffDays"); scheduler2.SaveAction = Url.Action("Save1", "OffDays"); scheduler.LoadData = true; scheduler.EnableDataprocessor = true; scheduler2.LoadData = true; scheduler2.EnableDataprocessor = true; var context = new CRMDBContext(); var multiselect = new LightboxSelect("employee", "Employee"); multiselect.AddOptions(context.Employees.Select(t => new { key = t.ID, label = t.Name })); scheduler.Lightbox.Add(new LightboxText("text", "Title")); scheduler.Lightbox.Add(multiselect); scheduler.Lightbox.Add(new LightboxMiniCalendar("time", "Time")); scheduler2.Lightbox.Add(new LightboxText("text", "Title")); scheduler2.Lightbox.Add(multiselect); scheduler2.Lightbox.Add(new LightboxMiniCalendar("time", "Time")); return(View(new Mod { Sh1 = scheduler, Sh2 = scheduler2 })); }
public void Add(MessageBoard model) { using (var db = new CRMDBContext()) { db.MessageBoards.Add(model); db.SaveChanges(); } }
public ActionResult Index() { //Being initialized in that way, scheduler will use CalendarController.Data as a the datasource and CalendarController.Save to process changes var scheduler = new DHXScheduler(); scheduler.DataAction = Url.Action("Data"); scheduler.SaveAction = Url.Action("Save"); /* * It's possible to use different actions of the current controller * var scheduler = new DHXScheduler(this); * scheduler.DataAction = "ActionName1"; * scheduler.SaveAction = "ActionName2"; * * Or to specify full paths * var scheduler = new DHXScheduler(); * scheduler.DataAction = Url.Action("Data", "Calendar"); * scheduler.SaveAction = Url.Action("Save", "Calendar"); */ /* * The default codebase folder is ~/Scripts/dhtmlxScheduler. It can be overriden: * scheduler.Codebase = Url.Content("~/customCodebaseFolder"); */ //scheduler.InitialDate = new DateTime(2012, 09, 03); scheduler.LoadData = true; scheduler.EnableDataprocessor = true; var context = new CRMDBContext(); scheduler.Lightbox.Add(new LightboxText("text", "Title")); var multiselect = new LightboxSelect("staff", "Staff"); multiselect.AddOptions(context.Employees.Select(t => new { key = t.ID, label = t.Name })); scheduler.Lightbox.Add(multiselect); var selectcategory = new LightboxSelect("category", "Category"); var items = new List <object>() { new { key = "employee", label = "Employee" }, new { key = "manager", label = "Management" }, new { key = "visitor", label = "Visitor" } }; selectcategory.AddOptions(items); scheduler.Lightbox.Add(selectcategory); scheduler.Lightbox.Add(new LightboxMiniCalendar("time", "Time")); return(View(scheduler)); }
public ContentResult Save(int?id, FormCollection actionValues, string text) { var action = new DataAction(actionValues); try { var changedEvent = (Shift)DHXEventsHelper.Bind(typeof(Shift), actionValues); var data = new CRMDBContext(); switch (action.Type) { case DataActionTypes.Insert: data.Shift.Add(changedEvent); action.TargetId = changedEvent.ID; //assign postoperational id changedEvent.Description = text; break; case DataActionTypes.Delete: changedEvent = data.Shift.SingleOrDefault(ev => ev.ID == action.SourceId); data.Shift.Remove(changedEvent); break; default: // "update" var eventToUpdate = data.Shift.SingleOrDefault(ev => ev.ID == action.SourceId); changedEvent.Description = text; DHXEventsHelper.Update(eventToUpdate, changedEvent, new List <string>() { "id" }); break; } data.SaveChanges(); action.TargetId = changedEvent.ID; } catch //(Exception e) { action.Type = DataActionTypes.Error; // Log the exception. //ExceptionUtility.LogException(e, action.Type.ToString()); } return((ContentResult) new AjaxSaveResponse(action)); }
public ExchangeRateRepository(CRMDBContext dbContext) : base(dbContext) { }
public SalesUnitRepository(CRMDBContext dbContext) : base(dbContext) { }
public AccountTypeRepository(CRMDBContext dbContext) : base(dbContext) { }
public CampaignLogRepository(CRMDBContext dbContext) : base(dbContext) { }
public ReminderRepository(CRMDBContext dbContext) : base(dbContext) { }
public CampaignTrackerRepository(CRMDBContext dbContext) : base(dbContext) { }
public PipelineRepository(CRMDBContext dbContext) : base(dbContext) { }
public TargetRepository(CRMDBContext dbContext) : base(dbContext) { }
public CallRepository(CRMDBContext dbContext) : base(dbContext) { }
public NoteRepository(CRMDBContext dbContext) : base(dbContext) { }
public OpportunityProductRepository(CRMDBContext dbContext) : base(dbContext) { }
public ProductPriceListDetailRepository(CRMDBContext dbContext) : base(dbContext) { }
public IndustryRepository(CRMDBContext dbContext) : base(dbContext) { }
public bool SendSmsResponse(string phone, string verCode) { String product = "Dysmsapi"; //短信API产品名称(短信产品名固定,无需修改) String domain = "dysmsapi.aliyuncs.com"; //短信API产品域名(接口地址固定,无需修改) String accessKeyId = ""; //你的accessKeyId,参考本文档步骤2 String accessKeySecret = ""; //你的accessKeySecret,参考本文档步骤2 IClientProfile profile = DefaultProfile.GetProfile("cn-hangzhou", accessKeyId, accessKeySecret); //IAcsClient client = new DefaultAcsClient(profile); // SingleSendSmsRequest request = new SingleSendSmsRequest(); //初始化ascClient,暂时不支持多region(请勿修改) DefaultProfile.AddEndpoint("cn-hangzhou", "cn-hangzhou", product, domain); IAcsClient acsClient = new DefaultAcsClient(profile); SendSmsRequest request = new SendSmsRequest(); SendSmsResponse sendSmsResponse = new SendSmsResponse(); try { //必填:待发送手机号。支持以逗号分隔的形式进行批量调用,批量上限为1000个手机号码,批量调用相对于单条调用及时性稍有延迟,验证码类型的短信推荐使用单条调用的方式,发送国际/港澳台消息时,接收号码格式为00+国际区号+号码,如“0085200000000” request.PhoneNumbers = phone; //必填:短信签名-可在短信控制台中找到 request.SignName = "广东烧腊"; //必填:短信模板-可在短信控制台中找到,发送国际/港澳台消息时,请使用国际/港澳台短信模版 request.TemplateCode = "SMS_00000001"; //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为 request.TemplateParam = string.Format("\"code\":\"{0}\"}", verCode); //可选:outId为提供给业务方扩展字段,最终在短信回执消息中将此值带回给调用者 request.OutId = "yourOutId"; //请求失败这里会抛ClientException异常 sendSmsResponse = acsClient.GetAcsResponse(request); } catch (ServerException ex) { Log.Error("短信发送调用阿里云Api出现未处理异常", ex.ToString()); } catch (ClientException ex) { Log.Error("短信发送调用阿里云Api出现未处理异常", ex.ToString()); } finally { var sendSmsLog = new SendSmsLog(); sendSmsLog.Phone = phone; sendSmsLog.VerCode = verCode; sendSmsLog.IsSuccess = false; if (sendSmsResponse != null) { sendSmsLog.RequestId = sendSmsResponse.RequestId; sendSmsLog.BizId = sendSmsResponse.BizId; sendSmsLog.Code = sendSmsResponse.Code; sendSmsLog.Message = sendSmsResponse.Message; sendSmsLog.IsSuccess = sendSmsResponse.Code == "OK"; } sendSmsLog.Createtime = DateTime.Now; using (var db = new CRMDBContext()) { db.SendSmsLogs.Add(sendSmsLog); db.SaveChanges(); } } return(false); }
public StageRepository(CRMDBContext dbContext) : base(dbContext) { }
public OpportunityTypeRepository(CRMDBContext dbContext) : base(dbContext) { }
public LostReasonRepository(CRMDBContext dbContext) : base(dbContext) { }
public AppointmentRepository(CRMDBContext dbContext) : base(dbContext) { }
public AddressBookRepository(CRMDBContext dbContext) : base(dbContext) { }
public TaskTypeRepository(CRMDBContext dbContext) : base(dbContext) { }
public CurrencyRepository(CRMDBContext dbContext) : base(dbContext) { }
public LeadRepository(CRMDBContext dbContext) : base(dbContext) { }
public OpportunityAuditRepository(CRMDBContext dbContext) : base(dbContext) { }
public StageCheckedListRepository(CRMDBContext dbContext) : base(dbContext) { }
public ContactAuditRepository(CRMDBContext dbContext) : base(dbContext) { }
public AccountAuditRepository(CRMDBContext dbContext) : base(dbContext) { }