Example #1
0
        /// <summary>
        /// Handles the InsertCommand event of the RegionsGrid control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ComponentArt.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
        void RegionsGrid_InsertCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
        {
            string name = e.Item[_GridStateProvinceNameString].ToString();

            if (_Country != null)
            {
                CountryDto.StateProvinceRow spRow = null;

                CountryDto.StateProvinceRow[] spRows = (CountryDto.StateProvinceRow[])_Country.StateProvince.Select(String.Format("Name='{0}'", name));
                if (spRows == null || spRows.Length == 0)
                {
                    spRow           = _Country.StateProvince.NewStateProvinceRow();
                    spRow.CountryId = CountryId;
                }
                else
                {
                    spRow = spRows[0];
                }

                spRow.Name     = name;
                spRow.Ordering = Int32.Parse(e.Item[_GridOrderingString].ToString());
                spRow.Visible  = Boolean.Parse(e.Item[_GridVisibleString].ToString());

                if (spRow.RowState == DataRowState.Detached)
                {
                    _Country.StateProvince.Rows.Add(spRow);
                }
            }
        }
        /// <summary>
        /// Handles the DeleteCommand event of the ShipmentList control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ComponentArt.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
        void ShipmentList_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
        {
            GridItem item = e.Item;
            int      id   = 0;

            if (item["ShipmentId"] != null && Int32.TryParse(item["ShipmentId"].ToString(), out id))
            {
                // find the existing one
                foreach (Shipment shipment in _order.OrderForms[0].Shipments)
                {
                    if (shipment.ShipmentId == id)
                    {
                        StringCollection shipmentLineItems = shipment.LineItemIndexes;
                        shipment.Delete();

                        // update all lineitems that were associated with this shipment
                        foreach (LineItem li in _order.OrderForms[0].LineItems)
                        {
                            if (shipmentLineItems.Contains(li.LineItemId.ToString()))
                            {
                                li.ShippingAddressId  = String.Empty;
                                li.ShippingMethodId   = Guid.Empty;
                                li.ShippingMethodName = String.Empty;
                            }
                        }
                    }
                }
            }
            //_removedItems.Add(e.Item);
        }
Example #3
0
        /// <summary>
        /// Handles the DeleteCommand event of the LineItemsGrid control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ComponentArt.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
        void LineItemsGrid_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
        {
            int id = 0;

            if (e.Item[_LineItemIdString] != null && Int32.TryParse(e.Item[_LineItemIdString].ToString(), out id))
            {
                // find the existing one
                foreach (LineItem litem in GetLineItems(_order))
                {
                    if (litem.LineItemId == id)
                    {
                        litem.Delete();

                        // remove this lineItem from all shipments
                        foreach (Shipment shipment in _order.OrderForms[0].Shipments)
                        {
                            if (shipment.LineItemIndexes.Contains(id.ToString()))
                            {
                                shipment.LineItemIndexes.Remove(id.ToString());
                            }
                        }
                    }
                }
            }
            //_removedItems.Add(e.Item);
        }
Example #4
0
        private void Grid1_UpdateCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
        {
            GridItem theitem = e.Item;
            int      idRow   = int.Parse(theitem["c_id"] as string);

            ITcodeDictionary engine = new ITcodeDictionary(HELPERS.NewOdbcConn());

            engine.SetTcodeDescription(idRow, theitem["c_u_Description"] as string);
        }
Example #5
0
        protected void gdRoles_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
        {
            // Delete the gallery server role. This includes the Gallery Server role and the corresponding ASP.NET role.
            // If an exception is thrown, such as during ValidateDeleteUser(), the client side function
            // gdUsers_CallbackError will catch it and display the message to the user.
            this.CheckUserSecurity(SecurityActions.AdministerSite);

            string roleName = e.Item["RoleName"].ToString();

            RoleController.DeleteGalleryServerProRole(roleName);
        }
Example #6
0
        /// <summary>
        /// Handles the DeleteCommand event of the DefaultGrid control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ComponentArt.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
        void DefaultGrid_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
        {
            foreach (GridItem item in _addedItems)
            {
                if (_addedItems.Contains(item))
                {
                    _addedItems.Remove(item);
                }
            }

            _removedItems.Add(e.Item);
        }
Example #7
0
        /// <summary>
        /// Handles the DeleteCommand event of the RegionsGrid control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ComponentArt.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
        void RegionsGrid_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
        {
            string name = e.Item[_GridStateProvinceNameString].ToString();

            if (_Country != null)
            {
                CountryDto.StateProvinceRow[] spRows = (CountryDto.StateProvinceRow[])_Country.StateProvince.Select(String.Format("Name='{0}'", name));
                if (spRows != null && spRows.Length > 0)
                {
                    spRows[0].Delete();
                }
            }
        }
        /// <summary>
        /// Handles the DeleteCommand event of the AssociationItemsGrid control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ComponentArt.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
        void AssociationItemsGrid_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
        {
            int id      = Int32.Parse(e.Item[_CatalogAssociationIdString].ToString());
            int entryId = Int32.Parse(e.Item[_CatalogEntryIdString].ToString());

            if (CurrentCatalogAssociationDto != null)
            {
                CatalogAssociationDto.CatalogEntryAssociationRow entryRow = CurrentCatalogAssociationDto.CatalogEntryAssociation.FindByCatalogAssociationIdCatalogEntryId(id, entryId);
                if (entryRow != null)
                {
                    entryRow.Delete();
                }
            }
        }
