public KeyboardService (IContextService contextService)
		{
			_contextService = contextService;

			_inputMethodManager = 
				((Context)_contextService.GetContext ()).GetSystemService (Context.InputMethodService) as InputMethodManager;
		}
示例#2
0
 public SubsController(IContextService contextService,
     ISubDao subDao,
     IMapper mapper,
     ICommandBus commandBus,
     IUserContext userContext,
     IPostDao postDao,
     IVoteDao voteDao,
     ICommentDao commentDao,
     IPermissionDao permissionDao,
     ICommentNodeHierarchyBuilder commentNodeHierarchyBuilder,
     ICommentTreeContextBuilder commentTreeContextBuilder,
     IPostWrapper postWrapper,
     ISubWrapper subWrapper,
     ICommentWrapper commentWrapper)
 {
     _contextService = contextService;
     _subDao = subDao;
     _mapper = mapper;
     _commandBus = commandBus;
     _userContext = userContext;
     _postDao = postDao;
     _voteDao = voteDao;
     _commentDao = commentDao;
     _permissionDao = permissionDao;
     _commentNodeHierarchyBuilder = commentNodeHierarchyBuilder;
     _commentTreeContextBuilder = commentTreeContextBuilder;
     _postWrapper = postWrapper;
     _subWrapper = subWrapper;
     _commentWrapper = commentWrapper;
 }
示例#3
0
 public CountdownController(ICountdownRepository countdownRepository,
                            IVoteService voteService,
                            IContextService contextService) {
     _countdownRepository = countdownRepository;
     _voteService = voteService;
     _contextService = contextService;
 }
示例#4
0
 public CommentController(ICommentRepository commentRepository,
                          IVoteService voteService,
                          IContextService contextService) {
     _commentRepository = commentRepository;
     _voteService = voteService;
     _contextService = contextService;
 }
		public LanguageService (IContextService contextService)
		{
			var context = (Context) contextService.GetContext();

			_resource = context.Resources;

			_packageName = context.PackageName;
		}
 public ConfigurationController(IContextService context
     , IApplicationService appService
     , IConfigurationService configService)
 {
     this._context = context;
     this._appService = appService;
     this._configService = configService;
 }
    private IList<ILitRequest> GetLiterature()
    {
        ActivitySearchOptions aso;
        ActivitySearchOptions temp;
        _Context = ApplicationContext.Current.Services.Get<IContextService>(true);
        _TimeZone = (TimeZone) _Context.GetContext("TimeZone");
        temp = (ActivitySearchOptions)_Context.GetContext("ActivitySearchCriteria");
        aso = new ActivitySearchOptions();
        if (temp == null)
        {
            aso.UserIds.Add(_UserId);
        }
        else
        {
            aso.UserIds.AddRange(temp.UserIds);
        }
        aso.StartDate = null;
        aso.EndDate = null;
        using (new SessionScopeWrapper())
        {
            IRepository<ILitRequest> eventRep = EntityFactory.GetRepository<ILitRequest>();
            IQueryable qry = (IQueryable)eventRep;
            IExpressionFactory ef = qry.GetExpressionFactory();
            ICriteria crit = qry.CreateCriteria();
            IExpression userExp = ef.Eq("RequestUser", User.GetById(aso.UserIds[0]));
            IExpression dateRangeExp = null;
            if (_SortDir.Equals("Ascending"))
            {
                crit.AddOrder(ef.Asc(_SortColumn));
            }
            else
            {
                crit.AddOrder(ef.Desc(_SortColumn));
            }

            if (aso.StartDate.HasValue)
            {
                dateRangeExp = ef.And(ef.Ge("RequestDate", aso.StartDate.Value), ef.Lt("RequestDate", aso.EndDate.Value));
            }

            IList<ILitRequest> events;
            if (dateRangeExp != null)
            {
                events = crit.Add(
                    ef.And(userExp, dateRangeExp)).List<ILitRequest>();
            }
            else
            {
                events = crit.Add(userExp).List<ILitRequest>();
            }
            return events;
        }
    }
示例#8
0
 public SubsController(IContextService contextService,
     ISubDao subDao,
     IMapper mapper,
     ICommandBus commandBus,
     IUserContext userContext)
 {
     _contextService = contextService;
     _subDao = subDao;
     _mapper = mapper;
     _commandBus = commandBus;
     _userContext = userContext;
 }
 public Log4NetLoggingService(IConfigurationRepository configurationRepository, IContextService contextService)
 {
     if (configurationRepository == null) throw new ArgumentNullException("ConfigurationRepository");
     if (contextService == null) throw new ArgumentNullException("ContextService");
     _configurationRepository = configurationRepository;
     _contextService = contextService;
     _log4netConfigFileName = _configurationRepository.GetConfigurationValue<string>("Log4NetSettingsFile");
     if (string.IsNullOrEmpty(_log4netConfigFileName))
     {
         throw new ApplicationException("Log4net settings file missing from the configuration source.");
     }
     SetupLogger();
 }
