private void btnsel_Click(object sender, EventArgs e) { //btnsel.Enabled = false; removeControlsFromlvPanel(); pnllv = new Panel(); pnllv.BorderStyle = BorderStyle.FixedSingle; pnllv.Location = new Point(34, 68); pnllv.Size = new Size(466, 245); lv = EmployeePostingDB.getEmployeeListView(); lv.Sorting = System.Windows.Forms.SortOrder.None; lv.ColumnClick += new ColumnClickEventHandler(LvColumnClick); lv.Location = new Point(13, 9); lv.Size = new Size(440, 199); //lv.ListViewItemSorter = new ListViewItemComparer(); pnllv.Controls.Add(lv); Button lvOK = new Button(); lvOK.Text = "OK"; lvOK.Location = new Point(38, 215); lvOK.Click += new System.EventHandler(this.lvOK_Click1); pnllv.Controls.Add(lvOK); Button lvCancel = new Button(); lvCancel.Text = "Cancel"; lvCancel.Location = new Point(155, 215); lvCancel.Click += new System.EventHandler(this.lvCancel_Click2); pnllv.Controls.Add(lvCancel); pnlDocumentInner.Controls.Add(pnllv); pnllv.BringToFront(); pnllv.Visible = true; }
private void btnsel_Click(object sender, EventArgs e) { //btnsel.Enabled = false; removeControlsFromlvPanel(); pnlDocumentInner.Visible = false; pnlDocumentOuter.Visible = false; clearDocumentData(); btnNew.Visible = false; pnllv = new Panel(); pnllv.BorderStyle = BorderStyle.FixedSingle; pnllv.Location = new Point(34, 68); pnllv.Size = new Size(466, 245); lv = EmployeePostingDB.getEmployeeListView(); lv.Sorting = System.Windows.Forms.SortOrder.None; lv.ColumnClick += new ColumnClickEventHandler(LvColumnClick); lv.Location = new Point(13, 9); lv.Size = new Size(440, 199); //lv.ListViewItemSorter = new ListViewItemComparer(); pnllv.Controls.Add(lv); Button lvOK = new Button(); lvOK.Text = "OK"; lvOK.Location = new Point(20, 215); lvOK.Click += new System.EventHandler(this.lvOK_Click1); pnllv.Controls.Add(lvOK); Button lvCancel = new Button(); lvCancel.Text = "Cancel"; lvCancel.Location = new Point(100, 215); lvCancel.Click += new System.EventHandler(this.lvCancel_Click2); pnllv.Controls.Add(lvCancel); Label lblSearch = new Label(); lblSearch.Text = "Find"; lblSearch.Location = new Point(285, 218); lblSearch.Size = new Size(35, 15); pnllv.Controls.Add(lblSearch); txtSearch = new TextBox(); txtSearch.Location = new Point(320, 215); txtSearch.TextChanged += new EventHandler(txtSearch_TextChanged); pnllv.Controls.Add(txtSearch); pnlUI.Controls.Add(pnllv); pnllv.BringToFront(); pnllv.Visible = true; }
private void btnSelect_Click(object sender, EventArgs e) { removeControlsFromLVPanel(); pnlList.Controls.Remove(pnllv); btnSelect.Enabled = false; pnllv = new Panel(); pnllv.BorderStyle = BorderStyle.FixedSingle; pnllv.BackColor = Color.DarkSeaGreen; pnllv.Bounds = new Rectangle(new Point(24, 32), new Size(477, 282)); lv = EmployeePostingDB.getEmployeeListView(); lv.ColumnClick += new ColumnClickEventHandler(LvColumnClick); //this.lv.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.listView1_ItemChecked); lv.Bounds = new Rectangle(new Point(17, 14), new Size(443, 212)); pnllv.Controls.Add(lv); Button lvOK = new Button(); lvOK.Text = "OK"; lvOK.Location = new Point(44, 246); lvOK.Click += new System.EventHandler(this.lvOK_Click1); pnllv.Controls.Add(lvOK); Button lvCancel = new Button(); lvCancel.Text = "Cancel"; lvCancel.Location = new Point(141, 246); lvCancel.Click += new System.EventHandler(this.lvCancel_Click1); pnllv.Controls.Add(lvCancel); Label lblSearch = new Label(); lblSearch.Text = "Find"; lblSearch.Location = new Point(260, 250); lblSearch.Size = new Size(37, 15); pnllv.Controls.Add(lblSearch); txtSearch = new TextBox(); txtSearch.Location = new Point(303, 246); txtSearch.TextChanged += new EventHandler(txtSearch_TextChangedEmp); pnllv.Controls.Add(txtSearch); pnlList.Controls.Add(pnllv); pnllv.BringToFront(); pnllv.Visible = true; txtSearch.Focus(); }
private void showDataTables() { try { string str = txtEMpID.Text; List <employeeposting> empPosting = EmployeePostingDB.getEmployeePosting(str); foreach (employeeposting epost in empPosting) { if (epost.Status == 1) { grdEmpPosting.Rows.Add(); grdEmpPosting.Rows[grdEmpPosting.RowCount - 1].Cells["MontYearPost"].Value = epost.postingDate.ToString("MMM-yyyy"); grdEmpPosting.Rows[grdEmpPosting.RowCount - 1].Cells["Office"].Value = epost.officeName; grdEmpPosting.Rows[grdEmpPosting.RowCount - 1].Cells["Department"].Value = epost.departmentName; } } List <employeeDesignation> EmployeeDesig = EmployeeDB.getEmployeeDesignation(str); foreach (employeeDesignation emp1 in EmployeeDesig) { if (emp1.status == 1) { grdEmpDesig.Rows.Add(); grdEmpDesig.Rows[grdEmpDesig.RowCount - 1].Cells["DMonthYear"].Value = emp1.Descdate.ToString("MMM-yyyy"); grdEmpDesig.Rows[grdEmpDesig.RowCount - 1].Cells["Designation"].Value = emp1.designationDescription; } } List <EmployeePayRevision> EmpPayList = EmployeeDB.getEmployeePayRevDetail(str); foreach (EmployeePayRevision emprev in EmpPayList) { if (emprev.status == 1) { grdEmpCTC.Rows.Add(); grdEmpCTC.Rows[grdEmpCTC.RowCount - 1].Cells["MonthYearCTC"].Value = emprev.RevisionDate.ToString("MMM-yyyy"); grdEmpCTC.Rows[grdEmpCTC.RowCount - 1].Cells["FixPay"].Value = emprev.FixPay; grdEmpCTC.Rows[grdEmpCTC.RowCount - 1].Cells["VariablePay"].Value = emprev.VariablePay; grdEmpCTC.Rows[grdEmpCTC.RowCount - 1].Cells["ctcDesignation"].Value = emprev.Designation; grdEmpCTC.Rows[grdEmpCTC.RowCount - 1].Cells["ctcOffice"].Value = emprev.Office; if (emprev.VariablePay > 0) { grdEmpCTC.Rows[grdEmpCTC.RowCount - 1].Cells["VariablePayPercent"].Value = emprev.VPPercentage; } else { grdEmpCTC.Rows[grdEmpCTC.RowCount - 1].Cells["VariablePayPercent"].Value = 0; } grdEmpCTC.Rows[grdEmpCTC.RowCount - 1].Cells["CTCInLakh"].Value = Math.Round((emprev.FixPay + (emprev.VariablePay * emprev.VPPercentage / 100)) / 100000, 2); if (grdEmpCTC.RowCount >= 2) { decimal dd; try { dd = Convert.ToDecimal(grdEmpCTC.Rows[grdEmpCTC.RowCount - 2].Cells["CTCInLakh"].Value) * 100000; } catch (Exception) { dd = 0; } decimal d1 = (emprev.FixPay + (emprev.VariablePay * emprev.VPPercentage / 100)); decimal dec = d1 - dd; decimal d2; if (dd != 0) { d2 = dec / dd * 100; } else { d2 = 100; } grdEmpCTC.Rows[grdEmpCTC.RowCount - 1].Cells["IncreasePercentage"].Value = Math.Round(d2) + " % "; } setTableVisibility(); } } } catch (Exception ex) { } }