Example #9
0
        public void Grid1_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
        {
            int idTassToDel = int.Parse(e.Item["c_id"].ToString());

            try
            {
                IEntitlement engine = new IEntitlement(HELPERS.NewOdbcConn());
                engine.DeleteEntitlement(idTassToDel);
            }
            catch (Exception exxx)
            {
                throw new Exception("Deletion failed - this entitlement is in use in an assignment in at least one workspace.");
            }
        }
Example #10
0
        /// <summary>
        /// Handles the DeleteCommand event of the DefaultGrid control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ComponentArt.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
        void DefaultGrid_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
        {
            //_removedItems.Add(e.Item);
            int id = Int32.Parse(e.Item["OrderGroupAddressId"].ToString());

            // find the existing one
            foreach (OrderAddress addr in _order.OrderAddresses)
            {
                if (addr.OrderGroupAddressId == id)
                {
                    addr.Delete();
                }
            }
        }
Example #11
0
        /// <summary>
        /// Handles the DeleteCommand event of the SiteSettingsDefaultGrid control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ComponentArt.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
        void SiteSettingsDefaultGrid_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
        {
            string key = e.Item[_gridKeyColumn].ToString();

            foreach (GridItem item in _addedItems)
            {
                if (String.Compare(item[_gridKeyColumn].ToString(), key, true) == 0)
                {
                    _addedItems.Remove(item);
                    break;
                }
            }

            _removedItems.Add(e.Item);
        }
Example #12
0
        /// <summary>
        /// Handles the InsertCommand event of the EntryRelationDefaultGrid control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ComponentArt.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
        void EntryRelationDefaultGrid_InsertCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
        {
            int id = Int32.Parse(e.Item["ID"].ToString());

            foreach (GridItem item in _removedItems)
            {
                if (Int32.Parse(item["ID"].ToString()) == id)
                {
                    _removedItems.Remove(item);
                    break;
                }
            }

            _addedItems.Add(e.Item);
        }
Example #13
0
        /// <summary>
        /// Handles the DeleteCommand event of the AssetsDefaultGrid control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ComponentArt.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
        void AssetsDefaultGrid_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
        {
            int id = Int32.Parse(e.Item["ID"].ToString());

            foreach (GridItem item in _addedItems)
            {
                if (Int32.Parse(item["ID"].ToString()) == id)
                {
                    _addedItems.Remove(item);
                    break;
                }
            }

            _removedItems.Add(e.Item);
        }
Example #14
0
        /*
         * public void OnPopulate_COMBOBOXOrgValue(object sender, ComboBoxDataRequestedEventArgs args)
         * {
         *  COMBOBOXOrgValue.Items.Clear();
         *
         *  ISAPsecurityOrgAxis engine = new ISAPsecurityOrgAxis(HELPERS.NewOdbcConn());
         *  returnListSAPsecurityOrgAxis[] ret =
         *    engine.ListSAPsecurityOrgAxis(null, "\"SAP_Name\" = ?", new string[]{args.Filter}, "");
         *  if (ret.Length == 1) {
         *      string[] legalvals = ret[0].LegalValues.Split(new char[]{','});
         *      foreach (string S in legalvals)
         *      {
         *          int baby = COMBOBOXOrgValue.Items.Add(
         *              new ComboBoxItem(S));
         *          COMBOBOXOrgValue.Items[baby].Value = S;
         *      }
         *  }
         *
         * }
         */



        private void Grid1_UpdateCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
        {
            throw new Exception("MOPVED");
            if (e.Item["IDtass"] == null)
            {
                throw new Exception("MOVED: Grid1_InsertCommand(sender, e)");
            }

            int IDtass  = Int32.Parse(e.Item["IDtass"].ToString());
            int IDentit = Int32.Parse(e.Item["IDTcodeEnt"].ToString());

            // RecordChangeToVector(IDtass, IDentit, e);

            // Now that we are scoped to a role, the only change regarding "role linkage"
            // is REMOVAL from a role's assignment.
            //RecordChangeToRoleLink(IDtass, IDentit, e);
        }
