Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string query = Request.Params["q"].ToString();

        DataSource2.SelectCommand = "select Id,Gen_stire from Categorie where Id=" + query;
        DataSource2.DataBind();

        if (!Page.IsPostBack && Request.Params["q"] != null && Request.Params["p"] == null)
        {
            DataSource1.SelectCommand = "select Id,Gen_stire,Titlu,Descriere,Autor,Data,Imagine,Catchphrase from Stiri where Gen_stire=" + query;
            DataSource1.DataBind();
        }

        if (!Page.IsPostBack && Request.Params["q"] != null && Request.Params["p"] != null)
        {
            string query1 = Request.Params["p"].ToString();


            if (query1 != "Data1")
            {
                DataSource1.SelectCommand = "select Id, Titlu, Descriere, Autor, Data, Imagine, Catchphrase from Stiri where Gen_stire=" + query + " order by " + query1;
                DataSource1.DataBind();
            }
            else
            {
                DataSource1.SelectCommand = "select Id, Titlu, Descriere, Autor, Data, Imagine, Catchphrase from Stiri where Gen_stire=" + query + " order by Data desc";
                DataSource1.DataBind();
            }
        }
    }
Exemplo n.º 2
0
        protected void Page_Init(object sender, EventArgs e)
        {
            var o = new CustomObject();

            o.Properties.Add(new CustomPropertyDescriptor(
                                 "SomeString",
                                 typeof(string),
                                 null,
                                 "Hello"));

            o.Properties.Add(new CustomPropertyDescriptor(
                                 "SomeInt",
                                 typeof(int),
                                 new Attribute[] {
                new RangeAttribute(0, 100)
            },
                                 34));

            o.Properties.Add(new CustomPropertyDescriptor(
                                 "SomeDate",
                                 typeof(DateTime),
                                 new Attribute[] {
                new DataTypeAttribute(DataType.Date)
            },
                                 DateTime.Now));

            DataSource1.SetDataObject(o, DetailsView1);
            DataSource1.Complete += new EventHandler <SimpleDynamicDataSourceCompleteEventArgs>(LinqDataSource1_Complete);
        }
Exemplo n.º 3
0
        protected void Page_Init(object sender, EventArgs e)
        {
            var o = new MyTestClass()
            {
                MyString = "Hello", MyInteger = 45, MySecondInteger = 101, MyDateTime = DateTime.Now
            };

            DataSource1.SetDataObject(o, DetailsView1);
            DataSource1.Complete += new EventHandler <SimpleDynamicDataSourceCompleteEventArgs>(LinqDataSource1_Complete);
        }
    private void PrepareReportPreview()
    {
        ASPxSchedulerControlPrintAdapter1.TimeInterval = new TimeInterval(DateTime.Today, DateTime.Today.AddDays(7));
        ASPxSchedulerControlPrintAdapter1.WorkTime     = new TimeOfDayInterval(TimeSpan.FromHours(9), TimeSpan.FromHours(18));

        DataHelper.SetupMappings(ASPxScheduler1);
        DataHelper.ProvideRowInsertion(ASPxScheduler1, DataSource1.AppointmentDataSource);
        DataSource1.AttachTo(ASPxScheduler1);

        ASPxSchedulerControlPrintAdapter1.SchedulerControl = ASPxScheduler1;
    }
Exemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DataHelper.SetupMappings(ASPxScheduler1);
        DataHelper.ProvideRowInsertion(ASPxScheduler1, DataSource1.AppointmentDataSource);
        DataSource1.AttachTo(ASPxScheduler1);

        if (!IsPostBack)
        {
            ASPxScheduler1.Start = DateTime.Today;
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.edtStart.Date = new DateTime(2008, 8, 22, 8, 0, 0);
         this.edtEnd.Date   = new DateTime(2008, 8, 22, 9, 0, 0);
     }
     DataHelper.SetupMappings(ASPxScheduler1);
     DataHelper.ProvideRowInsertion(ASPxScheduler1, DataSource1.AppointmentDataSource);
     DataSource1.AttachTo(ASPxScheduler1);
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        DataHelper.SetupMappings(ASPxScheduler1);
        DataHelper.ProvideRowInsertion(ASPxScheduler1, DataSource1.AppointmentDataSource);
        DataSource1.AttachTo(ASPxScheduler1);

        ASPxScheduler1.DayView.ResourcesPerPage             = 3;
        ASPxScheduler1.DayView.DayCount                     = 2;
        ASPxScheduler1.DayView.Styles.ScrollAreaHeight      = 450;
        ASPxScheduler1.WorkWeekView.ResourcesPerPage        = 1;
        ASPxScheduler1.WorkWeekView.Styles.ScrollAreaHeight = 450;
        ASPxScheduler1.WeekView.ResourcesPerPage            = 2;
        ASPxScheduler1.MonthView.ResourcesPerPage           = 2;
        ASPxScheduler1.TimelineView.ResourcesPerPage        = 3;
        ASPxScheduler1.TimelineView.AppointmentDisplayOptions.AppointmentAutoHeight = true;
        ASPxScheduler1.TimelineView.AppointmentDisplayOptions.TimeDisplayType       = AppointmentTimeDisplayType.Text;
        ASPxScheduler1.Start = DateTime.Now;
    }
    public void BindData()
    {
        var username = HttpContext.Current.User.Identity.Name;

        var user = _db.t_Users.SingleOrDefault(s => s.Username == username);

        if (user != null)
        {
            if (user.Role.ToLower() == "staff")
            {
                ListView1.DataSource = DataSource1;
                DataSource1.DataBind();
            }
            if (user.Role.ToLower() == "consumer")
            {
                ListView1.DataSource = DataSource2;
                DataSource2.DataBind();
            }
        }

        ListView1.DataBind();
    }
Exemplo n.º 9
0
 protected void Timer1_Tick(object sender, EventArgs e)
 {
     DataSource1.DataBind();
     ListView1.DataBind();
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     DataHelper.SetupMappings(ASPxScheduler1);
     DataHelper.ProvideRowInsertion(ASPxScheduler1, DataSource1.AppointmentDataSource);
     DataSource1.AttachTo(ASPxScheduler1);
 }