protected void ctlSubmit_Click(object sender, EventArgs e) { IList <SuMenuLang> list = new List <SuMenuLang>(); short menuId = UIHelper.ParseShort(ctlMenuGrid.SelectedValue.ToString()); SuMenu menu = new SuMenu(menuId); foreach (GridViewRow row in ctlMenuLangGrid.Rows) { TextBox ctlMenuName = row.FindControl("ctlMenuName") as TextBox; TextBox ctlCommentMenuLang = row.FindControl("ctlCommentMenuLang") as TextBox; CheckBox ctlActiveMenuLang = row.FindControl("ctlActiveMenuLang") as CheckBox; //if ((!string.IsNullOrEmpty(ctlMenuName.Text)) || (!string.IsNullOrEmpty(ctlCommentMenuLang.Text))) //{ short languageId = UIHelper.ParseShort(ctlMenuLangGrid.DataKeys[row.RowIndex].Values["LanguageId"].ToString()); DbLanguage lang = new DbLanguage(languageId); SuMenuLang menuLang = new SuMenuLang(); menuLang.Menu = menu; menuLang.Language = lang; menuLang.MenuName = ctlMenuName.Text; menuLang.Comment = ctlCommentMenuLang.Text; menuLang.Active = ctlActiveMenuLang.Checked; GetSuMenuLangInfo(menuLang); list.Add(menuLang); //} } SuMenuLangService.UpdateMenuLang(list); ctlMessage.Message = GetMessage("SaveSuccessFully"); //ctlUpdatePanelTranslateLangGridView.Update(); }
private void GetSuMenuLangInfo(SuMenuLang menuLang) { menuLang.CreBy = UserAccount.UserID; menuLang.CreDate = DateTime.Now.Date; menuLang.UpdBy = UserAccount.UserID; menuLang.UpdDate = DateTime.Now.Date; menuLang.UpdPgm = ProgramCode; }