protected void JqgridNews_RowEditing(object sender, Trirand.Web.UI.WebControls.JQGridRowEditEventArgs e) { using (var dc = ThaitaeDataDataContext.Create()) { var news = dc.News.Single(item => item.newsId == Convert.ToInt32(e.RowKey)); news.newsTopic = e.RowData["newsTopic"]; news.newsContent = e.RowData["newsContent"]; news.newsType = Convert.ToInt32(e.RowData["NewsTypeName"]); dc.SubmitChanges(); } }
protected void JqgridTeam_RowEditing(object sender, Trirand.Web.UI.WebControls.JQGridRowEditEventArgs e) { using (var dc = ThaitaeDataDataContext.Create()) { var teamSeason = dc.TeamSeasons.Single(item => item.TeamSeasonId == Convert.ToInt32(e.RowKey)); var team = dc.Teams.Single(item => item.TeamId == teamSeason.TeamId); team.TeamName = e.RowData["TeamName"].Trim(); team.TeamDesc = e.RowData["TeamDesc"].Trim(); team.Active = Convert.ToByte(e.RowData["ActiveName"]); dc.SubmitChanges(); } }
protected void JqgridLeague1_RowEditing(object sender, Trirand.Web.UI.WebControls.JQGridRowEditEventArgs e) { using (var dc = ThaitaeDataDataContext.Create()) { var league = dc.Leagues.Single(item => item.LeagueId == Convert.ToInt32(e.RowKey)); league.LeagueName = e.RowData["LeagueName"]; league.LeagueType = Convert.ToInt32(e.RowData["LeagueTypeName"]); league.LeagueDesc = e.RowData["LeagueDesc"]; league.Active = Convert.ToInt32(e.RowData["ActiveName"]); dc.SubmitChanges(); } }
protected void JqgridSeason_RowEditing(object sender, Trirand.Web.UI.WebControls.JQGridRowEditEventArgs e) { using (var dc = ThaitaeDataDataContext.Create()) { var season = dc.Seasons.Single(item => item.SeasonId == Convert.ToInt32(e.RowKey)); var seasonGroupList = dc.Seasons.Where(item => item.ChampionLeagueSeasonId == Convert.ToInt32(e.RowKey)); season.SeasonName = e.RowData["SeasonName"]; season.SeasonDesc = e.RowData["SeasonDesc"]; foreach (var seasonGroup in seasonGroupList) { seasonGroup.SeasonName = e.RowData["SeasonName"]; seasonGroup.SeasonDesc = e.RowData["SeasonDesc"]; } dc.SubmitChanges(); } }
protected void JqgridCompany_RowEditing(object sender, Trirand.Web.UI.WebControls.JQGridRowEditEventArgs e) { var status = e.RowData["StatusLabel"]; var currency = e.RowData["CurrencyCode"]; var id = e.RowKey; if (!(string.IsNullOrEmpty(status) || string.IsNullOrEmpty(currency) || string.IsNullOrEmpty(id))) { var property = new HotelDataEntryLib.Property() { PropertyId = Convert.ToInt32(id), PropertyName = e.RowData["PropertyName"], PropertyCode = e.RowData["PropertyCode"], Status = Convert.ToInt32(status), UpdateDateTime = DateTime.Now, CurrencyId = Convert.ToInt32(currency) }; PropertyHelper.UpdateProperty(property); } }
protected void JqgridCurrency_RowEditing(object sender, Trirand.Web.UI.WebControls.JQGridRowEditEventArgs e) { var status = e.RowData["StatusLabel"]; var isBase = e.RowData["IsBaseLabel"]; var rate = e.RowData["ConversionRate"]; var id = e.RowKey; if (!(string.IsNullOrEmpty(status) || string.IsNullOrEmpty(isBase) || string.IsNullOrEmpty(rate) || string.IsNullOrEmpty(id))) { var currency = new HotelDataEntryLib.Currency() { CurrencyId = Convert.ToInt32(id), CurrencyName = e.RowData["CurrencyName"], CurrencyCode = e.RowData["CurrencyCode"], Status = Convert.ToInt32(status), ConversionRate = Convert.ToDouble(rate), IsBase = Convert.ToInt32(isBase) }; CurrencyHelper.UpdateCurrency(currency); } }
protected void JqgridService_RowEditing(object sender, Trirand.Web.UI.WebControls.JQGridRowEditEventArgs e) { var serviceName = e.RowData["ServiceName"]; var url = e.RowData["ServiceUrl"]; var desc = e.RowData["Description"]; var admin = Session["UserSession"].ToString(); var id = e.RowKey; if (!(string.IsNullOrEmpty(serviceName) || string.IsNullOrEmpty(url) || string.IsNullOrEmpty(desc))) { var Service = new DataModelLib.Service() { ServiceId = Convert.ToInt32(id), ServiceName = serviceName, ServiceURL = url, UpdateUser = admin, Description = desc }; ServiceHelper.UpdateService(Service); } }
protected void JqgridUser_RowEditing(object sender, Trirand.Web.UI.WebControls.JQGridRowEditEventArgs e) { var password = e.RowData["Password"]; var username = e.RowData["Username"]; var description = e.RowData["Description"]; var id = e.RowKey; var admin = Session["UserSession"].ToString(); if (!(string.IsNullOrEmpty(password) || string.IsNullOrEmpty(username))) { var user = new DataModelLib.User() { UserId = Convert.ToInt32(id), Username = username, Password = password, Description = description, UpdateUser = admin }; UserHelper.UpdateUser(user); } }
protected void JqgridUserService_RowEditing(object sender, Trirand.Web.UI.WebControls.JQGridRowEditEventArgs e) { var user = e.RowData["Username"]; var service = e.RowData["Description"]; var ips = e.RowData["Ips"]; var status = e.RowData["StatusLabel"]; var admin = Session["UserSession"].ToString(); var id = e.RowKey; if (!(string.IsNullOrEmpty(user) || string.IsNullOrEmpty(status) || string.IsNullOrEmpty(service))) { var userService = new DataModelLib.UserService() { Id = Convert.ToInt32(id), UserId = Convert.ToInt32(user), ServiceId = Convert.ToInt32(service), Ips = ips, Status = Convert.ToInt32(status), UpdateUser = admin }; UserServiceHelper.UpdateUserService(userService); } }