CRM_Notes.aspx.cs :  » CRM-ERP » Tustena-CRM » Digita » Tustena » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » CRM ERP » Tustena CRM 
Tustena CRM » Digita » Tustena » CRM_Notes.aspx.cs
/// <license>TUSTENA PUBLIC LICENSE v1.0</license>
/// <copyright>
/// Portions Copyright (c) 2003-2006 Digita S.r.l. All Rights Reserved.
///
/// Tustena CRM is a trademark of:
/// Digita S.r.l.
/// Viale Enrico Fermi 14/z
/// 31011 Asolo (Italy)
/// Tel. +39-0423-951251
/// Mail. info@digita.it
///
/// This file contains Original Code and/or Modifications of Original Code
/// as defined in and that are subject to the Tustena Public Source License
/// Version 1.0 (the 'License'). You may not use this file except in
/// compliance with the License. Please obtain a copy of the License at
/// http://www.tustena.com/TPL/ and read it before using this
// file.
///
/// The Original Code and all software distributed under the License are
/// distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
/// EXPRESS OR IMPLIED, AND DIGITA S.R.L. HEREBY DISCLAIMS ALL SUCH WARRANTIES,
/// INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
/// Please see the License for the specific language governing rights and
/// limitations under the License.
///
/// YOU MAY NOT REMOVE OR ALTER THIS COPYRIGHT NOTICE!
/// </copyright>

using System;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using Digita.Tustena.Base;
using Digita.Tustena.Core;
using Digita.Tustena.Database;
using Digita.Tustena.WebControls;

namespace Digita.Tustena{
  public partial class Notes : G
  {

    protected Digita.Tustena.WebControls.RepeaterHeaderBegin RepeaterHeaderBegin1;
    protected Digita.Tustena.WebControls.RepeaterColumnHeader Repeatercolumnheader1;
    protected Digita.Tustena.WebControls.RepeaterColumnHeader Repeatercolumnheader2;
    protected Digita.Tustena.WebControls.RepeaterColumnHeader Repeatercolumnheader3;
    protected Digita.Tustena.WebControls.RepeaterHeaderEnd RepeaterHeaderEnd1;
    protected System.Web.UI.WebControls.LinkButton ModifyNote;
    protected System.Web.UI.WebControls.Literal IDApp;
    protected System.Web.UI.WebControls.Literal TextApp;
    protected System.Web.UI.WebControls.TextBox AreaText;
    protected System.Web.UI.WebControls.LinkButton NoteSubmit;
    protected System.Web.UI.HtmlControls.HtmlGenericControl ViewText;


    protected void Page_Load(object sender, EventArgs e)
    {
      if (!Login())
      {
        Response.Redirect("/login.aspx");
      }
      else
      {
        DeleteGoBack();
        NewRepNotes.UsePagedDataSource=true;
        NewRepNotes.PageSize=UC.PagingSize;

        if (!Page.IsPostBack)
        {
          FillRep();
        }


      }
      BtnSearch.Text =Root.rm.GetString("Notetxt4");
    }

    private void FillRep()
    {
      string sqlString = "SELECT BASE_NOTES.*,(ACCOUNT.SURNAME+' '+ACCOUNT.NAME) AS OWNER FROM BASE_NOTES LEFT OUTER JOIN ACCOUNT ON BASE_NOTES.OWNERID = ACCOUNT.UID ";

      string qGroup = GroupsSecure("BASE_NOTES.GROUPS");
      sqlString += "WHERE ((" + qGroup + ") OR BASE_NOTES.OWNERID=" + UC.UserId.ToString() + ") ORDER BY BASE_NOTES.CREATEDDATE DESC";

      NewRepNotes.UsePagedDataSource=true;
      NewRepNotes.PageSize=UC.PagingSize;
      NewRepNotes.sqlDataSource=sqlString.ToString();
      NewRepNotes.DataBind();


    }

    protected void ItemDataBound_Repeater(Object sender, RepeaterItemEventArgs e)
    {
      switch (e.Item.ItemType)
      {
        case ListItemType.Item:
        case ListItemType.AlternatingItem:
          HtmlContainerControl ViewText = (HtmlContainerControl) e.Item.FindControl("ViewText");
          ViewText.Visible = false;
          break;
      }
    }

    protected void ItemCommandRep(Object sender, RepeaterCommandEventArgs e)
    {
      switch (e.CommandName)
      {
        case "MultiDeleteButton":
          DeleteChecked.MultiDelete(this.NewRepNotes.MultiDeleteListArray,"Base_notes");
          FillRep();
          break;
        case "modifyNote":
          HtmlContainerControl ViewText = (HtmlContainerControl) e.Item.FindControl("ViewText");
          if (!ViewText.Visible)
          {
            ViewText.Visible = true;
          }
          else
          {
            ViewText.Visible = false;
          }
          break;
        case "noteSubmit":
          Literal IDApp = (Literal) e.Item.FindControl("IDApp");
          TextBox AreaText = (TextBox) e.Item.FindControl("AreaText");
          DatabaseConnection.DoCommand("UPDATE BASE_NOTES SET BODY = '"+DatabaseConnection.FilterInjection(AreaText.Text)+"' WHERE ID =" + int.Parse(IDApp.Text));
          FillRep();
          break;
      }
    }


    #region Codice generato da Progettazione Web Form

    protected override void OnInit(EventArgs e)
    {
      InitializeComponent();
      base.OnInit(e);
    }

    private void InitializeComponent()
    {
      this.NewRepNotes.ItemDataBound+=new RepeaterItemEventHandler(this.ItemDataBound_Repeater);
      this.NewRepNotes.ItemCommand += new RepeaterCommandEventHandler(this.ItemCommandRep);
            this.Load += new EventHandler(this.Page_Load);
    }

    #endregion

    protected void BtnSearch_Click(object sender, EventArgs e)
    {
      string sqlString = "SELECT BASE_NOTES.*,(ACCOUNT.SURNAME+' '+ACCOUNT.NAME) AS OWNER FROM BASE_NOTES LEFT OUTER JOIN ACCOUNT ON BASE_NOTES.OWNERID = ACCOUNT.UID ";
      string qGroup = GroupsSecure("BASE_NOTES.GROUPS");
      sqlString += "WHERE ((" + qGroup + ") OR BASE_NOTES.OWNERID=" + UC.UserId + ")";
      DeleteGoBack(true);
    }
  }


}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.