Beispiel #1
0
 public void Register(IContainerManager containerManager, CMS.Common.Runtime.ITypeFinder typeFinder)
 {
     foreach (var type in typeFinder.FindClassesOfType<ITabPlugin>())
     {
         containerManager.AddComponent(typeof(ITabPlugin), type, type.FullName, ComponentLifeStyle.Transient);
     }
 }
        public async Task <IActionResult> Edit(int id, [Bind("ID,Title,Genre,Content,IsReleased")] CMS cMS)
        {
            if (id != cMS.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cMS);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CMSExists(cMS.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(cMS));
        }
Beispiel #3
0
        public void AddCustomer_To_CMS()
        {
            var customer = new Customer("John", "Smith", new DateTime(1980, 1, 1));
            var cms      = new CMS();

            cms.AddCustomer(customer);
        }
 public void Register(IContainerManager containerManager, CMS.Common.Runtime.ITypeFinder typeFinder)
 {
     foreach (var type in typeFinder.FindClassesOfType<ICommerceDbProvider>())
     {
         CommerceDbProviders.Providers.Add((ICommerceDbProvider)containerManager.Resolve(type));
     }
 }
Beispiel #5
0
    //Use this for initialization
    public void Start()
    {
        //Gets a the cms ref
        cms = this.GetComponent <CMS>();

        //Gets all question records
        cms.OpenConnection();

        MainController.Instance.Loader.text = "OPEN DB CONNECTION";

        cms.GetAllPollRecords();

        MainController.Instance.Loader.text = "GATHER POLL RECORDS";

        cms.GetAllTwitterRecords();

        MainController.Instance.Loader.text = "GATHER TWITTER RECORDS";

        cms.GetBackground();

        cms.CloseConnection();

        MainController.Instance.Loader.text = "CLOSE CONNECTION";

        SetupTwitterCubes();
    }
Beispiel #6
0
        public Manage(int i)
        {
            dataSet = new DataSet();
            cms     = new CMS(DataAccessMode.Connected);
            cms.InitializeConnection();
            InitializeComponent();
            switch (i)
            {
            case 1:
                CampaignDonorsItems.Visible = true;
                break;

            case 2:
                CampaignsReceipeintItems.Visible = true;
                break;

            case 3:
                MainSubCategory.Visible = true;
                break;

            case 4:
                DepartmentEmployees.Visible = true;
                break;

            default:
                CampaignsVolunteersBeneficiers.Visible = true;
                break;
            }
        }
        public void Register(IContainerManager containerManager, CMS.Common.Runtime.ITypeFinder typeFinder)
        {
            var container = ((Kooboo.CMS.Common.Runtime.Dependency.Ninject.ContainerManager)containerManager).Container;

            container.Bind<ICommerceInstanceNameResolver>().ToMethod(ctx =>
            {
                var resolver = new CompositeCommerceInstanceNameResolver
                (
                    new HttpContextItemCommerceInstanceNameResolver(),
                    new QueryStringCommerceInstanceNameResolver(),
                    new HttpHeaderCommerceInstanceNameResolver("X-Kooboo-Commerce-Instance"),
                    new PostParamsCommerceInstanceNameResolver(),
                    new RouteDataCommerceInstanceResolver("instance")
                );

                return resolver;
            });

            container.Bind<ICommerceDatabase>()
                     .ToMethod(ctx =>
                     {
                         var context = ctx.Kernel.GetService(typeof(CommerceInstanceContext)) as CommerceInstanceContext;
                         if (context.CurrentInstance == null)
                             throw new InvalidOperationException("Cannot resolve current commerce instance. Ensure 'commerceName' parameter is included in the http request.");

                         return context.CurrentInstance.Database;
                     });

            container.Bind(typeof(IRepository<>)).To(typeof(CommerceRepository<>));
        }
        public void Register(IContainerManager containerManager, CMS.Common.Runtime.ITypeFinder typeFinder)
        {
            // Current instance providers
            containerManager.AddComponent(typeof(ICurrentInstanceProvider), typeof(ThreadScopeCurrentInstanceProvider), "ThreadScopeCurrentInstanceProvider", ComponentLifeStyle.Singleton);
            containerManager.AddComponent(typeof(ICurrentInstanceProvider), typeof(SiteAwareHttpCurrentInstanceProvider), "SiteAwareHttpCurrentInstanceProvider", ComponentLifeStyle.Transient);

            // Data folder factory
            containerManager.AddComponentInstance<DataFolderFactory>(DataFolderFactory.Current);

            // Instance intializers
            foreach (var type in typeFinder.FindClassesOfType<IInstanceInitializer>())
            {
                containerManager.AddComponent(typeof(IInstanceInitializer), type, type.FullName, ComponentLifeStyle.Transient);
            }

            // Repository and ICommerceDatabase
            var container = ((Kooboo.CMS.Common.Runtime.Dependency.Ninject.ContainerManager)containerManager).Container;

            container.Bind<CommerceInstance>()
                     .ToMethod(ctx => CommerceInstance.Current);

            container.Bind<ICommerceDatabase>()
                     .ToMethod(ctx =>
                     {
                         var instance = CommerceInstance.Current;
                         if (instance == null)
                             throw new InvalidOperationException("Cannot resolve ICommerceDatabase, because there's no commerce instance in the context.");

                         return instance.Database;
                     });

            container.Bind(typeof(IRepository<>)).To(typeof(CommerceRepository<>));
        }
