Пример #1
0
        protected void uiDropDownListPackages_SelectedIndexChanged(object sender, EventArgs e)
        {
            uiCheckBoxListPackageOptions.ClearSelection();
            PackageOptionsLink options = new PackageOptionsLink();
            options.GetPackageOptionsLinksByPackageID(Convert.ToInt32(uiDropDownListPackages.SelectedValue));
            for (int i = 0; i < options.RowCount; i++)
            {
                foreach (ListItem item in uiCheckBoxListPackageOptions.Items)
                {
                    if (item.Value == options.PackageOptionID.ToString())
                    {
                        item.Selected = true;
                        break;
                    }

                }
                options.MoveNext();
            }
        }
Пример #2
0
        protected void uiGridViewPackages_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "EditPackage")
            {
                Packages objData = new Packages();
                objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
                uiTextBoxEnName.Text = objData.EnName;
                uiTextBoxArName.Text = objData.ArName;
                uiTextBoxEnDesc.Text = objData.EnDescription;
                uiTextBoxArDesc.Text = objData.ArDescription;

                PackageOptionsLink options = new PackageOptionsLink ();
                options.GetPackageOptionsLinksByPackageID(objData.PackageID);
                for (int i = 0; i < options.RowCount; i++)
                {
                    foreach (ListItem item in uiCheckBoxListPackageOptions.Items)
                    {
                        if (item.Value == options.PackageOptionID.ToString())
                        {
                            item.Selected = true;
                            break;
                        }

                    }
                    options.MoveNext();
                }

                uiPanelViewPackages.Visible = false;
                uiPanelEdit.Visible = true;
                CurrentPackage = objData;
            }
            else if (e.CommandName == "DeletePackage")
            {
                Packages objData = new Packages();
                objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
                objData.MarkAsDeleted();
                objData.Save();
                CurrentPackage = null;
                BindData();
            }
        }