void btnSaveOtherLanguage_Click(object sender, EventArgs e) { if (ViewState[CMSViewStateManager.GroupID] != null && ucPortalLanguage.SelectedLanguageID > 0) { try { // Update Info Except Language Info : Group group = GroupManager.GetGroup(Convert.ToInt32(ViewState[CMSViewStateManager.GroupID]), CMSContext.LanguageID); if (group != null) { group.IsColorGroup = cbIsColorGroup.Checked; GroupManager.Update(group); //SaveLanguage Info Only : Group langGroup = new Group { ID = Convert.ToInt32(ViewState[CMSViewStateManager.GroupID]), Name = txtName.Text, PublicName = txtPublicName.Text, LanguageID = ucPortalLanguage.SelectedLanguageID, ModuleID = (int)CMSEnums.ECommerceModule.Group, }; GroupManager.AddOtherLanguage(langGroup); BeginAddMode(); FillGroups(-1); upnlGroup.Update(); upnlGroupItem.Update(); } } catch (Exception ex) { dvProblems.Visible = true; dvProblems.InnerText = ex.ToString(); upnlGroup.Update(); } } }
public static int Add(Group group) { return GroupDataMapper.Add(group); }
public static void AddOtherLanguage(Group group) { GroupDataMapper.AddOtherLanguage(group); }
public static void Update(Group group) { GroupDataMapper.Update(group); }
void btnSave_Click(object sender, EventArgs e) { try { Group Group = new Group(); Group.IsDeleted = false; Group.LanguageID = CMSContext.LanguageID; Group.PortalID = CMSContext.PortalID; Group.Name = txtName.Text; Group.PublicName = txtPublicName.Text; Group.IsColorGroup = cbIsColorGroup.Checked; Group.ModuleID = (int)CMSEnums.ECommerceModule.Group; GroupManager.Add(Group); BeginAddMode(); FillGroups(-1); upnlGroup.Update(); } catch (Exception ex) { dvProblems.Visible = true; dvProblems.InnerText = ex.ToString(); upnlGroup.Update(); } }
internal static void FillFromReader(Group Group, SqlDataReader reader) { int colIndex = 0; colIndex = reader.GetOrdinal(CN_GROUP_ID); if (!reader.IsDBNull(colIndex)) Group.ID = reader.GetInt32(colIndex); colIndex = reader.GetOrdinal(CN_GROUP_PORTAL_ID); if (!reader.IsDBNull(colIndex)) Group.PortalID = reader.GetInt32(colIndex); colIndex = reader.GetOrdinal(ECommerceDataMapperBase.CN_ECO_LAN_NAME); if (!reader.IsDBNull(colIndex)) Group.Name = reader.GetString(colIndex); colIndex = reader.GetOrdinal(ECommerceDataMapperBase.CN_ECO_LAN_NAME2); if (!reader.IsDBNull(colIndex)) Group.PublicName = reader.GetString(colIndex); colIndex = reader.GetOrdinal(CN_GROUP_IS_DELETED); if (!reader.IsDBNull(colIndex)) Group.IsDeleted = reader.GetBoolean(colIndex); colIndex = reader.GetOrdinal(CN_GROUP_IS_COLOR_GROUP); if (!reader.IsDBNull(colIndex)) Group.IsColorGroup = reader.GetBoolean(colIndex); colIndex = reader.GetOrdinal(ECommerceDataMapperBase.CN_ECO_LAN_LAN_ID); if (!reader.IsDBNull(colIndex)) Group.LanguageID = reader.GetInt32(colIndex); }
internal static Group GetGroup(List<Group> Groups, SqlDataReader reader) { int colIndex = 0; colIndex = reader.GetOrdinal(CN_GROUP_ID); int value = reader.GetInt32(colIndex); Group Group = Groups.Where(c => c.ID == value).FirstOrDefault(); if (Group == null) { Group = new Group(); Groups.Add(Group); } return Group; }