示例#10
0
文件: Helper.cs 项目: sunleepy/cooper
 public static bool IsLogin(IContextService context
     , System.Security.Principal.IPrincipal user
     , ILog log)
 {
     if (context == null || context.Current == null)
     {
         if (log != null && log.IsDebugEnabled)
             log.DebugFormat("[Deny]IContextService={0}|Current={1}|IsAuthenticated={2}|Name={3}"
                 , context
                 , context != null ? context.Current : null
                 , user.Identity.IsAuthenticated
                 , user.Identity.Name);
         return false;
     }
     return true;
 }
 public RewardRecognitionService(IRewardRecognitionContext context,
                                 IRewardUserService rewardUserService,
                                 IEmailService emailService,
                                 IContextService contextService,
                                 ILoggingService loggingService,
                                 IConfigurationRepository configurationRepository, 
                                 IContextCacheService cacheContext)
 {
     _context = context;
     _rewardUserService = rewardUserService;
     _emailService = emailService;
     _contextService = contextService;
     _loggingService = loggingService;
     _configurationRepository = configurationRepository;
     _cacheContext = cacheContext;
 }
 protected override void OnPreRender(EventArgs e)
 {
     if (displayQueue)
     {
         _Context = ApplicationContext.Current.Services.Get<IContextService>();
         List<string> ids = (List<string>)_Context.GetContext("CompleteActivityIds");
         if ((ids == null) || (ids.Count == 0))
         {
             ids = (List<string>)_Context.GetContext("RescheduleActivityIds");
         }
         ActivitySearchOptions aso = new ActivitySearchOptions();
         aso.ActivityIds.AddRange(ids);
         aso.UserIds.Add(_UserId);
         IList<Activity> results = Activity.GetActivitiesFor(aso);
         ActivityGrid.DataSource = ResultsToDataSet(results);
         ActivityGrid.DataBind();
         base.OnPreRender(e);
     }
 }
示例#13
0
 public CommonController(IContextService contextService,
     ISubDao subDao,
     IUserContext userContext,
     IMessageDao messageDao,
     ISubWrapper subWrapper,
     IMembershipService membershipService,
     ISubActivityDao subActivityDao,
     ISettingsProvider<SubSettings> subSettings,
     ISubModerationDao subModerationDao)
 {
     _contextService = contextService;
     _subDao = subDao;
     _userContext = userContext;
     _messageDao = messageDao;
     _subWrapper = subWrapper;
     _membershipService = membershipService;
     _subActivityDao = subActivityDao;
     _subSettings = subSettings;
     _subModerationDao = subModerationDao;
 }
示例#14
0
 public UsersController(IMembershipService membershipService,
     ISubDao subDao,
     IModerationDao moderationDao,
     IKarmaDao karmaDao,
     ICommentDao commentDao,
     ICommentWrapper commentWrapper,
     IPostDao postDao,
     IPostWrapper postWrapper,
     IUserContext userContext,
     IContextService contextService)
 {
     _membershipService = membershipService;
     _subDao = subDao;
     _moderationDao = moderationDao;
     _karmaDao = karmaDao;
     _commentDao = commentDao;
     _commentWrapper = commentWrapper;
     _postDao = postDao;
     _postWrapper = postWrapper;
     _userContext = userContext;
     _contextService = contextService;
 }
示例#15
0
 public SubsController(IContextService contextService,
     ISubDao subDao,
     IMapper mapper,
     ICommandBus commandBus,
     IUserContext userContext,
     IPostDao postDao,
     IVoteDao voteDao,
     ICommentDao commentDao,
     IPermissionDao permissionDao,
     ICommentNodeHierarchyBuilder commentNodeHierarchyBuilder,
     ICommentTreeContextBuilder commentTreeContextBuilder,
     IPostWrapper postWrapper,
     ISubWrapper subWrapper,
     ICommentWrapper commentWrapper,
     IMembershipService membershipService,
     ISettingsProvider<SubSettings> subSettings,
     ISubActivityDao subActivityDao,
     IModerationDao moderationDao)
 {
     _contextService = contextService;
     _subDao = subDao;
     _mapper = mapper;
     _commandBus = commandBus;
     _userContext = userContext;
     _postDao = postDao;
     _voteDao = voteDao;
     _commentDao = commentDao;
     _permissionDao = permissionDao;
     _commentNodeHierarchyBuilder = commentNodeHierarchyBuilder;
     _commentTreeContextBuilder = commentTreeContextBuilder;
     _postWrapper = postWrapper;
     _subWrapper = subWrapper;
     _commentWrapper = commentWrapper;
     _membershipService = membershipService;
     _subSettings = subSettings;
     _subActivityDao = subActivityDao;
     _moderationDao = moderationDao;
 }
