protected void btnSave_Click(object sender, EventArgs e) { try { ListTable myListTable = new ListTable(); List<ListTable> aList = myListTable.GetAllListTable(_company.CompanyId); ListTable tempListTable = aList[aList.Count - 1]; int id = tempListTable.Id + 1; myListTable.ListType = txtListType.Value; myListTable.ListId = id ; myListTable.ListValue = txtListValue.Value; myListTable.CompanyId = _company.CompanyId; myListTable.IsActive = true; myListTable.UpdateBy = _user.UserId; myListTable.UpdateDate = DateTime.Now; int sucess = 0; if (lblId.Text == "" || lblId.Text == "0") { myListTable.Id = new ListTable().GetMaxListTableId() + 1; sucess = myListTable.InsertListTable(); if (sucess > 0) { Alert.Show("List Table saved successfully"); this.Clear(); } } else { myListTable.Id = int.Parse(lblId.Text); sucess = myListTable.UpdateListTable(); if (sucess > 0) { Response.Redirect("ListTableLists.aspx", true); } } } catch (Exception exp) { Alert.Show(exp.Message); } }
protected void btnSave_Click(object sender, EventArgs e) { try { ListTable myListTable = new ListTable(); List<ListTable> aList = myListTable.GetAllListTable(_company.CompanyId); ListTable tempListTable = aList[aList.Count - 1]; int id = tempListTable.Id + 1; myListTable.ListType = txtListType.Value; myListTable.ListId = id ; myListTable.ListValue = txtListValue.Value; myListTable.CompanyId = _company.CompanyId; myListTable.IsActive = true; myListTable.UpdateBy = user.UserId; myListTable.UpdateDate = DateTime.Now; int success = myListTable.InsertListTable(); if (success > 0) { Session["savedListMessage"] = "Saved List Table Successfully"; Response.Redirect(Request.RawUrl); } else { Alert.Show("Error Occured while inserting a new List Table"); } } catch (Exception exp) { Alert.Show(exp.Message); } }
private void LoadJournalDropDownList() { try { ListTable aNewListTable = new ListTable(); List<ListTable> myList = aNewListTable.GetAllListTable(_company.CompanyId); journalTypeDropDownList.DataSource = myList; journalTypeDropDownList.DataTextField = "ListType"; journalTypeDropDownList.DataValueField = "ListType"; journalTypeDropDownList.DataBind(); } catch (Exception exp) { Alert.Show(exp.Message); } }
private void LoadListTable() { try { ListTable listTable = new ListTable(); objListTables = listTable.GetAllListTable(_company.CompanyId); if (objListTables.Count == 0) objListTables.Add(new ListTable()); RadGrid1.DataSource = objListTables; RadGrid1.Rebind(); } catch (Exception ex) { Alert.Show(ex.Message); } }
void GetAllListTable() { ListTable listTable = new ListTable(); myList = listTable.GetAllListTable(_company.CompanyId); }