Beispiel #1
0
    /// <summary>
    /// Handles the Click event of the cmdMatch control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void cmdMatch_Click(object sender, EventArgs e)
    {
        //Get the selected record from the 'source' datagrid
        if (String.IsNullOrEmpty(txtMatchFromRowIndx.Value) || String.IsNullOrEmpty(txtMatchToRowIndx.Value))
        {
            DialogService.ShowMessage(GetLocalResourceObject("error_NoSourceTargetSelected").ToString(), "SalesLogix");
            return;
        }
        int    sourceSelIdx = Convert.ToInt32(txtMatchFromRowIndx.Value) - 1;
        int    targetSelIdx = Convert.ToInt32(txtMatchToRowIndx.Value) - 1;
        string sourceField  = grdSource.DataKeys[sourceSelIdx].Values[0].ToString();
        string targetField  = grdTarget.DataKeys[targetSelIdx].Values[0].ToString();

        ImportManager importManager = Page.Session["importManager"] as ImportManager;

        importManager.RemoveImportMap(sourceField); //Remove before we add
        importManager.AddImportMap(sourceField, targetField);
        Page.Session["importManager"] = importManager;
        txtMatchFromRowIndx.Value     = String.Empty;
        txtMatchToRowIndx.Value       = String.Empty;
    }