示例#16
0
 public PostsController(ISubDao subDao,
     ISubWrapper subWrapper,
     IPostDao postDao,
     IPostWrapper postWrapper,
     IUserContext userContext,
     ICommandBus commandBus,
     IContextService contextService,
     ICommentTreeContextBuilder commentTreeContextBuilder,
     ICommentDao commentDao,
     ISubActivityDao subActivityDao,
     ICommentNodeHierarchyBuilder commentNodeHierarchyBuilder)
 {
     _subDao = subDao;
     _subWrapper = subWrapper;
     _postDao = postDao;
     _postWrapper = postWrapper;
     _userContext = userContext;
     _commandBus = commandBus;
     _contextService = contextService;
     _commentTreeContextBuilder = commentTreeContextBuilder;
     _commentDao = commentDao;
     _subActivityDao = subActivityDao;
     _commentNodeHierarchyBuilder = commentNodeHierarchyBuilder;
 }
 /// <summary>
 /// Handles the Init event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void Page_Init(object sender, EventArgs e)
 {
     _Context = ApplicationContext.Current.Services.Get<IContextService>();
     _State = _Context.GetContext("AddProductStateInfo") as AddProductStateInfo;
     if (_State == null) { _State = new AddProductStateInfo(); }
     _UserOptions = ApplicationContext.Current.Services.Get<IUserOptionsService>();
 }
 public GraficasController(IContextService context) : base(context)
 {
 }
 public ApiBaseController(IContextService context)
 {
     ContextService = context;
     appService     = new ApplicationHelper(context);
 }
示例#20
0
 protected BaseAdminController(IContextService contextService)
     : base(contextService)
 {
 }
示例#21
0
 public ReplyController(ICommandService commandService, IContextService contextService, IReplyQueryService queryService)
 {
     _commandService = commandService;
     _contextService = contextService;
     _queryService = queryService;
 }
 public GuiasBalancesLineasConvertService(IContextService context, MarfilEntities db) : base(context, db)
 {
 }
示例#23
0
 public CuentastesoreriaModel(IContextService context) : base(context)
 {
     _direcciones    = _fModel.GetModel <DireccionesModel>(context);
     _contactos      = _fModel.GetModel <ContactosModel>(context);
     _bancosMandatos = _fModel.GetModel <BancosMandatosModel>(context);
 }
示例#24
0
 public ListadosProductosPedidosCompras(IContextService context) : base(ListadoTipoDocumento.PedidosCompras, context)
 {
 }
 public TraspasosalmacenConverterService(IContextService context, MarfilEntities db) : base(context, db)
 {
 }
示例#26
0
 public SearchController(IContextService contextService)
 {
     _contextService = contextService;
 }
 public CampañasController(IContextService context) : base(context)
 {
 }
 public ImputacionCostesValidation(IContextService context, MarfilEntities db) : base(context, db)
 {
 }
 public ComercialesService(IContextService context, MarfilEntities db = null) : base(context, db)
 {
 }
 public ImputacionCostesConverterService(IContextService context, MarfilEntities db) : base(context, db)
 {
 }
示例#31
0
 public ProspectosService(IContextService context, MarfilEntities db = null) : base(context, db)
 {
 }
示例#32
0
 protected BaseProvider(IConfiguration conf, IContextService env)
 {
     UoW = new UnitOfWork(conf["Databases:IdentityEntities_EFCore_Tbl"], env);
 }
示例#33
0
 public AlbaranesComprasValidation(IContextService context, MarfilEntities db) : base(context, db)
 {
 }
示例#34
0
 public CuentasService(IContextService context, MarfilEntities db = null) : base(context, db)
 {
 }
示例#35
0
 public TablasVariasCabecerasStartup(IContextService context, MarfilEntities db)
 {
     _context             = context;
     _tablasVariasService = new TablasVariasService(context, db);
 }
