protected void Page_Load(object sender, EventArgs e)
        {


            if (!AllowAccess(Common.Names._ASR_SystemAdmin))
            {
                UnauthorizedPageAccess();
            }

            
                string qsValue = Request.QueryString[Common.Names._QS_ITAT_SYSTEM_ID];
                //ASSUMPTION: 
                //   If qsValue is of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx or {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}, 
                //           then it is a systemID.
                //   Otherwise, it is the system name.
                if (qsValue!=null)
                {
                    if (Utility.TextHelper.IsGuid(qsValue))
                        _itatSystem = Business.ITATSystem.Get(new Guid(qsValue));
                    else
                        _itatSystem = Business.ITATSystem.Get(qsValue);
                }
                else
                {
                    _itatSystem = null;
                }

            

            if (!IsPostBack)
            {
                DataSet ds = Business.ITATSystem.GetSystemList();

                if (_itatSystem != null)
                {
                    Helper.LoadListControl(ddlSystem, ds, "ITATSystemName", "ITATSystemID", _itatSystem.ID.ToString(), true, "(Select a System)", "");
                    ddlSystemOnSelectedIndexChanged(this, e);
                }
                else
                    Helper.LoadListControl(ddlSystem, ds, "ITATSystemName", "ITATSystemID", "", true, "(Select a System)", "");
                
            }

        }
Ejemplo n.º 2
0
		protected override void GetITATSystem()
		{
			string qsValue = Request.QueryString[Common.Names._QS_ITAT_SYSTEM_ID];
			//ASSUMPTION: 
			//   If qsValue is of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx or {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}, 
			//           then it is a systemID.
			//   Otherwise, it is the system name.
			if (Utility.TextHelper.IsGuid(qsValue))
				_itatSystem = Business.ITATSystem.Get(new Guid(qsValue));
			else
				_itatSystem = Business.ITATSystem.Get(qsValue);
		}
Ejemplo n.º 3
0
		protected override void LoadViewState(object savedState)
		{
			base.LoadViewState(savedState);
			//retrieve system name from ViewState, and get the corresponding ITATSystem object (from Cache or database)
			Guid systemID = (Guid)ViewState[VSKEY_SYSTEMID];
			_itatSystem = Business.ITATSystem.Get(systemID);
//			_securityHelper= (Business.SecurityHelper)ViewState[VSKEY_SECURITYHELPER];
		}
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.QueryString[Common.Names._QS_DEFINITION_ID].ToString() != string.Empty)
                {
                    try
                    {
                        Dictionary<Guid, Dictionary<Guid, string>> termNameLookup = null;
                        Dictionary<Guid /*TemplateID*/, Dictionary<Guid /*ComplexListID*/, Dictionary<Guid /*FieldID*/, string /*FieldName*/>>> fieldNameLookup = null;
                        SystemStore.GetTermAndFieldNameLookup(_itatSystem.ID, ref termNameLookup, ref fieldNameLookup);
                        _dataStoreDefinition = Business.DataStoreDefinition.GetDataStoreDefinitionByID(new Guid(Request.QueryString[Common.Names._QS_DEFINITION_ID].ToString()), _itatSystem, termNameLookup, fieldNameLookup, false);
                    }
                    catch (Exception ex)
                    {
                        RegisterAlert(string.Format("Error: {0}",ex.Message));
                    }
                }

                if (_dataStoreDefinition == null)
                {
                    RegisterAlert("Data Store Definition does not exists");
                }
                else
                {
                    DisplayTerm1 = true;
                    DisplayTerm2 = true;
                    DisplayTerm3 = false;
                    DisplayTerm4 = true;
                    DisplayTerm5 = true;
                    DisplayTerm6 = false;
                    DisplayTerm7 = false;
                    searchControl = LoadControl("~\\Controls\\SearchControl.ascx", base._itatSystem, DisplayTerm1, DisplayTerm2, DisplayTerm3, DisplayTerm4, DisplayTerm5, DisplayTerm6,DisplayTerm7, _dataStoreDefinition.DataStoreConfig.SearchCriteria);
                    searchControl.ID = "MySearchControl";

                    apnlCriteria.Controls.Add(searchControl);
                    _itatsystem = Business.ITATSystem.Get(_dataStoreDefinition.SystemID);

                    LoadStatusList();

                    lblSystemName.Text = Business.ITATSystem.Get(_dataStoreDefinition.SystemID).Name;
                    lblDefinitionName.Text = _dataStoreDefinition.Name;
                    txtDescription.Text = _dataStoreDefinition.Description;

                    ddlDefaultDateFormat.DataSource = DataStoreDefinition.GetDateFormatList();
                    ddlDefaultDateFormat.DataBind();

                    ddlDefaultDateFormat.SelectedIndex = ddlDefaultDateFormat.Items.IndexOf(new ListItem(_dataStoreDefinition.DataStoreConfig.DefaultDateFormat));

                    LoadTemplateList(_dataStoreDefinition.SystemID);
                    string errSelectedTemplates = "";
                    foreach (KeyValuePair<Guid, string> template in _dataStoreDefinition.DataStoreConfig.Templates)
                    {

                        if (!lstTemplates.Items.Contains(new ListItem(template.Value, template.Key.ToString())))
                            errSelectedTemplates = errSelectedTemplates + string.Format("- {0} \\n", template.Value.ToString());
                        else
                        {
                            lstTemplates.Items.Remove(new ListItem(template.Value, template.Key.ToString()));
                            lstSelectedTemplates.Items.Add(new ListItem(template.Value, template.Key.ToString()));
                        }
                    }

                    if (errSelectedTemplates.Length > 0)
                        RegisterAlert("Following selected Template(s) are no longer Active \\n" + errSelectedTemplates);

                    SelectedTerms = _dataStoreDefinition.DataStoreConfig.Terms;

                    LoadTermList();
                    SortlistItems(lstTemplates);
                    MoveTerm(SelectedTerms);


                    if (_dataStoreDefinition.Active)
                        radActiveYes.Checked = true;
                    else
                        radActiveNo.Checked = true;

                    foreach (ListItem li in chklstStatus.Items)
                    {
                        if (_dataStoreDefinition.DataStoreConfig.SearchCriteria.Statuses.IndexOf(li.Text) > -1)
                            li.Selected = true;
                        else
                            li.Selected = false;
                    }

                    foreach (string status in _dataStoreDefinition.DataStoreConfig.SearchCriteria.Statuses)
                    {
                        chklstStatus.Items.FindByText(status).Selected = true;
                    }
                    radTypeDelta.Checked = _dataStoreDefinition.DataStoreConfig.LoadType == LoadType.Delta;
                    txtDeltaDays.Text = _dataStoreDefinition.DataStoreConfig.DeltaDays.ToString();
                    txtPath.Text = _dataStoreDefinition.DataStoreConfig.Path;
                    txtEmail.Text = _dataStoreDefinition.DataStoreConfig.ErrorLogRecepientEmail;
                }

                btnRemoveTerm.OnClientClick = string.Format("return confirm('All the selected Terms will be removed from the list.');");

                btnRemoveTemplate.OnClientClick = string.Format("return confirm('All the selected Terms from the selected Templates also removed by removing Templates.');");
            }
        }