Esempio n. 1
0
        protected override void OnPreRender(EventArgs e)
        {
            if (classID != 0)
            {
                editClass = new DojoClass(classID);
                Text      = "Delete - " + editClass.ToString();
            }
            else
            {
                Text = "Delete Class";
            }

            //
            // Detect class and class definition relations and issue error.
            //
            string          connectionString = Amns.GreyFox.Data.ManagerCore.GetInstance().ConnectionString;
            OleDbConnection dbConnection     = new OleDbConnection(connectionString);
            OleDbCommand    dbCommand        = new OleDbCommand();

            dbCommand.Connection = dbConnection;
            dbConnection.Open();

            //
            // Check relations for deletion errors.
            //
            dbCommand.CommandText = "SELECT COUNT(*) FROM kitTessen_Attendance WHERE ClassID=" +
                                    classID.ToString() + ";";
            if ((int)dbCommand.ExecuteScalar() > 0)
            {
                attendanceWarning = true;
            }
            dbConnection.Close();

//			btOk.Enabled = !attendanceWarning;
        }
Esempio n. 2
0
        protected override void RenderContent(HtmlTextWriter output)
        {
            if (dojoClassID == 0)
            {
                output.WriteFullBeginTag("tr");
                output.WriteBeginTag("td");
                output.WriteAttribute("class", "row1");
                output.WriteAttribute("colspan", "2");
                output.Write(HtmlTextWriter.TagRightChar);

                output.Write("The DojoClass selected does not exist.");

                output.WriteEndTag("td");
                output.WriteEndTag("tr");
                return;
            }

            output.WriteFullBeginTag("tr");
            output.WriteBeginTag("td");
            output.WriteAttribute("class", "row1");
            output.WriteAttribute("colspan", "2");
            output.Write(HtmlTextWriter.TagRightChar);

            output.Write("<strong>Warning:</strong> This action deletes the selected ." +
                         "<em>Use with caution, this option cannot be undone.</em>");

            output.WriteEndTag("td");
            output.WriteEndTag("tr");

            output.WriteFullBeginTag("tr");
            output.WriteBeginTag("td");
            output.WriteAttribute("class", "row1");
            output.WriteAttribute("nowrap", "true");
            output.WriteAttribute("valign", "top");
            output.Write(HtmlTextWriter.TagRightChar);
            output.Write(" to delete: ");
            output.WriteEndTag("td");
            output.WriteBeginTag("td");
            output.WriteAttribute("class", "row1");
            output.WriteAttribute("width", "100%");
            output.Write(HtmlTextWriter.TagRightChar);
            output.Write(dojoClass.ToString());
            output.WriteEndTag("td");
            output.WriteEndTag("tr");

            output.WriteFullBeginTag("tr");
            output.WriteBeginTag("td");
            output.WriteAttribute("colspan", "2");
            output.WriteAttribute("align", "right");
            output.WriteAttribute("class", "row1");
            output.Write(HtmlTextWriter.TagRightChar);
            btOk.RenderControl(output);
            output.Write("&nbsp;");
            btCancel.RenderControl(output);
            output.WriteEndTag("td");
            output.WriteEndTag("tr");
        }
Esempio n. 3
0
 protected override void OnPreRender(EventArgs e)
 {
     if (dojoClassID != 0)
     {
         dojoClass = new DojoClass(dojoClassID);
         text      = "Delete - " + dojoClass.ToString();
     }
     else
     {
         text = "Delete ";
     }
     EnsureWindowScripts();
 }