示例#36
0
        public void Importar(DataTable dt, int idPeticion, IContextService context)
        {
            string       errores = "";
            string       tipoIso = dt.Columns[5].ColumnName.ToString();;
            CuentasModel cuenta  = new FModel().GetModel <CuentasModel>(context);

            foreach (DataRow row in dt.Rows)
            {
                // Existe la cuenta?
                var id           = row["Cuenta"].ToString();
                var existecuenta = _db.Cuentas.Where(f => f.empresa == cuenta.Empresa && f.id == id).SingleOrDefault();

                if (existecuenta == null)
                {
                    cuenta.Id           = id;
                    cuenta.UsuarioId    = "00000000-0000-0000-0000-000000000000";
                    cuenta.Descripcion  = row["Descripcion"].ToString();
                    cuenta.Descripcion2 = row["Razonsocial"].ToString();

                    // 1    nivel = 1
                    // 10   nivel = 2
                    // 101  nivel = 3
                    // 1010 nivel = 4
                    cuenta.Nivel = id.Length;

                    if (cuenta.Nivel > 4)
                    {
                        // 40000001 nivel = 0
                        cuenta.Nivel = 0;

                        // Nif
                        if (string.IsNullOrEmpty(row["Nif"].ToString()))
                        {
                            cuenta.Nif.Nif      = null;
                            cuenta.Tiposcuentas = null;
                        }
                        else
                        {
                            cuenta.Nif.Nif = row["Nif"].ToString();
                            // Nifs mal introducidos?
                            if (cuenta.Nif.Nif.Length > 15)
                            {
                                cuenta.Nif.Nif = row["Nif"].ToString().Substring(0, 14);
                            }
                            var digitoscuenta = cuenta.Id.Substring(0, 4);
                            // Revisar FirsOrDefault
                            // Exite un tipo de cuenta asociado?
                            var existeTipoCuenta = _db.Tiposcuentas.Where(f => f.empresa == cuenta.Empresa && f.cuenta == digitoscuenta).FirstOrDefault();
                            if (existeTipoCuenta != null)
                            {
                                var tipo = _db.Tiposcuentas.Where(f => f.empresa == cuenta.Empresa && f.cuenta == digitoscuenta).Select(f => f.tipos).FirstOrDefault();
                                cuenta.Tiposcuentas = tipo;
                            }
                            else
                            {
                                // Cuenta de tipo no contable pero sin un tipo de cuenta asociado
                                cuenta.Tiposcuentas = null;
                            }

                            var obligatorio = _db.Tiposcuentas.Where(f => f.empresa == cuenta.Empresa && f.cuenta == digitoscuenta).Select(f => f.nifobligatorio).FirstOrDefault();

                            if (obligatorio != null)
                            {
                                cuenta.Nif.Obligatorio = true;
                                //cuenta.Nif.Obligatorio = (bool)obligatorio;
                                // TipoNif es una tabla varia, Valor NIF/CIF = 001
                                if (string.IsNullOrEmpty(row["TipoNif"].ToString()))
                                {
                                    cuenta.Nif.TipoNif = "001";
                                }
                                else
                                {
                                    cuenta.Nif.TipoNif = row["TipoNif"].ToString().PadLeft(3, '0');
                                }
                            }
                            else
                            {
                                cuenta.Nif.Obligatorio = false;
                            }
                        }
                    }


                    // País
                    string query = "SELECT Valor FROM Paises WHERE " + tipoIso + " = '" + row[5].ToString() + "'";

                    try
                    {
                        using (var con = new SqlConnection(_db.Database.Connection.ConnectionString))
                        {
                            con.Open();
                            using (SqlCommand command = new SqlCommand(query, con))
                            {
                                cuenta.FkPais = command.ExecuteScalar()?.ToString();
                            }
                            con.Close();
                        }
                    }
                    finally
                    {
                    }

                    try
                    {
                        create(cuenta);
                    }
                    catch (Exception ex)
                    {
                        errores += row[0] + ";" + row[1] + ";" + row[2] + ";" + row[3] + ";" + row[4] + ";" + row[5] + ";" + ex.Message + Environment.NewLine;
                    }
                }
            }

            var item = _db.PeticionesAsincronas.Where(f => f.empresa == context.Empresa && f.id == idPeticion).SingleOrDefault();

            item.estado    = (int)EstadoPeticion.Finalizada;
            item.resultado = errores;

            _db.PeticionesAsincronas.AddOrUpdate(item);
            _db.SaveChanges();

            //throw new ValidationException(errores);
        }
