Example #1
0
 protected void addLanguageButton_Click(object sender, EventArgs e)
 {
     Item item = (Item)Session["Item" + itemIdTextBox.Text];
     ItemLanguage il = new ItemLanguage(0, item.ItemID, "", DateTime.Now);
     item.ItemLanguages.Add(il);
     languagesList.EditIndex = languagesList.Rows.Count;
     bindLanguageData();
 }
 /// <summary>
 /// Update values in ItemLanguage. Returns an object of type ItemLanguage.
 /// </summary>
 /// <param name="sqlConnection">Sql connection or null.</param>
 /// <param name="sqlTransaction">Sql transaction or null.</param>
 /// <param name="connectionKeyName">Connection key name located in config file.</param>
 /// <param name="value">Object of type ItemLanguage.</param>
 /// <returns>Object of type ItemLanguage.</returns>
 public ItemLanguage ItemLanguageUpdateAuto(
     SqlConnection sqlConnection,
     SqlTransaction sqlTransaction,
     string connectionKeyName,
     ItemLanguage value)
 {
     return ItemLanguageUpdateAuto(sqlConnection, sqlTransaction, connectionKeyName,
         value.ItemLanguageID,
         value.ItemID,
         value.LanguageCode);
 }
 /// <summary>
 /// Update values in ItemLanguage. Returns an object of type ItemLanguage.
 /// </summary>
 /// <param name="sqlConnection">Sql connection or null.</param>
 /// <param name="sqlTransaction">Sql transaction or null.</param>
 /// <param name="value">Object of type ItemLanguage.</param>
 /// <returns>Object of type ItemLanguage.</returns>
 public ItemLanguage ItemLanguageUpdateAuto(
     SqlConnection sqlConnection,
     SqlTransaction sqlTransaction,
     ItemLanguage value)
 {
     return ItemLanguageUpdateAuto(sqlConnection, sqlTransaction, "BHL", value );
 }
        /// <summary>
        /// Manage ItemLanguage object.
        /// If the object is of type CustomObjectBase, 
        /// then either insert values into, delete values from, or update values in ItemLanguage.
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="connectionKeyName">Connection key name located in config file.</param>
        /// <param name="value">Object of type ItemLanguage.</param>
        /// <returns>Object of type CustomDataAccessStatus<ItemLanguage>.</returns>
        public CustomDataAccessStatus<ItemLanguage> ItemLanguageManageAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            ItemLanguage value)
        {
            if (value.IsNew && !value.IsDeleted)
            {

                ItemLanguage returnValue = ItemLanguageInsertAuto(sqlConnection, sqlTransaction, connectionKeyName,
                    value.ItemID,
                        value.LanguageCode);

                return new CustomDataAccessStatus<ItemLanguage>(
                    CustomDataAccessContext.Insert,
                    true, returnValue);
            }
            else if (!value.IsNew && value.IsDeleted)
            {
                if (ItemLanguageDeleteAuto(sqlConnection, sqlTransaction, connectionKeyName,
                    value.ItemLanguageID))
                {
                return new CustomDataAccessStatus<ItemLanguage>(
                    CustomDataAccessContext.Delete,
                    true, value);
                }
                else
                {
                return new CustomDataAccessStatus<ItemLanguage>(
                    CustomDataAccessContext.Delete,
                    false, value);
                }
            }
            else if (value.IsDirty && !value.IsDeleted)
            {

                ItemLanguage returnValue = ItemLanguageUpdateAuto(sqlConnection, sqlTransaction, connectionKeyName,
                    value.ItemLanguageID,
                        value.ItemID,
                        value.LanguageCode);

                return new CustomDataAccessStatus<ItemLanguage>(
                    CustomDataAccessContext.Update,
                    true, returnValue);
            }
            else
            {
                return new CustomDataAccessStatus<ItemLanguage>(
                    CustomDataAccessContext.NA,
                    false, value);
            }
        }
 /// <summary>
 /// Manage ItemLanguage object.
 /// If the object is of type CustomObjectBase, 
 /// then either insert values into, delete values from, or update values in ItemLanguage.
 /// </summary>
 /// <param name="sqlConnection">Sql connection or null.</param>
 /// <param name="sqlTransaction">Sql transaction or null.</param>
 /// <param name="value">Object of type ItemLanguage.</param>
 /// <returns>Object of type CustomDataAccessStatus<ItemLanguage>.</returns>
 public CustomDataAccessStatus<ItemLanguage> ItemLanguageManageAuto(
     SqlConnection sqlConnection,
     SqlTransaction sqlTransaction,
     ItemLanguage value)
 {
     return ItemLanguageManageAuto( sqlConnection, sqlTransaction, "BHL", value  );
 }