private void btnClose_Click(object sender, EventArgs e) { if (Exit == 1) { DGFamily.Show(); ReadOnly(false); btnView.Show(); btnAdd.Show(); btnActive.Show(); btnCancel.Show(); btnDelete.Show(); btnEdit.Show(); btnReset.Show(); btnSubmit.Show(); Exit = 0; Disable(true); this.AcceptButton = btnAdd; btnAll.Show(); btnActive.Show(); grbSearch.Show(); lblgo.Enabled = true; } else { this.Close(); } }
private void DGFamily_Sorted(object sender, EventArgs e) { int rows = DGFamily.Rows.Count; for (int x = 0; x < rows; x++) { string SNo = Convert.ToDecimal(x + 1).ToString("000"); DGFamily.Rows[x].Cells[1].Value = SNo; DGFamily.RefreshEdit(); } }
private void FillGrid_All(string FCardNo) { usp_SEL_tblFamilyMemberTableAdapter.Fill(comDataSet.usp_SEL_tblFamilyMember, FCardNo); int rows = DGFamily.Rows.Count; for (int x = 0; x < rows; x++) { string SNo = Convert.ToDecimal(x + 1).ToString("000"); DGFamily.Rows[x].Cells[1].Value = SNo; DGFamily.RefreshEdit(); } }
private void frmFamily_Member_Load(object sender, EventArgs e) { btnActiveMembers.Enabled = false; btnNonActiveMembers.Enabled = false; DGFamily.BringToFront(); // TODO: This line of code loads data into the 'comDataSet.usp_SEL_tblWorkType' table. You can move, or remove it, as needed. this.usp_SEL_tblWorkTypeTableAdapter.Fill(this.comDataSet.usp_SEL_tblWorkType); // TODO: This line of code loads data into the 'comDataSet.usp_SEL_tblWorkType' table. You can move, or remove it, as needed. this.usp_SEL_tblWorkTypeTableAdapter.Fill(this.comDataSet.usp_SEL_tblWorkType); btnFCardNo.Focus(); this.usp_SEL_tblBloodGroupTableAdapter.Fill(this.comDataSet.usp_SEL_tblBloodGroup); btnFCardNo.Focus(); }
private void btnView_Click(object sender, EventArgs e) { Disable(false); Exit = 1; ReadOnly(true); // Hide(true); btnAdd.Hide(); btnView.Hide(); btnActive.Hide(); btnDelete.Hide(); btnEdit.Hide(); DGFamily.Hide(); btnCancel.Hide(); btnSubmit.Hide(); btnReset.Hide(); btnClose.Focus(); btnActive.Hide(); grbSearch.Hide(); btnAll.Hide(); lblgo.Enabled = false; }
private void FillFamilyGrid(string spName) { Community.DBLayer dblayer = new Community.DBLayer(); SqlCommand cmd = new SqlCommand(); SqlConnection conn = new SqlConnection(dblayer.CON_string); cmd.Connection = conn; cmd.CommandText = spName; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@FCardNo", txtFCardNo.Text)); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); if (DGFamily.DataSource != null) { DGFamily.DataSource = null; } DGFamily.DataSource = dt; int rows = DGFamily.Rows.Count; for (int count = 0; count < rows; count++) { string SNo = Convert.ToDecimal(count + 1).ToString("000"); DGFamily.Rows[count].Cells[1].Value = SNo; DGFamily.RefreshEdit(); } if (DGFamily.RowCount == 0) { DGFamily.Enabled = false; } else { DGFamily.Enabled = true; } }
//WorkStation------------------------------------------------------ //----------------------------------------------------------------- private void frmFamily_Load(object sender, EventArgs e) { DGFamily.BringToFront(); this.Top = 48; if (DBLayer.User_Right(UserID, SecurityLevelID, "[Modify]")) { btnEdit.Enabled = true; btnActive.Enabled = true; } if (DBLayer.User_Right(UserID, SecurityLevelID, "[Delete]")) { btnDelete.Enabled = true; } if (DBLayer.User_Right(UserID, SecurityLevelID, "[Write]")) { btnAdd.Enabled = true; } // TODO: This line of code loads data into the 'comDataSet.usp_SEL_tblWorkType' table. You can move, or remove it, as needed. this.usp_SEL_tblWorkTypeTableAdapter.Fill(this.comDataSet.usp_SEL_tblWorkType); // TODO: This line of code loads data into the 'comDataSet.usp_SEL_tblArea' table. You can move, or remove it, as needed. this.usp_SEL_tblAreaTableAdapter.Fill(this.comDataSet.usp_SEL_tblArea); // TODO: This line of code loads data into the 'comDataSet.usp_SEL_tblCity' table. You can move, or remove it, as needed. this.usp_SEL_tblCityTableAdapter.Fill(this.comDataSet.usp_SEL_tblCity); // TODO: This line of code loads data into the 'comDataSet.usp_SEL_tblOrakh' table. You can move, or remove it, as needed. this.usp_SEL_tblOrakhTableAdapter.Fill(this.comDataSet.usp_SEL_tblOrakh); // TODO: This line of code loads data into the 'comDataSet.usp_SEL_tblVillage' table. You can move, or remove it, as needed. this.usp_SEL_tblVillageTableAdapter.Fill(this.comDataSet.usp_SEL_tblVillage); // TODO: This line of code loads data into the 'comDataSet.usp_SEL_tblNukh' table. You can move, or remove it, as needed. this.usp_SEL_tblNukhTableAdapter.Fill(this.comDataSet.usp_SEL_tblNukh); // TODO: This line of code loads data into the 'comDataSet.usp_SEL_FAMILY' table. You can move, or remove it, as needed. this.usp_SEL_FAMILYTableAdapter.Fill(comDataSet.usp_SEL_FAMILY); btnAdd.Focus(); this.AcceptButton = btnAdd; dpIssueDate.Text = DateTime.Now.ToString(); }
private void btnNonActiveMembers_Click(object sender, EventArgs e) { DGFamily.CurrentRow.Selected = false; btnActiveMembers.Enabled = false; btnNonActiveMembers.Enabled = false; //DGFamily.SelectedRows[0].Selected = false; for (int i = 0; i < DGFamily.Rows.Count; i++) { DataGridViewRow row = DGFamily.Rows[i]; if (!Convert.ToBoolean(row.Cells["Active"].Value)) { row.Selected = true; row.Visible = true; DGFamily.ClearSelection(); } else { CurrencyManager c = (CurrencyManager)BindingContext[DGFamily.DataSource]; c.SuspendBinding(); row.Visible = false; c.ResumeBinding(); DGFamily.ClearSelection(); } } /*Community.DBLayer dblayer = new Community.DBLayer(); * SqlConnection conn = new SqlConnection(dblayer.CON_string); * string x = txtFCardNo.Text; * string spName = "usp_SEL_NonActive_tblFamilyMembers"; * * if (txtFCardNo.Text == "") * { * MessageBox.Show("Please Insert Family Card Number", "Family Card Required", MessageBoxButtons.OK, MessageBoxIcon.Stop); * } * else * { * bool result = dblayer.CheckFamily(txtFCardNo.Text); * if (result) * { * btnView.Enabled = true; * if (DBLayer.User_Right(UserID, SecurityLevelID, "[Modify]")) * btnEdit.Enabled = true; * else * btnEdit.Enabled = false; * * if (DBLayer.User_Right(UserID, SecurityLevelID, "[Delete]")) * btnDelete.Enabled = true; * else * btnDelete.Enabled = false; * * if (DBLayer.User_Right(UserID, SecurityLevelID, "[Write]")) * btnAdd.Enabled = true; * else * btnAdd.Enabled = false; * * FillFamilyGrid(spName); * } * }*/ }