Beispiel #9
0
    private static void fetchCMVAbilities(CMS cms, int abilitiesStart)
    {
        // Debug.Log(abilitiesStart);
        string[] lines            = cms.File.text.Split("\n"[0]);
        string[] ignoredAbilities = { "input", "hit level" };
        string[] row            = SplitCsvLine(lines[abilitiesStart]);
        string[] abilitiesInfos = new string[row.Length - 1];
        // Debug.Log("Récupération des variables de combat ----------------------------");
        for (int i = 1; i < row.Length - 1; ++i)
        {
            abilitiesInfos[i] = row[i].ToLower();
            // Debug.Log(abilitiesInfos[i]);
        }
        for (int i = ++abilitiesStart; i < lines.Length; ++i)
        {
            row = SplitCsvLine(lines[i].ToLower());
            // Debug.Log(row[0]);
            CMS.Ability ability = new CMS.Ability(row[0]);
            for (int j = 1; j < row.Length - 1; ++j)
            {
                if (!ignoredAbilities.Contains(abilitiesInfos[j]))
                {
                    ability.informations.Add(abilitiesInfos[j], double.Parse(row[j]));
                }
            }
            cms.abilities.Add(row[0], ability);
            // Debug.Log(ability.informations.ToString());
        }

        for (int i = 0; i < cms.abilities.Count; ++i)
        {
            // Debug.Log(cms.abilities.Keys.ElementAt(i));
            // Debug.Log(cms.abilities[cms.abilities.Keys.ElementAt(i)]);
        }
    }
Beispiel #10
0
        public void OnResolvedPage(System.Web.Mvc.ControllerContext controllerContext, CMS.Sites.View.PageRequestContext pageRequestContext)
        {
            var page = pageRequestContext.Page;
            if (!page.CustomFields.ContainsKey("ProductId"))
            {
                return;
            }

            var value = ParameterizedFieldValue.GetFieldValue(page.CustomFields["ProductId"], pageRequestContext.GetValueProvider());
            if (String.IsNullOrEmpty(value))
            {
                return;
            }

            int productId;
            if (Int32.TryParse(value, out productId))
            {
                BehaviorReceivers.Receive(Site.Current.GetCommerceInstanceName(),
                            new Behavior
                            {
                                Type = BehaviorTypes.View,
                                ItemId = productId.ToString(),
                                UserId = controllerContext.RequestContext.HttpContext.EnsureVisitorUniqueId()
                            });
            }
        }