示例#37
0
		void InitXamarinInsight (IContextService contextService, IMobileConfigurationManager configService)
		{
			Insights.Initialize(configService.MobileConfigurationFile.XamarinInsightKey, ((Context)contextService.GetContext()));

			Insights.HasPendingCrashReport += async(sender, isStartupCrash) =>
			{
				if (isStartupCrash)
				{
					await Insights.PurgePendingCrashReports();
				}
			};
		}
 public GruposIvaValidation(IContextService context, MarfilEntities db) : base(context, db)
 {
 }
示例#39
0
 public FacturasComprasValidation(IContextService context, MarfilEntities db) : base(context, db)
 {
 }
示例#40
0
 public PostController(ICommandService commandService, IPostQueryService queryService, IContextService contextService)
 {
     _commandService = commandService;
     _queryService = queryService;
     _contextService = contextService;
 }
 public VariedadesApiController(IContextService context) : base(context)
 {
 }
示例#42
0
		public AssetReader (IContextService contextService)
		{
			_context = (Context) contextService.GetContext();
		}
示例#43
0
 public SectionAdminController(ICommandService commandService, ISectionQueryService queryService, IContextService contextService)
 {
     _commandService = commandService;
     _queryService = queryService;
     _contextService = contextService;
 }
示例#44
0
    /// <summary>
    /// Handles the Init event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void Page_Init(object sender, EventArgs e)
    {
        grdProducts.Columns[6].Visible = BusinessRuleHelper.IsMultiCurrencyEnabled();

        _Context = ApplicationContext.Current.Services.Get<IContextService>();
        _State = _Context.GetContext("AddProductStateInfo") as AddProductStateInfo;
        if (_State == null) {_State = new AddProductStateInfo();}
    }
示例#45
0
        public void SetVisibility(bool param)
        {
            // Установим видимость левой панели в соответствии с установками
            View.TreePanel.Visible = param;
            Settings.Default.LeftPanelVisible = param;

            _context = _workItem.RootWorkItem.Services.Get<IContextService>();
            _context.menuTreeVisible = param;
        }
