protected void Page_Load(object sender, EventArgs e) { Error.Visible = false; txtTableName.Text = "Interview"; txtDocType.Text = "64"; //ResetCommand(); id = (List <string>)DataBaseUtility.GetList("select DocNum from Interview"); string currentID = id[id.Count - 1]; int nextID = Convert.ToInt32(currentID) + 1; txtDocNum.Text = nextID.ToString(); }
private void button_Display_Click_1(object sender, EventArgs e) { String query = "Select Deduction_Amt, Comment from Deductions_Details where Emp_ID=104"; char Delim = ','; List <String> details = new List <String>(); details = DataBaseUtility.GetList(query, Delim); for (int i = 0; i < details.Count; i++) { } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Error.Visible = false; appId = (List <string>)DataBaseUtility.GetList("select DocNum from Applicant"); DropDownList1.DataSource = appId; DropDownList1.DataBind(); DropDownList1.SelectedIndex = 0; txtTableName.Text = "Employees"; } empId = (List <string>)DataBaseUtility.GetList("select DocNum from Employees"); }
protected void GetDocument_Click(object sender, EventArgs e) { Error.Visible = false; GridView1.DataSource = null; GridView1.DataBind(); try { txtQuery.Text = "select * from " + txtTabName.Text + " where docNum = " + Convert.ToInt32(txtDocNum.Text) + "And docType = " + Convert.ToInt32(txtDocType.Text); List <string> _selDocStr = DataBaseUtility.GetList("select * from " + txtTabName.Text + " where docNum = " + Convert.ToInt32(txtDocNum.Text) + "And docType = " + Convert.ToInt32(txtDocType.Text)); string[] selDocStr = _selDocStr[1].Split(','); txtExtRef.Text = selDocStr[2]; txtIntRef.Text = selDocStr[3]; txtProcessNum.Text = selDocStr[4]; txtStatus.Text = selDocStr[5]; txtDocStartDate.Text = selDocStr[6]; txtDocStatusDate.Text = selDocStr[7]; txtQuotedAmt.Text = selDocStr[8]; txtActualAmt.Text = selDocStr[9]; txtComment.Text = selDocStr[10]; /*code starts here*/ try { DB_Operations db = new DB_Operations(); DataTable ds = db.SelectQry("select * from " + txtTabName.Text + "_Details" + " where docNum = " + Convert.ToInt32(txtDocNum.Text) + "And docType = " + Convert.ToInt32(txtDocType.Text)); //con.Open(); //cmd = new OleDbCommand("select * from " + txtTabName.Text + "_Details" + " where docNum = " + Convert.ToInt32(txtDocNum.Text) + "And docType = " + Convert.ToInt32(txtDocType.Text), con); //dr = cmd.ExecuteReader(); GridView1.DataSource = ds; GridView1.DataBind(); //Attribute to show the Plus Minus Button. GridView1.HeaderRow.Cells[0].Attributes["data-class"] = "expand"; int column_Num = GridView1.Rows[0].Cells.Count; if (column_Num >= 3) { for (int i = 2; i <= column_Num - 1; i++) { //Attribute to hide column in Phone. GridView1.HeaderRow.Cells[i].Attributes["data-hide"] = "phone,tablet"; } } //Adds THEAD and TBODY to GridView. GridView1.HeaderRow.TableSection = TableRowSection.TableHeader; // con.Close(); } catch (Exception ex) { //Debug.WriteLine("********************************************************************"); //Debug.WriteLine("Exception Caught: {0}", ex.Message); //Debug.WriteLine("Exception Caught: {0}", ex.StackTrace); //Debug.WriteLine("********************************************************************"); } } catch (Exception ex) { Error.Visible = true; } }