Exemplo n.º 1
0
        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
            }));
        }
Exemplo n.º 2
0
 public void Add(MessageBoard model)
 {
     using (var db = new CRMDBContext())
     {
         db.MessageBoards.Add(model);
         db.SaveChanges();
     }
 }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
 public ExchangeRateRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 6
0
 public SalesUnitRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 7
0
 public AccountTypeRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 8
0
 public CampaignLogRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 9
0
 public ReminderRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 10
0
 public CampaignTrackerRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 11
0
 public PipelineRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 12
0
 public TargetRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 13
0
 public CallRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 14
0
    public NoteRepository(CRMDBContext dbContext) : base(dbContext)
    {

    }
Exemplo n.º 15
0
 public OpportunityProductRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 16
0
 public ProductPriceListDetailRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 17
0
 public IndustryRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 18
0
        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);
        }
Exemplo n.º 19
0
 public StageRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 20
0
 public OpportunityTypeRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 21
0
 public LostReasonRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 22
0
 public AppointmentRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 23
0
 public AddressBookRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 24
0
 public TaskTypeRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 25
0
 public CurrencyRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 26
0
 public LeadRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 27
0
 public OpportunityAuditRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 28
0
 public StageCheckedListRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 29
0
 public ContactAuditRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 30
0
 public AccountAuditRepository(CRMDBContext dbContext) : base(dbContext)
 {
 }