Beispiel #11
0
        public ActionResult DeleteConfirmed(int id)
        {
            CMS cMS = db.CMS.Find(id);

            db.CMS.Remove(cMS);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #12
0
 public List<Project> SortProjects(CMS.DocumentEngine.DocumentQuery<Project> query, string sortOrder)
 {
     List<string> viewBagFields = SortHelper.GetProjectsSortViewBagFields(sortOrder);
     ViewBag.ProjectNameSortParam = viewBagFields[0];
     ViewBag.DeliverySortParam = viewBagFields[1];
     SortHelper.SortByColumn(query, sortOrder);
     return query.ToList();
 }
Beispiel #13
0
    // Primary function, is used to initialize the cms
    static public CMS fetchCMSFromFile(TextAsset csvFile)
    {
        CMS cms            = new CMS(csvFile);
        int abilitiesStart = fetchCMSMovements(cms);

        fetchCMVAbilities(cms, abilitiesStart);
        return(cms);
    }
    public void SendMailLevel2(String Body)
    {
        int         result;
        MailMessage Msg = new MailMessage();

        Msg.From = new MailAddress("*****@*****.**");
        Msg.To.Add(new MailAddress("*****@*****.**"));
        Msg.To.Add(new MailAddress("*****@*****.**"));
        Msg.To.Add(new MailAddress("*****@*****.**"));
        Msg.To.Add(new MailAddress("*****@*****.**"));
        Msg.To.Add(new MailAddress("*****@*****.**"));

        Msg.Bcc.Add(new MailAddress("*****@*****.**"));
        Msg.Subject    = "Escalation Level 2";
        Msg.Body       = Body;
        Msg.IsBodyHtml = true;
        string sSmtpServer = "";

        sSmtpServer = "mail.chetanapublications.com";
        SmtpClient smtp = new SmtpClient();

        smtp.Host = sSmtpServer;
        smtp.Port = 587;
        smtp.UseDefaultCredentials = false;
        smtp.Credentials           = new System.Net.NetworkCredential("*****@*****.**", "we0504260");
        smtp.EnableSsl             = false;
        try
        {
            smtp.Send(Msg);
            DataRow R;
            CMS     _objCMS = new CMS();
            {
                DataTable DsCmsMail = new DataTable();
                DsCmsMail = CMS.Idv_Chetana_CMS_TKTESCALATE("Level2").Tables[0];
                if (DsCmsMail.Rows.Count != 0)
                {
                    for (int k = 0; k <= DsCmsMail.Rows.Count - 1; k++)
                    {
                        R = DsCmsMail.Rows[k];


                        _objCMS.TktNumber = R[0].ToString();
                        _objCMS.CreatedBy = "Auto Mail";
                        _objCMS.IsActive  = true;
                        _objCMS.Save_CMS_Email();
                    }
                }
                MessageBox(Constants.save);
            }
            lblMessage.Text = "Mail Sent";
            //Response.Redirect("Dashboard.aspx");
        }
        catch (Exception ex)
        {
            lblMessage.Text = ex.Message;
            //Response.Redirect("Dashboard.aspx");
        }
    }
 protected string[] Tabs_OnTabCreated(CMS.SiteProvider.UIElementInfo element, string[] parameters, int tabIndex)
 {
     // Skip objects tab element if not have proper license
     if ((element.ElementName.ToLower() == "myrecyclebin.objects") && !LicenseKeyInfoProvider.IsFeatureAvailable(FeatureEnum.ObjectVersioning))
     {
         return null;
     }
     return parameters;
 }
Beispiel #16
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(CMS.Model.CMS_Product model)
 {
     StringBuilder strSql = new StringBuilder();
     StringBuilder strSql1 = new StringBuilder();
     StringBuilder strSql2 = new StringBuilder();
     if (model.CMS_ProductName != null)
     {
         strSql1.Append("CMS_ProductName,");
         strSql2.Append("'" + model.CMS_ProductName + "',");
     }
     if (model.CMS_ProductClassID != null)
     {
         strSql1.Append("CMS_ProductClassID,");
         strSql2.Append("" + model.CMS_ProductClassID + ",");
     }
     if (model.CMS_ProductContent != null)
     {
         strSql1.Append("CMS_ProductContent,");
         strSql2.Append("'" + model.CMS_ProductContent + "',");
     }
     if (model.CMS_ProductImg != null)
     {
         strSql1.Append("CMS_ProductImg,");
         strSql2.Append("'" + model.CMS_ProductImg + "',");
     }
     if (model.CMS_AddTime != null)
     {
         strSql1.Append("CMS_AddTime,");
         strSql2.Append("'" + model.CMS_AddTime + "',");
     }
     if (model.CMS_Puter != null)
     {
         strSql1.Append("CMS_Puter,");
         strSql2.Append("'" + model.CMS_Puter + "',");
     }
     if (model.CMS_IsSlide != null)
     {
         strSql1.Append("CMS_IsSlide,");
         strSql2.Append("" + model.CMS_IsSlide + ",");
     }
     strSql.Append("insert into CMS_Product(");
     strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
     strSql.Append(")");
     strSql.Append(" values (");
     strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
     strSql.Append(")");
     strSql.Append(";select @@IDENTITY");
     object obj = DbHelperSQL.GetSingle(strSql.ToString());
     if (obj == null)
     {
         return 0;
     }
     else
     {
         return Convert.ToInt32(obj);
     }
 }
Beispiel #17
0
 public List<Employee> SortEmployees(CMS.DocumentEngine.DocumentQuery<Employee> query, string sortOrder)
 {
     List<string> viewBagFields = SortHelper.GetEmployeesSortViewBagFields(sortOrder);
     ViewBag.FirstNameSortParam = viewBagFields[0];
     ViewBag.LastNameSortParam = viewBagFields[1];
     ViewBag.PositionSortParam = viewBagFields[2];
     SortHelper.SortByColumn(query, sortOrder);
     return query.ToList();
 }
Beispiel #18
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(CMS.Model.CMS_Baseset model)
 {
     StringBuilder strSql = new StringBuilder();
     StringBuilder strSql1 = new StringBuilder();
     StringBuilder strSql2 = new StringBuilder();
     if (model.WebSiteName != null)
     {
         strSql1.Append("WebSiteName,");
         strSql2.Append("'" + model.WebSiteName + "',");
     }
     if (model.CompanyName != null)
     {
         strSql1.Append("CompanyName,");
         strSql2.Append("'" + model.CompanyName + "',");
     }
     if (model.CompanyTel != null)
     {
         strSql1.Append("CompanyTel,");
         strSql2.Append("'" + model.CompanyTel + "',");
     }
     if (model.CompanyFax != null)
     {
         strSql1.Append("CompanyFax,");
         strSql2.Append("'" + model.CompanyFax + "',");
     }
     if (model.CompanyAddress != null)
     {
         strSql1.Append("CompanyAddress,");
         strSql2.Append("'" + model.CompanyAddress + "',");
     }
     if (model.Email != null)
     {
         strSql1.Append("Email,");
         strSql2.Append("'" + model.Email + "',");
     }
     if (model.QQ != null)
     {
         strSql1.Append("QQ,");
         strSql2.Append("'" + model.QQ + "',");
     }
     strSql.Append("insert into CMS_Baseset(");
     strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
     strSql.Append(")");
     strSql.Append(" values (");
     strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
     strSql.Append(")");
     strSql.Append(";select @@IDENTITY");
     object obj = DbHelperSQL.GetSingle(strSql.ToString());
     if (obj == null)
     {
         return 1;
     }
     else
     {
         return Convert.ToInt32(obj);
     }
 }
 protected void AutomationManager_OnAfterAction(object sender, CMS.ExtendedControls.AutomationManagerEventArgs e)
 {
     switch (e.ActionName)
     {
         case ComponentEvents.AUTOMATION_REMOVE:
         case ComponentEvents.AUTOMATION_START:
             URLHelper.Redirect(ResolveUrl(GetListingUrl()));
             break;
     }
 }
Beispiel #20
0
 public ActionResult Edit([Bind(Include = "CmsID,Name,Value,Type")] CMS cMS)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cMS).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(cMS));
 }
    string[] Tabs_OnTabCreated(CMS.SiteProvider.UIElementInfo element, string[] parameters, int tabIndex)
    {
        // Add SiteId parameter to each tab
        if (parameters.Length > 2)
        {
            parameters[2] = URLHelper.AddParameterToUrl(parameters[2], "siteId", SiteID.ToString());
        }

        return parameters;
    }
 public void Register(IContainerManager containerManager, CMS.Common.Runtime.ITypeFinder typeFinder)
 {
     foreach (var type in typeFinder.FindClassesOfType<ICommerceDataSource>())
     {
         if (type.IsClass && !type.IsAbstract)
         {
             containerManager.AddComponent(typeof(ICommerceDataSource), type, type.FullName, ComponentLifeStyle.Transient);
         }
     }
 }
    protected void BindGridview3()
    {
        DataSet ds = new DataSet();

        gdLevel3.DataSource = CMS.Idv_Chetana_CMS_TKTESCALATE("Level3").Tables[0];
        gdLevel3.DataBind();
        if (CMS.Idv_Chetana_CMS_TKTESCALATE("Level3").Tables[0].Rows.Count != 0)
        {
            SendMailLevel3();
        }
    }