示例#46
0
        public void ParseData()
        {
            this.context = _workitem.RootWorkItem.Services.Get<IContextService>();
            string menu = context.startupDir + "\\menu.dat";
            MenuData md = new MenuData();
            context.menuData = md;
            if (System.IO.File.Exists(menu))
            {
                    using (StreamReader sr = new StreamReader(menu, System.Text.Encoding.GetEncoding(866)))
                    {
                        string s = "";
                        string id = "";
                        while ((s = sr.ReadLine()) != null)
                        {
                            try
                            {
                                id = ExtractMenuNumber(s);
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show("Ошибка при разборе файла MENU.DAT");
                            }
                            if (id != "     ")
                            {

                                MenuData._mainMenuRow newRow = md._mainMenu.New_mainMenuRow();
                                newRow.ID = id;
                                newRow.NAME = ExtractMenuHeader(s);

                                Collection<string[]> cmds = ExtractCommands(s);
                                if (cmds != null)
                                {
                                    int i = 1;
                                    foreach(string[] cmd in cmds)
                                    {
                                        switch (i)
                                        {
                                            case 1: newRow.CMD1 = cmd[0]; break;
                                            case 2: newRow.CMD2 = cmd[0]; break;
                                            case 3: newRow.CMD3 = cmd[0]; break;
                                            case 4: newRow.CMD4 = cmd[0]; break;
                                            case 5: newRow.CMD5 = cmd[0]; break;
                                        }
                                        i++;
                                    }
                                }

                                newRow.CMDNAME = AppropriateCommandName(newRow) ;
                                if (newRow.CMDNAME == string.Empty)
                                    newRow.SetCMD1Null();

                                //menuItem.ToolTipText = rootNode.Attributes["Подсказка"].Value;
                                md._mainMenu.Add_mainMenuRow(newRow);
                            }
                        }
                    }
                    // Пpосмотp ДАТ и РАЗМЕРОВ программных файлов в варианте WINDOWS
                    //AddNewParentToolStripMenuElement(, UIExtensionSiteNames.InfoViewMenuItem, "", "Пpосмотp ДАТ и РАЗМЕРОВ программных файлов в варианте WINDOWS", UIExtensionSiteNames.DifferentMenuItem);

                    //AddNewToolStripMenuElement("&Пpосмотp ДАТ и РАЗМЕРОВ программных файлов в варианте WINDOWS", UIExtensionSiteNames.InfoViewMenuItem, "", "Пpосмотp ДАТ и РАЗМЕРОВ программных файлов в варианте WINDOWS", UIExtensionSiteNames.DifferentMenuItem);
                    //AddNewToolStripMenuElement("Пpосмотp ДАТ и РАЗМЕРОВ программ EXE", "00791", CommandNames.InfoViewExeShow, "", UIExtensionSiteNames.InfoViewMenuItem);
                    //AddNewToolStripMenuElement("Пpосмотp ДАТ и РАЗМЕРОВ программ RES", "00792", CommandNames.InfoViewResShow, "", UIExtensionSiteNames.InfoViewMenuItem);
                    //AddNewToolStripMenuElement("Пpосмотp ДАТ и РАЗМЕРОВ программ HLP", "00793", CommandNames.InfoViewHlpShow, "", UIExtensionSiteNames.InfoViewMenuItem);
                    //AddNewToolStripMenuElement("Просмотр ДАТ и РАЗМЕРОВ наборов текущей организации", "00794", CommandNames.InfoViewCurShow, "", UIExtensionSiteNames.InfoViewMenuItem);
                    //AddNewToolStripMenuElement("Просмотр ДАТ и РАЗМЕРОВ *.???", "00795", CommandNames.InfoViewAllShow, "", UIExtensionSiteNames.InfoViewMenuItem);

                    // Установки
                    //AddNewParentToolStripMenuElement("&УСТАНОВКИ", "00009", "", "Установки программы", UIExtensionSiteNames.MainMenu);
                    AddNewToolStripMenuElement("&УСТАНОВКИ", "000099", "", "Установки программы", UIExtensionSiteNames.MainMenu);

                    // Экран приветствия
                    //AddNewToolStripMenuElement("&Экран приветствия", "00091", CommandNames.SplashShow, "Показать заставку", UIExtensionSiteNames.SettingsMenu);

                    // Обмен данными с 1С
                    //AddNewToolStripMenuElement("&Обмен с 1С", "00091", CommandNames.Exchange1CDlgShow, "Обмен с 1С", UIExtensionSiteNames.SettingsMenu);

                    // Настройки
                    AddNewToolStripMenuElement("&Настройка", "000992", CommandNames.SettingsShow, "Настройки программы", UIExtensionSiteNames.SettingsMenu);
                    // О программе
                    AddNewToolStripMenuElement("&О программе...", "000993", CommandNames.AboutBoxShow, "О программе", UIExtensionSiteNames.SettingsMenu);

                }
                else
                    MessageBox.Show(ErrorNames.Err1, "ACOT");

            // Выход
            AddNewToolStripMenuElement("&ВЫХОД", CommandNames.AcotExit, CommandNames.AcotExit, "Выход из АСОТ", UIExtensionSiteNames.MainMenu);

            context.menuData.AcceptChanges();
            //context.menuData.WriteXml("menu.xml");
        }
示例#47
0
 public EntregasStockModel(IContextService context) : base(context)
 {
     Modo = ModoAlbaran.Constock;
 }
示例#48
0
 public GuiascontablesConverterService(IContextService context, MarfilEntities db) : base(context, db)
 {
 }
    /// <summary>
    /// Handles the Init event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void Page_Init(object sender, EventArgs e)
    {
        ScriptManager.GetCurrent(Page).Scripts.Add(new ScriptReference("~/SmartParts/Opportunity/AddOpportunityProduct.js"));

        _Context = ApplicationContext.Current.Services.Get<IContextService>();
        _State = _Context.GetContext("AddProductStateInfo") as AddProductStateInfo;
        if (_State == null) { _State = new AddProductStateInfo(); }
    }
示例#50
0
 public ListadosDiarioContableController(IContextService context) : base(context)
 {
 }
 public BusquedaBundleArticulosLotesApiController(IContextService context) : base(context)
 {
 }
