Пример #1
0
        private void dgKeys_UpdateCommand(object source, DataGridCommandEventArgs e)
        {
            TextBox tbName      = (TextBox)e.Item.FindControl("tbName");
            int     location_id = Int32.Parse(e.Item.Cells[0].Text);
            int     theReturn   = new keyData().UpdateLocation(location_id, tbName.Text);

            dgKeys.ItemUpdated(location_id);
            dgKeys.EditItemIndex = -1;
            ShowList();
        }
Пример #2
0
        //list support functions
        private void dgKeys_DeleteCommand(object sender, DataGridCommandEventArgs e)
        {
            //ListReport.Delete(Int32.Parse(e.Item.Cells[0].Text));
            //DelLocation
            int location_id = Int32.Parse(e.Item.Cells[0].Text);
            int theReturn   = new keyData().DelLocation(location_id);

            dgKeys.ItemUpdated(location_id);
            dgKeys.EditItemIndex = -1;
            ShowList();
        }
Пример #3
0
        private void ShowList()
        {
            DataTable DataSource = null;
            //CategoryEnable = (ddlReportCategory.Items.Count > 1);
            //CategoryEnable = false;
            //int listcategoryid = (CategoryEnable ? Int32.Parse(ddlReportCategory.SelectedValue.ToString()) : -1);
            //EditEnabled = CurrentModule.Permissions.Allowed(OperationType.Edit, CurrentUser);
            bool EditEnabled = true;

            //dgKeys.Columns[4].Visible = CategoryEnable;

            //get the DataSource
            //DataSource = new ListData().GetPublicReports(ArenaContext.Current.Organization.OrganizationID, listcategoryid, CurrentPerson.PersonID);
            if (String.IsNullOrEmpty(Request["DoorID"]) && String.IsNullOrEmpty(Request["UserID"]))
            {
                DataSource = new keyData().GetKeys();
            }
            else if (!String.IsNullOrEmpty(Request["DoorID"]) && String.IsNullOrEmpty(Request["UserID"]))
            {
                DataSource = new keyData().GetKeysByDoor(Int32.Parse(Request["DoorID"]));
            }
            else if (String.IsNullOrEmpty(Request["DoorID"]) && !String.IsNullOrEmpty(Request["UserID"]))
            {
                DataSource = new keyData().GetKeysByPerson(Int32.Parse(Request["UserID"]));
            }
            else
            {
                DataSource = new keyData().GetKeysByPersonDoor(Int32.Parse(Request["UserID"]), Int32.Parse(Request["DoorID"]));
            }

            dgKeys.Columns[5].Visible = true;

            dgKeys.Visible            = true;
            dgKeys.ItemType           = "List";
            dgKeys.ItemBgColor        = CurrentPortalPage.Setting("ItemBgColor", string.Empty, false);
            dgKeys.ItemAltBgColor     = CurrentPortalPage.Setting("ItemAltBgColor", string.Empty, false);
            dgKeys.ItemMouseOverColor = CurrentPortalPage.Setting("ItemMouseOverColor", string.Empty, false);
            dgKeys.AddEnabled         = false;
            dgKeys.AddImageUrl        = "~/images/add_list.gif";
            dgKeys.MoveEnabled        = false;
            dgKeys.DeleteEnabled      = EditEnabled;
            dgKeys.EditEnabled        = EditEnabled;
            dgKeys.MergeEnabled       = false;
            dgKeys.MailEnabled        = false;
            dgKeys.ExportEnabled      = false;
            dgKeys.AllowSorting       = true;
            dgKeys.DataSource         = DataSource;
            dgKeys.DataBind();

            dgKeys.Visible = true;
            lbAdd.Visible  = true;
        }
Пример #4
0
        protected void imgBtnAddRpt_Click(object sender, EventArgs e)
        {
            int newLocation = new keyData().AddBlankLocation();

            ShowList();

            /*
             * if (ddlSelectReport.SelectedValue.ToString() == "2")
             *  Response.Redirect(string.Format("default.aspx?page={0}&reportid=-1", AdvanceListWizardPageIDSetting));
             * else
             *  Response.Redirect(string.Format("default.aspx?page={0}&reportid=-1", ListReportWizardPageIDSetting));
             */
        }