Beispiel #24
0
        public ActionResult Create([Bind(Include = "CmsID,Name,Value,Type")] CMS cMS)
        {
            if (ModelState.IsValid)
            {
                db.CMS.Add(cMS);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(cMS));
        }
        public async Task <IActionResult> Create([Bind("ID,Title,Genre,Content,IsReleased")] CMS cMS)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cMS);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(cMS));
        }
Beispiel #26
0
    void FetchPlayerInformations()
    {
        cmsInfos = CSVFileReader.fetchCMSFromFile(cmsTextAsset);
        double hp;

        cmsInfos.movements.TryGetValue("health", out hp);
        health = Mathf.RoundToInt((float)hp);
        healthSlider.maxValue = health;
        healthSlider.value    = health;
        // There is a lot more informations to fetch here such as speed, height, etc..
    }
Beispiel #27
0
        public async Task <IActionResult> Create([Bind("ID,Dish,Category,Ingredients,Recipe,IsPublished")] CMS cMS)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cMS);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(cMS));
        }
Beispiel #28
0
    bool uiToolbarElem_OnButtonFiltered(CMS.SiteProvider.UIElementInfo uiElement)
    {
        // Check site availabitility
        if (!CMSContext.CurrentUser.IsAuthorizedPerUIElement("cms.administration", uiElement.ElementName, true))
        {
            return false;
        }

        // Check whether separable modules are loaded
        return IsAdministrationUIElementAvailable(uiElement);
    }
 public void Register(IContainerManager containerManager, CMS.Common.Runtime.ITypeFinder typeFinder)
 {
     foreach (var type in typeFinder.FindClassesOfType<IRuleParameterProvider>())
     {
         if (type != typeof(DefaultRuleParameterProvider))
         {
             var provider = Activator.CreateInstance(type) as IRuleParameterProvider;
             RuleParameterProviders.Providers.Add(provider);
         }
     }
 }
Beispiel #30
0
 public static void SortByColumn(CMS.DocumentEngine.IDocumentQuery query, string sortOrder)
 {
     string order = ValidateSortOrder(sortOrder);
     if (order.Contains("_desc"))
     {
         query.OrderByColumns = order.Replace("_desc", " DESC");
     }
     else
     {
         query.OrderByColumns = order;
     }
 }
Beispiel #31
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(CMS.Model.CMS_ProductClass model)
 {
     StringBuilder strSql = new StringBuilder();
     StringBuilder strSql1 = new StringBuilder();
     StringBuilder strSql2 = new StringBuilder();
     if (model.CMS_ClassName != null)
     {
         strSql1.Append("CMS_ClassName,");
         strSql2.Append("'" + model.CMS_ClassName + "',");
     }
     if (model.CMS_Memo != null)
     {
         strSql1.Append("CMS_Memo,");
         strSql2.Append("'" + model.CMS_Memo + "',");
     }
     if (model.CMS_PID != null)
     {
         strSql1.Append("CMS_PID,");
         strSql2.Append("" + model.CMS_PID + ",");
     }
     if (model.CMS_ClassLayer != null)
     {
         strSql1.Append("CMS_ClassLayer,");
         strSql2.Append("" + model.CMS_ClassLayer + ",");
     }
     if (model.CMS_ClassIdList != null)
     {
         strSql1.Append("CMS_ClassIdList,");
         strSql2.Append("'" + model.CMS_ClassIdList + "',");
     }
     if (model.SortId != null)
     {
         strSql1.Append("SortId,");
         strSql2.Append("" + model.SortId + ",");
     }
     strSql.Append("insert into CMS_ProductClass(");
     strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
     strSql.Append(")");
     strSql.Append(" values (");
     strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
     strSql.Append(")");
     strSql.Append(";select @@IDENTITY");
     object obj = DbHelperSQL.GetSingle(strSql.ToString());
     if (obj == null)
     {
         return 1;
     }
     else
     {
         return Convert.ToInt32(obj);
     }
 }