示例#52
0
 public SaldosAcumuladosPeriodosService(IContextService context, MarfilEntities db = null) : base(context, db)
 {
 }
    private IList<IEvent> GetEvents()
    {
        ActivitySearchOptions aso;
        _Context = ApplicationContext.Current.Services.Get<IContextService>(true);
        _TimeZone = (TimeZone) _Context.GetContext("TimeZone");
        aso = (ActivitySearchOptions)_Context.GetContext("ActivitySearchCriteria");
        if (aso == null)
        {
            aso = new ActivitySearchOptions();
            aso.UserIds.Add(_UserId);
            aso.StartDate = DateTime.Today.ToUniversalTime();
            aso.EndDate = DateTime.Today.AddDays(1).ToUniversalTime();
        }
        using ( new SessionScopeWrapper())
        {
            IRepository<IEvent> eventRep = EntityFactory.GetRepository<IEvent>();
            IQueryable qry = (IQueryable)eventRep;
            IExpressionFactory ef = qry.GetExpressionFactory();
            ICriteria crit = qry.CreateCriteria();
            IExpression userExp = ef.Eq("UserId", aso.UserIds[0]);
            IExpression dateRangeExp = null;
            if (_SortDir.Equals("Ascending"))
            {
                crit.AddOrder(ef.Asc(_SortColumn));
            }
            else
            {
                crit.AddOrder(ef.Desc(_SortColumn));
            }

            if (aso.UserIds.Count > 1)
            {
                userExp = ef.In("UserId", aso.UserIds);
            }
            if (aso.StartDate.HasValue)
            {
                dateRangeExp = ef.And(ef.Ge("StartDate", aso.StartDate.Value), ef.Lt("StartDate", aso.EndDate.Value));
            }

            IList<IEvent> events;
            if (dateRangeExp != null)
            {
                events = crit.Add(
                    ef.And(userExp, dateRangeExp)).List<IEvent>();
            }
            else
            {
                events = crit.Add(userExp).List<IEvent>();
            }
            return events;
        }
    }
    /// <summary>
    /// Formats the email body.
    /// </summary>
    /// <param name="opportunity">The opportunity.</param>
    /// <returns></returns>
    private string FormatEmailBody(IOpportunity opportunity)
    {
        IContextService context     = ApplicationContext.Current.Services.Get <IContextService>(true);
        TimeZone        timeZone    = (TimeZone)context.GetContext("TimeZone");
        string          datePattern = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;

        string oppProducts = String.Empty;
        bool   oppWon      = GetOpportunityStatusMatch(opportunity, "ClosedWon");
        bool   oppLost     = GetOpportunityStatusMatch(opportunity, "ClosedLost");
        string emailBody   = String.Format("{0} \r\n", GetLocalResourceObject("lblEmailInfo.Caption"));

        emailBody += String.Format("{0} {1} \r\n", GetLocalResourceObject("lblEmailOppDesc.Caption"),
                                   CheckForNullValue(opportunity.Description));
        emailBody += String.Format("{0} {1} \r\n", GetLocalResourceObject("lblEmailOppAccount.Caption"),
                                   CheckForNullValue(opportunity.Account != null
                                                         ? opportunity.Account.AccountName
                                                         : String.Empty));
        emailBody += String.Format("{0} {1} \r\n", GetLocalResourceObject("EmailOppAcctMgr.Caption"),
                                   CheckForNullValue(opportunity.AccountManager));
        emailBody += String.Format("{0} {1} \r\n", GetLocalResourceObject("EmailOppReseller.Caption"),
                                   CheckForNullValue(opportunity.Reseller));
        emailBody += String.Format("{0} {1} \r\n", GetLocalResourceObject("EmailOppEstClose.Caption"),
                                   opportunity.EstimatedClose.HasValue
                                       ? timeZone.UTCDateTimeToLocalTime((DateTime)opportunity.EstimatedClose).ToString
                                       (datePattern)
                                       : String.Empty);
        emailBody += String.Format("{0} {1} \r\n", GetLocalResourceObject("EmailOppCloseProb.Caption"),
                                   CheckForNullValue(opportunity.CloseProbability));
        emailBody += String.Format("{0} {1} \r\n\r\n", GetLocalResourceObject("EmailOppComments.Caption"),
                                   CheckForNullValue(opportunity.Notes));
        emailBody += String.Format("{0} \r\n", GetLocalResourceObject("EmailOppValue.Caption"));
        //emailBody += BusinessRuleHelper.AccountingSystemHandlesSO()
        //                 ? String.Format("{0} {1} \r\n", GetLocalResourceObject("EmailOppPotential.Caption"),
        //                                 curERPOpenBaseSalesPotential.FormattedText)
        //                 : String.Format("{0} {1} \r\n", GetLocalResourceObject("EmailOppPotential.Caption"),
        //                                 curOpenBaseSalesPotential.FormattedText);
        emailBody += String.Format("{0} {1} \r\n\r\n", GetLocalResourceObject("EmailOppWeighted.Caption"),
                                   curBaseWeighted.FormattedText);
        emailBody += String.Format("{0} \r\n", GetLocalResourceObject("EmailOppSummary.Caption"));
        if (oppWon || oppLost)
        {
            emailBody += String.Format("{0} \r\n",
                                       String.Format(
                                           GetLocalResourceObject("EmailOppWonLostSummary.Caption").ToString(),
                                           dtpClosedWonSummary.Text,
                                           Convert.ToString(opportunity.DaysOpen)));
            emailBody += oppWon
                             ? String.Format("{0} \r\n",
                                             String.Format(
                                                 GetLocalResourceObject("EmailOppReasonWon.Caption").ToString(),
                                                 CheckForNullValue(opportunity.Reason)))
                             : String.Format("{0} \r\n",
                                             String.Format(
                                                 GetLocalResourceObject("EmailOppReasonLost.Caption").ToString(),
                                                 CheckForNullValue(opportunity.Reason)));
        }
        else
        {
            emailBody += String.Format("{0} \r\n",
                                       String.Format(GetLocalResourceObject("EmailOppStageSummary.Caption").ToString(),
                                                     CheckForNullValue(opportunity.Stage)));
        }
        emailBody += String.Format("{0} \r\n\r\n",
                                   String.Format(GetLocalResourceObject("lblEmailOppType.Caption").ToString(),
                                                 CheckForNullValue(opportunity.Type)));

        emailBody += String.Format("{0} \r\n", GetLocalResourceObject("EmailOppProducts.Caption"));

        oppProducts = Enumerable.Aggregate(opportunity.Products, oppProducts,
                                           (current, oppProduct) =>
                                           current +
                                           String.Format("{0} ({1}); ", oppProduct.Product, oppProduct.Quantity));

        if (!string.IsNullOrEmpty(oppProducts))
        {
            emailBody += String.Format("{0} \r\n\r\n", CheckForNullValue(oppProducts.Substring(0, oppProducts.Length - 2)));
        }

        if (oppWon || oppLost)
        {
            emailBody += String.Format("{0} \r\n{1} \r\n\r\n", GetLocalResourceObject("EmailOppCompetitors.Caption"),
                                       GetOpportunityCompetitors());
        }

        emailBody += String.Format("{0} \r\n", GetLocalResourceObject("EmailOppContacts.Caption"));
        emailBody  = Enumerable.Aggregate(opportunity.Contacts, emailBody,
                                          (current, oppContact) =>
                                          current +
                                          String.Format("{0} \r\n",
                                                        String.Format("{0}, {1}; {2}", oppContact.Contact.Name,
                                                                      oppContact.Contact.Title, oppContact.SalesRole)));
        return(HttpUtility.JavaScriptStringEncode(emailBody));
    }
