void btnSaveOtherLanguage_Click(object sender, EventArgs e) { if (ViewState[CMSViewStateManager.FeatureID] != null && ucPortalLanguage.SelectedLanguageID > 0) { try { // Update Info Except Language Info : AJH.CMS.Core.Entities.Feature Feature = FeatureManager.GetFeature(Convert.ToInt32(ViewState[CMSViewStateManager.FeatureID]), CMSContext.LanguageID); if (Feature != null) { AJH.CMS.Core.Entities.Feature langFeature = new AJH.CMS.Core.Entities.Feature { ID = Convert.ToInt32(ViewState[CMSViewStateManager.FeatureID]), Name = txtName.Text, LanguageID = ucPortalLanguage.SelectedLanguageID, ModuleID = (int)CMSEnums.ECommerceModule.Feature, }; FeatureManager.AddOtherLanguage(langFeature); BeginAddMode(); FillFeatures(-1); upnlFeature.Update(); upnlFeatureItem.Update(); } } catch (Exception ex) { dvProblems.Visible = true; dvProblems.InnerText = ex.ToString(); upnlFeature.Update(); } } }
public static int Add(Feature feature) { return FeatureDataMapper.Add(feature); }
public static void AddOtherLanguage(Feature feature) { FeatureDataMapper.AddOtherLanguage(feature); }
public static void Update(Feature feature) { FeatureDataMapper.Update(feature); }
void btnSave_Click(object sender, EventArgs e) { try { AJH.CMS.Core.Entities.Feature Feature = new AJH.CMS.Core.Entities.Feature(); Feature.IsDeleted = false; Feature.LanguageID = CMSContext.LanguageID; Feature.PortalID = CMSContext.PortalID; Feature.Name = txtName.Text; Feature.ModuleID = (int)CMSEnums.ECommerceModule.Feature; FeatureManager.Add(Feature); BeginAddMode(); FillFeatures(-1); upnlFeature.Update(); } catch (Exception ex) { dvProblems.Visible = true; dvProblems.InnerText = ex.ToString(); upnlFeature.Update(); } }
internal static void FillFromReaderForProductFeature(Feature Feature, SqlDataReader reader) { int colIndex = 0; colIndex = reader.GetOrdinal(CN_FEATURE_ID); if (!reader.IsDBNull(colIndex)) Feature.ID = reader.GetInt32(colIndex); colIndex = reader.GetOrdinal(ECommerceDataMapperBase.CN_ECO_LAN_NAME); if (!reader.IsDBNull(colIndex)) Feature.Name = reader.GetString(colIndex); colIndex = reader.GetOrdinal(CN_PRODUCT_FEATURE_VALUE); if (!reader.IsDBNull(colIndex)) Feature.Value = reader.GetInt32(colIndex); }
internal static void FillFromReader(Feature Feature, SqlDataReader reader) { int colIndex = 0; colIndex = reader.GetOrdinal(CN_FEATURE_ID); if (!reader.IsDBNull(colIndex)) Feature.ID = reader.GetInt32(colIndex); colIndex = reader.GetOrdinal(CN_FEATURE_PORTAL_ID); if (!reader.IsDBNull(colIndex)) Feature.PortalID = reader.GetInt32(colIndex); colIndex = reader.GetOrdinal(ECommerceDataMapperBase.CN_ECO_LAN_NAME); if (!reader.IsDBNull(colIndex)) Feature.Name = reader.GetString(colIndex); colIndex = reader.GetOrdinal(ECommerceDataMapperBase.CN_ECO_LAN_LAN_ID); if (!reader.IsDBNull(colIndex)) Feature.LanguageID = reader.GetInt32(colIndex); colIndex = reader.GetOrdinal(CN_FEATURE_IS_DELETED); if (!reader.IsDBNull(colIndex)) Feature.IsDeleted = reader.GetBoolean(colIndex); }
internal static Feature GetFeature(List<Feature> Features, SqlDataReader reader) { int colIndex = 0; colIndex = reader.GetOrdinal(CN_FEATURE_ID); int value = reader.GetInt32(colIndex); Feature Feature = Features.Where(c => c.ID == value).FirstOrDefault(); if (Feature == null) { Feature = new Feature(); Features.Add(Feature); } return Feature; }