Beispiel #32
0
 public ActionResult Post(string partition, string ID)
 {
     if (Request.IsAjaxRequest())
     {
         var data = CMS.GetPostContent(partition, ID);
         return(Content(data));
     }
     else
     {
         var data = CMS.GetPost(partition, ID);
         return(View(data));
     }
 }
Beispiel #33
0
        private void selectiveSaveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            List <Char_Model_Spec> SelectCMS = new List <Char_Model_Spec>();

            for (int i = 0; i < cms.Count; i++)
            {
                if (selective[i])
                {
                    SelectCMS.Add(cms[i]);
                }
            }

            CMS.Write("Selective.cms", SelectCMS.ToArray());
        }
Beispiel #34
0
        // GET: CMS/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CMS cMS = db.CMS.Find(id);

            if (cMS == null)
            {
                return(HttpNotFound());
            }
            return(View(cMS));
        }
    protected string[] Tabs_OnTabCreated(CMS.SiteProvider.UIElementInfo element, string[] parameters, int tabIndex)
    {
        if (element.ElementName.ToLower() == "orders.customfields")
        {
            // Check if order has any custom fields
            FormInfo formInfo = FormHelper.GetFormInfo("ecommerce.order", false);
            if (formInfo.GetFormElements(true, false, true).Count <= 0)
            {
                return null;
            }
        }

        return parameters;
    }
 /// <summary>
 /// Resolves the output substitution
 /// </summary>
 /// <param name="sender">Sender</param>
 /// <param name="e">Event arguments</param>
 private void OutputFilter_OnResolveSubstitution(object sender, CMS.OutputFilter.SubstitutionEventArgs e)
 {
     if (!e.Match)
     {
         // Add your custom macro evaluation
         switch (e.Expression.ToLower())
         {
             case "somesubstitution":
                 e.Match = true;
                 e.Result = "Resolved substitution";
                 break;
         }
     }
 }
Beispiel #37
0
 public int Create(CMS cms)
 {
     using (var con = new SqlConnection(SQLHelper.ConnectionString))
     {
         var proc = con.CreateCommand();
         proc.CommandType = System.Data.CommandType.StoredProcedure;
         proc.CommandText = "CMS_Create";
         con.Open();
         proc.Parameters.AddWithValue("@Name", cms.Name);
         proc.Parameters.AddWithValue("@MenuItemId", cms.MenuItemId);
         proc.Parameters.AddWithValue("@HtmlType", cms.HtmlType);
         proc.Parameters.AddWithValue("@Content", cms.Content);
         return((int)proc.ExecuteScalar());
     }
 }
    /// <summary>
    /// Sets icon handler.
    /// </summary>
    string PostTree1_OnGetPostIconUrl(CMS.Forums.ForumPostTreeNode node)
    {
        string imageUrl = "";

        if (node != null)
        {
            imageUrl = GetImageUrl("CMSModules/CMS_Forums/post16.png");
            if (!ValidationHelper.GetBoolean(((DataRow)node.ItemData)["PostApproved"], false))
            {
                imageUrl = GetImageUrl("CMSModules/CMS_Forums/rejected16.png");
            }
        }

        return imageUrl;
    }
