Пример #1
0
        public void SendRequestTariff(bool license, string fname, string lname, string title, string email, string phone, string ctitle, string csize, string site, string message)
        {
            fname = (fname ?? "").Trim();
            if (string.IsNullOrEmpty(fname))
            {
                throw new ArgumentNullException("fname");
            }
            lname = (lname ?? "").Trim();
            if (string.IsNullOrEmpty(lname))
            {
                throw new ArgumentNullException("lname");
            }
            title = (title ?? "").Trim();
            email = (email ?? "").Trim();
            if (string.IsNullOrEmpty(email))
            {
                throw new ArgumentNullException("email");
            }
            phone = (phone ?? "").Trim();
            if (string.IsNullOrEmpty(phone))
            {
                throw new ArgumentNullException("phone");
            }
            ctitle = (ctitle ?? "").Trim();
            if (string.IsNullOrEmpty(ctitle))
            {
                throw new ArgumentNullException("ctitle");
            }
            csize = (csize ?? "").Trim();
            if (string.IsNullOrEmpty(csize))
            {
                throw new ArgumentNullException("csize");
            }
            site = (site ?? "").Trim();
            if (string.IsNullOrEmpty(site))
            {
                throw new ArgumentNullException("site");
            }
            message = (message ?? "").Trim();

            var salesEmail = AdditionalWhiteLabelSettings.Instance(SettingsManager).SalesEmail ?? SetupInfo.SalesEmail;

            var recipient = (IRecipient)(new DirectRecipient(AuthContext.CurrentAccount.ID.ToString(), string.Empty, new[] { salesEmail }, false));

            client.SendNoticeToAsync(license ? Actions.RequestLicense : Actions.RequestTariff,
                                     new[] { recipient },
                                     new[] { "email.sender" },
                                     new TagValue(Tags.UserName, fname),
                                     new TagValue(Tags.UserLastName, lname),
                                     new TagValue(Tags.UserPosition, title),
                                     new TagValue(Tags.UserEmail, email),
                                     new TagValue(Tags.Phone, phone),
                                     new TagValue(Tags.Website, site),
                                     new TagValue(Tags.CompanyTitle, ctitle),
                                     new TagValue(Tags.CompanySize, csize),
                                     new TagValue(Tags.Body, message));
        }
Пример #2
0
        private object GetFolderIdAndProccessFirstVisit(FileMarker fileMarker, IDaoFactory daoFactory, bool my)
        {
            var folderDao = daoFactory.FolderDao;
            var fileDao   = daoFactory.FileDao;

            var id = my ? folderDao.GetFolderIDUser(false) : folderDao.GetFolderIDCommon(false);

            if (Equals(id, 0)) //TODO: think about 'null'
            {
                id = my ? folderDao.GetFolderIDUser(true) : folderDao.GetFolderIDCommon(true);

                //Copy start document
                if (AdditionalWhiteLabelSettings.Instance(SettingsManager).StartDocsEnabled)
                {
                    try
                    {
                        var storeTemplate = GlobalStore.GetStoreTemplate();

                        var culture = my ? UserManager.GetUsers(AuthContext.CurrentAccount.ID).GetCulture() : TenantManager.GetCurrentTenant().GetCulture();
                        var path    = FileConstant.StartDocPath + culture + "/";

                        if (!storeTemplate.IsDirectory(path))
                        {
                            path = FileConstant.StartDocPath + "default/";
                        }
                        path += my ? "my/" : "corporate/";

                        SaveStartDocument(fileMarker, folderDao, fileDao, id, path, storeTemplate);
                    }
                    catch (Exception ex)
                    {
                        Logger.Error(ex);
                    }
                }
            }

            return(id);
        }