Example #15
0
        private void Grid1_UpdateCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
        {
            // UpdateCommand needs to be set to a SQL string with params
            // UpdateParameters needs to be...

            // e.Item.ToArray()[0] is the WSentitlementID number to be updated

            //Grid1.Levels[0].Columns[

            /*
             * SqlDataSource1.UpdateCommand =
             * @"
             * UPDATE t_RBSR_AUFW_u_WorkspaceEntitlement
             * */

            if (((e.Item.ToArray()[0] as string) == "") || (e.Item.ToArray()[0] == null))
            {
                Grid1_InsertCommand(sender, e);
            }
            else
            {
                _Grid_Update(e.Item.ToArray());
            }
        }
        /// <summary>
        /// Handles the InsertCommand event of the AssociationItemsGrid control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ComponentArt.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
        void AssociationItemsGrid_InsertCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
        {
            int id      = Int32.Parse(e.Item[_CatalogAssociationIdString].ToString());
            int entryId = Int32.Parse(e.Item[_CatalogEntryIdString].ToString());

            if (CurrentCatalogAssociationDto != null)
            {
                CatalogAssociationDto.CatalogEntryAssociationRow entryRow = CurrentCatalogAssociationDto.CatalogEntryAssociation.FindByCatalogAssociationIdCatalogEntryId(id, entryId);
                if (entryRow == null)
                {
                    entryRow = CurrentCatalogAssociationDto.CatalogEntryAssociation.NewCatalogEntryAssociationRow();
                    entryRow.CatalogAssociationId = id;
                    entryRow.CatalogEntryId       = entryId;
                }

                entryRow.SortOrder         = Int32.Parse(e.Item[_SortOrderString].ToString());
                entryRow.AssociationTypeId = e.Item[_AssociationTypeIdString].ToString();

                if (entryRow.RowState == DataRowState.Detached)
                {
                    CurrentCatalogAssociationDto.CatalogEntryAssociation.Rows.Add(entryRow);
                }
            }
        }
Example #17
0
 private void Grid1_SelectCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
 {
     int x = 5;
 }
Example #18
0
 private void Grid1_InsertCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
 {
     /* THIS WAS A HUGE MISTAKE AND HAS BEEN KILLED ON 27 MAR 2009 */
 }
 /// <summary>
 /// Handles the DeleteCommand event of the DefaultGrid control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="ComponentArt.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
 void DefaultGrid_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
 {
     _removedItems.Add(e.Item);
 }
Example #20
0
 private void Grid1_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
 {
     int x = 5;
     //  UpdateDb(e.Item, "DELETE");
 }
Example #21
0
        private void Grid1_InsertCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
        {
            // NEVER INSERT USING SQLSERVER SHIT!
            // No way to get the primary key easily of the new row.
            // absolute shit

            // Use the RISE-genearated ODBC

            string connstr = @"Dsn=RISEauthframework";

            System.Data.Odbc.OdbcConnection conn =
                new System.Data.Odbc.OdbcConnection(connstr);

            conn.Open();

            IWorkspaceEntitlement Iwserows = new IWorkspaceEntitlement(conn);

            // It would be nice to verify that the permutation vector is indeed unique to this sandbox!!
            // LATER!


            Hashtable fields = new Hashtable();

            string SQLcolnames  = "c_r_EditingWorkspace ";
            string SQLcolvalues = IDworkspace.ToString();


            int numParams = 0;

            for (int i = 0; i < e.Item.ToArray().Length; i++)
            {
                GridColumn col = Grid1.Levels[0].Columns[i];
                if (col.AllowEditing != InheritBool.False)
                {
                    if (col.Visible && (col.DataField != "") && (col.DataField != null))
                    {
                        SQLcolnames  += " , ";
                        SQLcolvalues += " , ";

                        fields.Add(col.DataField, e.Item.ToArray()[i].ToString());

                        SQLcolnames  += col.DataField;
                        SQLcolvalues += "@" + col.DataField;
                        numParams++;
                        SqlDataSource1.InsertParameters.Add(col.DataField, e.Item.ToArray()[i].ToString());
                    }
                }
            }


            // Here we only add the REQUIRED columns, then we'll do an UPDATE to fill in the non-required

            int IDnewEntVector =
                Iwserows.NewWorkspaceEntitlement
                (
                    fields["c_u_StandardActivity"] as string,
                    fields["c_u_RoleType"] as string,
                    fields["c_u_System"] as string,
                    fields["c_u_Platform"] as string,
                    fields["c_u_EntitlementName"] as string,
                    fields["c_u_EntitlementValue"] as string,
                    IDworkspace);


            Iwserows.SetWorkspaceEntitlement(IDnewEntVector,
                                             fields["c_u_StandardActivity"] as string,
                                             fields["c_u_RoleType"] as string,
                                             fields["c_u_System"] as string,
                                             fields["c_u_Platform"] as string,
                                             fields["c_u_EntitlementName"] as string,
                                             fields["c_u_EntitlementValue"] as string,
                                             fields["c_u_AuthObjName"] as string,
                                             fields["c_u_AuthObjValue"] as string,
                                             fields["c_u_FieldSecName"] as string,
                                             fields["c_u_FieldSecValue"] as string,
                                             null,
                                             null,
                                             fields["c_u_Commentary"] as string,
                                             IDworkspace);

            conn.Close();
        }
Example #22
0
 /// <summary>
 /// Handles the DeleteCommand event of the CurrencyRatesGrid control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="ComponentArt.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
 void CurrencyRatesGrid_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
 {
     _removedItems.Add(e.Item);
 }
Example #23
0
        // Actually, this TOGGLES the deletion state!
        private void Grid1_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
        {
            int idTassToDel = int.Parse(e.Item["IDtass"].ToString());

            SAP_HELPERS.RecordDeletionOfEntitlementAssignmentRow(idTassToDel, 'T');
        }