Beispiel #39
0
 public Conclusion Check(CMS toValidate)
 {
     if (toValidate == CMS.WORDPRESS)
     {
         return(CheckIsWordpress());
     }
     else if (toValidate == CMS.DRUPAL)
     {
         return(CheckIsDrupal());
     }
     else
     {
         return(CheckIsPrestashop());
     }
 }
        public void Register(IContainerManager containerManager, CMS.Common.Runtime.ITypeFinder typeFinder)
        {
            containerManager.AddComponent(typeof(IMenuInjection), typeof(GlobalMenuInjection), "GlobalMenuInjection", ComponentLifeStyle.Singleton);
            containerManager.AddComponent(typeof(IMenuInjection), typeof(InstanceMenuInjection), "InstanceMenuInjection", ComponentLifeStyle.Singleton);

            foreach (var type in typeFinder.FindClassesOfType<IMenuInjection>())
            {
                if (typeof(CommerceMenuInjection).IsAssignableFrom(type)
                    && type != typeof(GlobalMenuInjection)
                    && type != typeof(InstanceMenuInjection))
                {
                    containerManager.AddComponent(typeof(IMenuInjection), type, type.FullName, ComponentLifeStyle.Transient);
                }
            }
        }
        public void Register(IContainerManager containerManager, CMS.Common.Runtime.ITypeFinder typeFinder)
        {
            RegisterActivities(containerManager, typeFinder);

            var manager = EventSlotManager.Instance;

            manager.Register<BrandCreated>("Brands", "Created");
            manager.Register<BrandUpdated>("Brands", "Updated");
            manager.Register<BrandDeleted>("Brands", "Deleted");

            manager.Register<CategoryCreated>("Categories", "Created");
            manager.Register<CategoryUpdated>("Categories", "Updated");
            manager.Register<CategoryDeleted>("Categories", "Deleted");

            manager.Register<ProductTypeEnabled>("Product Types", "Enabled");
            manager.Register<ProductTypeDisabled>("Product Types", "Disabled");

            manager.Register<ProductCreated>("Products", "Created");
            manager.Register<ProductUpdated>("Products", "Updated");
            manager.Register<ProductDeleted>("Products", "Deleted");
            manager.Register<ProductPublished>("Products", "Published");
            manager.Register<ProductUnpublished>("Products", "Unpublished");
            manager.Register<GetPrice>("Products");

            manager.Register<CustomerCreated>("Customers", "Created");
            manager.Register<CustomerUpdated>("Customers", "Updated");
            manager.Register<CustomerDeleted>("Customers", "Deleted");

            manager.Register<PromotionEnabled>("Promotions", "Enabled");
            manager.Register<PromotionDisabled>("Promotions", "Disabled");

            manager.Register<CartCreated>("Carts", "Created");
            manager.Register<CartItemAdded>("Carts", "Item Added");
            manager.Register<CartItemQuantityChanged>("Carts", "Item Quantity Changed");
            manager.Register<CartItemRemoved>("Carts", "Item Removed");
            manager.Register<CartPriceCalculated>("Carts", "Price Calculated");
            manager.Register<CartExpired>("Carts", "Expires");

            manager.Register<OrderCreated>("Orders", "Created");
            manager.Register<OrderStatusChanged>("Orders", "Status Changed");
            manager.Register<PaymentStatusChanged>("Orders", "Payment Status Changed");

            manager.Register<PaymentMethodEnabled>("Payment Methods", "Enabled");
            manager.Register<PaymentMethodDisabled>("Payment Methods", "Disabled");

            manager.Register<ShippingMethodEnabled>("Shipping Methods", "Enabled");
            manager.Register<ShippingMethodDisabled>("Shipping Methods", "Disabled");
        }
    protected string[] Tabs_OnTabCreated(CMS.SiteProvider.UIElementInfo element, string[] parameters, int tabIndex)
    {
        // Global objects tab will be displayed only to global admin
        if (!currentUser.IsGlobalAdministrator && (element.ElementName.ToLower() == "configuration.settings.globalobjects"))
        {
            return null;
        }

        // Add SiteId parameter to each tab
        if (parameters.Length > 2)
        {
            parameters[2] = URLHelper.AddParameterToUrl(parameters[2], "siteId", this.SiteID.ToString());
        }

        return parameters;
    }
Beispiel #43
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(CMS.Model.CMS_Advertising model)
 {
     StringBuilder strSql = new StringBuilder();
     StringBuilder strSql1 = new StringBuilder();
     StringBuilder strSql2 = new StringBuilder();
     if (model.Title != null)
     {
         strSql1.Append("Title,");
         strSql2.Append("'" + model.Title + "',");
     }
     if (model.AdType != null)
     {
         strSql1.Append("AdType,");
         strSql2.Append("" + model.AdType + ",");
     }
     if (model.AdRemark != null)
     {
         strSql1.Append("AdRemark,");
         strSql2.Append("'" + model.AdRemark + "',");
     }
     if (model.AdWidth != null)
     {
         strSql1.Append("AdWidth,");
         strSql2.Append("" + model.AdWidth + ",");
     }
     if (model.AdHeight != null)
     {
         strSql1.Append("AdHeight,");
         strSql2.Append("" + model.AdHeight + ",");
     }
     strSql.Append("insert into CMS_Advertising(");
     strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
     strSql.Append(")");
     strSql.Append(" values (");
     strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
     strSql.Append(")");
     strSql.Append(";select @@IDENTITY");
     object obj = DbHelperSQL.GetSingle(strSql.ToString());
     if (obj == null)
     {
         return 0;
     }
     else
     {
         return Convert.ToInt32(obj);
     }
 }
Beispiel #44
0
        static void Main(string[] args)
        {
            Customer john  = new Customer("John", "Smith", new DateTime(1980, 1, 1), Gender.Male);
            Customer David = new Customer("David", "Smith", new DateTime(1974, 1, 1), Gender.Male);
            Customer meg   = new Customer("Meg", "Brown", new DateTime(1988, 1, 1), Gender.Female);

            Customer lucy = new Customer("Lucy", "Johnson", new DateTime(1985, 1, 1), Gender.Female);
            var      cms  = new CMS(new Repository());

            cms.AddCustomer(john);
            cms.AddCustomer(David);
            cms.AddCustomer(meg);
            cms.AddCustomer(lucy);
            var allAges    = cms.GetAverageAge();
            var femaleAges = cms.GetAverageAge(x => x.Gender == Gender.Female);
            var maleAges   = cms.GetAverageAge(x => x.Gender == Gender.Male);
        }
        private void tvFiles_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                if (e.Node.Parent != null)
                {
                    bool Opt = IsValidNode(e.Node);
                    renderToolStripMenuItem.Enabled = Opt;
                    openToolStripMenuItem.Enabled   = Opt;
                    renameToolStripMenuItem.Enabled = Opt;
                    backupToolStripMenuItem.Enabled = Opt;

                    CMS.Show(tvFiles, e.Location);
                    tvFiles.SelectedNode = e.Node;
                }
            }
        }
