protected void ctlSubmit_Click(object sender, ImageClickEventArgs e) { IList <DbScgReasonLang> list = new List <DbScgReasonLang>(); short reasonId = UIHelper.ParseShort(ctlRejectReasonGridView.SelectedValue.ToString()); DbScgReason reason = new DbScgReason(reasonId); foreach (GridViewRow row in ctlReasonLangGrid.Rows) { TextBox detail = row.FindControl("ctlReasonDetail") as TextBox; TextBox comment = row.FindControl("ctlCommentLang") as TextBox; CheckBox active = row.FindControl("ctlActiveLang") as CheckBox; if (!string.IsNullOrEmpty(detail.Text)) { short languageId = UIHelper.ParseShort(ctlReasonLangGrid.DataKeys[row.RowIndex].Values["LanguageID"].ToString()); DbLanguage lang = new DbLanguage(languageId); DbScgReasonLang reasonLang = new DbScgReasonLang(); reasonLang.Reason = reason; reasonLang.Language = lang; reasonLang.ReasonDetail = detail.Text; reasonLang.Comment = comment.Text; reasonLang.Active = active.Checked; GetReasonLangInfo(reasonLang); list.Add(reasonLang); } } DbReasonLangService.UpdateReasonLang(list); ctlMessage.Message = GetMessage("SaveSuccessFully"); ctlRejectReasonGridView.DataCountAndBind(); ctlUpdatePanelGridView.Update(); }
private void GetReasonLangInfo(DbScgReasonLang reasonLang) { reasonLang.CreBy = UserAccount.UserID; reasonLang.CreDate = DateTime.Now.Date; reasonLang.UpdBy = UserAccount.UserID; reasonLang.UpdDate = DateTime.Now.Date; reasonLang.UpdPgm = ProgramCode; }