示例#55
0
    /// <summary>
    /// Handles the Init event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void Page_Init(object sender, EventArgs e)
    {
        if (Visible)
        {
            _Context = ApplicationContext.Current.Services.Get<IContextService>();
            if (_Context.HasContext("AddManageFilterStateInfo"))
            {
                _State = (AddManageFilterStateInfo) _Context.GetContext("AddManageFilterStateInfo");
            }
            if (_State == null)
            {
                _State = new AddManageFilterStateInfo();
                _State.targetList = GetDataGridLayout();
            }

            rdgIncludeType.Items[0].Attributes.Add("onclick", "javascript:onSearchTypeChange(0);");
            rdgIncludeType.Items[1].Attributes.Add("onclick", "javascript:onSearchTypeChange(1);");
            rdgIncludeType.Items[2].Attributes.Add("onclick", "javascript:onSearchTypeChange(2);");
            rdgIncludeType.Items[3].Attributes.Add("onclick", "javascript:onSearchTypeChange(3);");
            tabLookupTarget.Attributes.Add("onclick", "javascript:OnTabLookupTargetClick()");
            tabAddFromGroup.Attributes.Add("onclick", "javascript:OnTabAddFromGroupClick()");
        }
    }
示例#56
0
 public MonedasConverterService(IContextService context, MarfilEntities db) : base(context, db)
 {
 }
示例#57
0
 /// <summary>
 /// Handles the Init event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void Page_Init(object sender, EventArgs e)
 {
     _Context = ApplicationContext.Current.Services.Get<IContextService>();
 }
    protected void Page_UnLoad(object sender, EventArgs e)
    {
        IContextService context = ApplicationContext.Current.Services.Get <IContextService>();

        context.SetContext("DefaultOpportunity", null);
    }
示例#59
0
 public HomeController(ILoggerFactory factory, IContextService contextService)
 {
     this._log = factory.Create(typeof(HomeController));
     this._context = contextService;
 }
示例#60
0
 public PresupuestosComprasModel(IContextService context) : base(context)
 {
 }