Beispiel #46
0
        public System.Web.Mvc.ActionResult Execute(CMS.Sites.View.Page_Context pageContext, CMS.Sites.View.PagePositionContext positionContext)
        {
            var user = pageContext.ControllerContext.HttpContext.Membership().GetMembershipUser();
            if (user != null)
            {
                var customer = Site.Current.Commerce().Customers.Query().ByEmail(user.Email).FirstOrDefault();
                if (customer != null)
                {
                    return null;
                }
            }

            // TODO: How to get login url?
            var loginUrl = pageContext.FrontUrl.PageUrl("Login", new { ReturnUrl = pageContext.ControllerContext.HttpContext.Request.RawUrl }).ToString();

            return new RedirectResult(loginUrl);
        }
Beispiel #47
0
    protected void CMSCheck()
    {
        DataTable CMSCheck = new DataTable();
        DataRow   RCMSCheck;

        CMSCheck = CMS.Idv_Chetana_CMS_Check().Tables[0];
        if (CMSCheck.Rows.Count != 0)
        {
            for (int k = 0; k <= CMSCheck.Rows.Count - 1; k++)
            {
                RCMSCheck = CMSCheck.Rows[k];
                if (RCMSCheck[0].ToString() != RCMSCheck[1].ToString())
                {
                    Server.Transfer("CMSSendEmail.aspx");
                }
            }
        }
    }
Beispiel #48
0
        public async Task <IActionResult> Save([Bind("Id,Title,Content,Slug")] CMS cms)
        {
            //var cms = _dbContext.CMSs.FirstOrDefault(x => x.Title == data.Title);
            if (ModelState.IsValid)
            {
                if (cms.Id == 0)
                {
                    //return View("Error");

                    _dbContext.Add(cms);
                }
                else
                {
                    _dbContext.Update(cms);
                }
                await _dbContext.SaveChangesAsync();
            }
            return(RedirectToAction(nameof(ManageCMS)));
        }
        public Insert(int i)
        {
            cms = new CMS(DataAccessMode.Connected);
            InitializeComponent();
            switch (i)
            {
            case 1:
                InsertPerson.Visible = true;
                break;

            case 2:
                InsertCampaign.Visible = true;
                break;

            case 3:
                InsertItem.Visible = true;
                break;
            }
        }
        public void Register(IContainerManager containerManager, CMS.Common.Runtime.ITypeFinder typeFinder)
        {
            var assemblies = typeFinder.GetAssemblies()
                                       .Where(x => !IsIgnoredAssembly(x))
                                       .ToList();

            // Handler Registry
            var handlerRegistry = new DefaultEventHandlerRegistry();
            handlerRegistry.RegisterAssemblies(assemblies);
            containerManager.AddComponentInstance<IEventHandlerRegistry>(handlerRegistry);

            // Event Registry
            var eventRegistry = new DefaultEventRegistry();
            eventRegistry.RegisterAssemblies(assemblies);
            containerManager.AddComponentInstance<IEventRegistry>(eventRegistry);

            // Event Dispatcher
            var eventDispatcher = new DefaultEventDispatcher(handlerRegistry);
            containerManager.AddComponentInstance<IEventDispatcher>(eventDispatcher);
        }