Esempio n. 4
0
        protected override void OnPreRender(EventArgs e)
        {
            if (loadFlag)
            {
                if (dojoClassID > 0)
                {
                    obj             = new DojoClass(dojoClassID);
                    headerText.Text = "Edit  - " + obj.ToString();
                }
                else if (dojoClassID <= 0)
                {
                    obj             = new DojoClass();
                    headerText.Text = "Add ";
                }

                // Bind Default Data
                tbName.Text = obj.Name;
                if (obj.Instructor != null)
                {
                    foreach (ComboBoxItem item in comboInstructor.Items)
                    {
                        item.Selected = obj.Instructor.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    comboInstructor.SelectedIndex = 0;
                }
                if (obj.ParentSeminar != null)
                {
                    foreach (ComboBoxItem item in comboParentSeminar.Items)
                    {
                        item.Selected = obj.ParentSeminar.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    comboParentSeminar.SelectedIndex = 0;
                }
                if (obj.ParentDefinition != null)
                {
                    foreach (ComboBoxItem item in comboParentDefinition.Items)
                    {
                        item.Selected = obj.ParentDefinition.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    comboParentDefinition.SelectedIndex = 0;
                }
                if (obj.Location != null)
                {
                    foreach (ComboBoxItem item in comboLocation.Items)
                    {
                        item.Selected = obj.Location.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    comboLocation.SelectedIndex = 0;
                }
                if (obj.AccessControlGroup != null)
                {
                    foreach (ComboBoxItem item in comboAccessControlGroup.Items)
                    {
                        item.Selected = obj.AccessControlGroup.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    comboAccessControlGroup.SelectedIndex = 0;
                }

                // Bind Occupancy Data
                tbOccupancyMax.Text       = obj.OccupancyMax.ToString();
                tbOccupancyTarget.Text    = obj.OccupancyTarget.ToString();
                tbOccupancyCurrent.Text   = obj.OccupancyCurrent.ToString();
                tbOccupancyCheckDate.Text = obj.OccupancyCheckDate.ToString();

                // Bind Schedule Data
                tbSigninStart.Text   = obj.SigninStart.ToString();
                tbSigninEnd.Text     = obj.SigninEnd.ToString();
                tbClassStart.Text    = obj.ClassStart.ToString();
                tbClassEnd.Text      = obj.ClassEnd.ToString();
                tabstrip.SelectedTab = tabstrip.Tabs[0];
            }
        }
Esempio n. 5
0
        protected override void OnPreRender(EventArgs e)
        {
            if (loadFlag)
            {
                if (dojoClassID > 0)
                {
                    obj  = new DojoClass(dojoClassID);
                    text = "Edit  - " + obj.ToString();
                }
                else if (dojoClassID <= 0)
                {
                    obj  = new DojoClass();
                    text = "Add ";
                }

                //
                // Set Field Entries
                //
                tbName.Text               = obj.Name;
                tbOccupancyMax.Text       = obj.OccupancyMax.ToString();
                tbOccupancyTarget.Text    = obj.OccupancyTarget.ToString();
                tbOccupancyCurrent.Text   = obj.OccupancyCurrent.ToString();
                tbOccupancyCheckDate.Text = obj.OccupancyCheckDate.ToString();
                tbSigninStart.Text        = obj.SigninStart.ToString();
                tbSigninEnd.Text          = obj.SigninEnd.ToString();
                tbClassStart.Text         = obj.ClassStart.ToString();
                tbClassEnd.Text           = obj.ClassEnd.ToString();

                //
                // Set Children Selections
                //
                if (obj.Instructor != null)
                {
                    foreach (ListItem item in msInstructor.Items)
                    {
                        item.Selected = obj.Instructor.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    msInstructor.SelectedIndex = 0;
                }

                if (obj.ParentSeminar != null)
                {
                    foreach (ListItem item in msParentSeminar.Items)
                    {
                        item.Selected = obj.ParentSeminar.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    msParentSeminar.SelectedIndex = 0;
                }

                if (obj.ParentDefinition != null)
                {
                    foreach (ListItem item in msParentDefinition.Items)
                    {
                        item.Selected = obj.ParentDefinition.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    msParentDefinition.SelectedIndex = 0;
                }

                if (obj.Location != null)
                {
                    foreach (ListItem item in msLocation.Items)
                    {
                        item.Selected = obj.Location.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    msLocation.SelectedIndex = 0;
                }

                if (obj.AccessControlGroup != null)
                {
                    foreach (ListItem item in msAccessControlGroup.Items)
                    {
                        item.Selected = obj.AccessControlGroup.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    msAccessControlGroup.SelectedIndex = 0;
                }
            }
        }
Esempio n. 6
0
        protected override void OnPreRender(EventArgs e)
        {
            if (dojoClassID != 0)
            {
                dojoClass = new DojoClass(dojoClassID);

                #region Bind Default Folder

                //
                // Set Field Entries
                //

                ltName.Text = dojoClass.Name.ToString();

                //
                // Set Children Selections
                //

                // Instructor

                if (dojoClass.Instructor != null)
                {
                    ltInstructor.Text = dojoClass.Instructor.ToString();
                }
                else
                {
                    ltInstructor.Text = string.Empty;
                }

                // ParentSeminar

                if (dojoClass.ParentSeminar != null)
                {
                    ltParentSeminar.Text = dojoClass.ParentSeminar.ToString();
                }
                else
                {
                    ltParentSeminar.Text = string.Empty;
                }

                // ParentDefinition

                if (dojoClass.ParentDefinition != null)
                {
                    ltParentDefinition.Text = dojoClass.ParentDefinition.ToString();
                }
                else
                {
                    ltParentDefinition.Text = string.Empty;
                }

                // Location

                if (dojoClass.Location != null)
                {
                    ltLocation.Text = dojoClass.Location.ToString();
                }
                else
                {
                    ltLocation.Text = string.Empty;
                }

                // AccessControlGroup

                if (dojoClass.AccessControlGroup != null)
                {
                    ltAccessControlGroup.Text = dojoClass.AccessControlGroup.ToString();
                }
                else
                {
                    ltAccessControlGroup.Text = string.Empty;
                }


                #endregion

                #region Bind Occupancy Folder

                //
                // Set Field Entries
                //

                ltOccupancyMax.Text       = dojoClass.OccupancyMax.ToString();
                ltOccupancyTarget.Text    = dojoClass.OccupancyTarget.ToString();
                ltOccupancyCurrent.Text   = dojoClass.OccupancyCurrent.ToString();
                ltOccupancyCheckDate.Text = dojoClass.OccupancyCheckDate.ToString();

                //
                // Set Children Selections
                //


                #endregion

                #region Bind _system Folder

                //
                // Set Field Entries
                //


                //
                // Set Children Selections
                //


                #endregion

                #region Bind Schedule Folder

                //
                // Set Field Entries
                //

                ltSigninStart.Text = dojoClass.SigninStart.ToString();
                ltSigninEnd.Text   = dojoClass.SigninEnd.ToString();
                ltClassStart.Text  = dojoClass.ClassStart.ToString();
                ltClassEnd.Text    = dojoClass.ClassEnd.ToString();

                //
                // Set Children Selections
                //


                #endregion

                text = "View  - " + dojoClass.ToString();
            }
        }