Beispiel #51
0
        private void DGVUserList_MouseDown(object sender, MouseEventArgs e)
        {
            try
            {
                if (e.Button == MouseButtons.Right && Session.UserDelete)
                {
                    hittestinfo = DGVUserList.HitTest(e.X, e.Y);

                    if (hittestinfo != null && hittestinfo.Type == DataGridViewHitTestType.Cell)
                    {
                        DGVUserList.ClearSelection();
                        DGVUserList.Rows[hittestinfo.RowIndex].Cells[hittestinfo.ColumnIndex].Selected = true;
                        CMS.Show(DGVUserList, new Point(e.X, e.Y));
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        public async Task <IActionResult> Create([Bind("ID,Channel,Content,IsAuthorized")] CMS cMS)
        {
            var appUser = await _userManager.GetUserAsync(User);

            if (appUser.Department != cMS.Channel)
            {
                cMS.IsAuthorized = false;
            }
            else
            {
                cMS.IsAuthorized = true;
            }
            if (ModelState.IsValid)
            {
                _context.Add(cMS);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index", "Home"));
            }
            return(View(cMS));
        }
 protected void txtInquiryStatus_TextChanged(object sender, EventArgs e)
 {
     try
     {
         string ITcode = txtInquiryStatus.Text.Trim();
         Auth = CMS.GetCMSCodeValidation("Status", ITcode);
         if (Auth)
         {
             MessageBox("Status Type is Already Exist");
             txtInquiryStatus.Text = "";
             txtInquiryStatus.Focus();
         }
         else
         {
             txtInquiryStatus.Focus();
         }
     }
     catch
     {
     }
 }
        public void Register(IContainerManager containerManager, CMS.Common.Runtime.ITypeFinder typeFinder)
        {
            var assemblies = typeFinder.GetAssemblies()
                                       .Where(x => !IsIgnoredAssembly(x))
                                       .ToList();

            foreach (var assembly in assemblies)
            {
                foreach (var handlerType in assembly.GetTypes())
                {
                    if (!handlerType.IsClass || handlerType.IsAbstract || handlerType.IsGenericType)
                    {
                        continue;
                    }

                    foreach (var eventType in GetHandledEventTypes(handlerType))
                    {
                        Event.Listen(eventType, handlerType);
                    }
                }
            }
        }
    private static string[] tabElem_OnTabCreated(CMS.SiteProvider.UIElementInfo element, string[] parameters, int tabIndex)
    {
        switch (element.ElementName.ToLower())
        {
            case "myprofile.notifications":
                if (!LicenseHelper.IsFeatureAvailableInUI(FeatureEnum.Notifications, ModuleEntry.NOTIFICATIONS) ||
                    !ResourceSiteInfoProvider.IsResourceOnSite(ModuleEntry.NOTIFICATIONS, CMSContext.CurrentSiteName))
                {
                    return null;
                }
                break;

            case "myprofile.categories":
                if (!ResourceSiteInfoProvider.IsResourceOnSite("CMS.Categories", CMSContext.CurrentSiteName))
                {
                    return null;
                }
                break;
        }

        return parameters;
    }
Beispiel #56
0
    private static int fetchCMSMovements(CMS cms)
    {
        string[] lines        = cms.File.text.Split("\n"[0]);
        string[] ignoredLines = {};
        string   endMovements = "core move set";
        // Debug.Log("Récupération des variables de mouvement --------------------------------");
        int i = 1;

        string[] row;
        do
        {
            row = SplitCsvLine(lines[i].ToLower());
            // Debug.Log(row[0]);
            if (!ignoredLines.Contains(row[0]) && row[0] != endMovements)
            {
                cms.movements.Add(row[0], double.Parse(row[1]));
                // Debug.Log(row[0] + " : " + row[1]);
            }
            ++i;
        } while (row[0] != endMovements);
        return(i);
    }
Beispiel #57
0
 protected void txtSeverityType_TextChanged(object sender, EventArgs e)
 {
     {
         try
         {
             string ITcode = txtSeverityType.Text.Trim();
             Auth = CMS.GetCMSCodeValidation("Severity", ITcode);
             if (Auth)
             {
                 MessageBox("Severity Type is Already Exist");
                 txtSeverityType.Text = "";
                 txtSeverityType.Focus();
             }
             else
             {
                 txtSeverityType.Focus();
             }
         }
         catch
         {
         }
     }
 }
    protected string[] Tabs_OnTabCreated(CMS.SiteProvider.UIElementInfo element, string[] parameters, int tabIndex)
    {
        switch (element.ElementName.ToLower())
        {
            case "customers.customfields":

                // Check if customer has any custom fields
                FormInfo formInfo = FormHelper.GetFormInfo("ecommerce.customer", false);
                if (formInfo.GetFormElements(true, false, true).Count <= 0)
                {
                    return null;
                }
                break;

            case "customers.newsletters":
                if (!ModuleEntry.IsModuleLoaded(ModuleEntry.NEWSLETTER))
                {
                    return null;
                }
                break;

            case "customers.general":
                // Add hidebreadcrumbs query parameter for the parent refreshing when customer section is opened from orders section
                parameters[2] += "&hidebreadcrumbs=1";
                break;

            case "customers.credit":
                // Hide Credit tab for anonymous customer
                if ((customerInfoObj == null) || !customerInfoObj.CustomerIsRegistered)
                {
                    return null;
                }
                break;
        }

        return parameters;
    }
Beispiel #59
0
        private void appendCMSToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog browseFile = new OpenFileDialog();

            browseFile.Filter = "Xenoverse Char_Model_Spec (*.cms)|*.cms";
            browseFile.Title  = "Browse for CMS File";
            if (browseFile.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }

            FileName = browseFile.FileName;

            cms.AddRange(CMS.Read(FileName));
            selective = new bool[cms.Count];


            cbList.Items.Clear();
            for (int i = 0; i < cms.Count; i++)
            {
                cbList.Items.Add(cms[i].id.ToString("000") + " - " + cms[i].shortname);
                selective[i] = false;
            }
        }
        /// <summary>
        /// Gets media file info object representing the updated version of original file
        /// </summary>
        private MediaFileInfo GetUpdatedFile(CMS.DataEngine.IDataClass origFileDataClass, UploaderHelper args, MediaLibraryInfo mli)
        {
            // Get info on media file from uploaded file
            MediaFileInfo mediaFile = new MediaFileInfo(args.FilePath, args.MediaLibraryArgs.LibraryID, args.MediaLibraryArgs.FolderPath, args.ResizeToWidth, args.ResizeToHeight, args.ResizeToMaxSide);

            // Create new file based on original
            MediaFileInfo updatedMediaFile = new MediaFileInfo(origFileDataClass)
            {
                // Update necessary information
                FileName = mediaFile.FileName,
                FileExtension = mediaFile.FileExtension,
                FileSize = mediaFile.FileSize,
                FileMimeType = mediaFile.FileMimeType,
                FilePath = mediaFile.FilePath,
                FileModifiedByUserID = mediaFile.FileModifiedByUserID,
                FileBinary = mediaFile.FileBinary,
                FileImageHeight = mediaFile.FileImageHeight,
                FileImageWidth = mediaFile.FileImageWidth,
                FileBinaryStream = mediaFile.FileBinaryStream
            };

            return updatedMediaFile;
        }