private void grdVwSearchResult_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { _frmEntry = (FrmRationEntry)FormHelper.OpenFrmRationEntry(); try { Control ctrlsPanel = _frmEntry.Controls["pnlRationCardEntry"]; Control btnPanel = ctrlsPanel.Controls["panel3"]; Control ctrlsPanel2 = ctrlsPanel.Controls["panel2"]; Control grp1 = ctrlsPanel.Controls["groupBox1"]; Control grp3 = ctrlsPanel.Controls["groupBox3"]; string cardNo = grdVwSearchResult.Rows[e.RowIndex].Cells["Number"].Value.ToString(); grp1.Controls["txtCardNo"].Text = cardNo; grp1.Controls["lblIsEdit"].Text = "1"; string mobileNo = grdVwSearchResult.Rows[e.RowIndex].Cells["Mobile_No"].Value.ToString(); ComboBox cmbCat = (ComboBox)grp1.Controls["cmbCat"]; cmbCat.Text = grdVwSearchResult.Rows[e.RowIndex].Cells["Cat_Desc"].Value.ToString(); cmbCat.SelectedValue = grdVwSearchResult.Rows[e.RowIndex].Cells["Cat_Id"].Value.ToString(); cmbCat.SelectedIndex = Int32.Parse(((List <Category>)cmbCat.DataSource).FirstOrDefault(i => i.Cat_Id == grdVwSearchResult.Rows[e.RowIndex].Cells["Cat_Id"].Value.ToString()).Cat_Id) - 1; grp1.Controls["lblCardCatId"].Text = grdVwSearchResult.Rows[e.RowIndex].Cells["Cat_Id"].Value.ToString(); grp1.Controls["txtAdharOrEpic"].Text = grdVwSearchResult.Rows[e.RowIndex].Cells["Adhar_No"].Value.ToString(); grp3.Controls["txtCardHolderName"].Text = grdVwSearchResult.Rows[e.RowIndex].Cells["Name"].Value.ToString(); CheckBox hofCheck = (CheckBox)grp3.Controls["chkHof"]; hofCheck.Checked = grdVwSearchResult.Rows[e.RowIndex].Cells["Hof_Flag"].Value.ToString() == "True"; string hofName = grdVwSearchResult.Rows[e.RowIndex].Cells["Hof_Name"].Value.ToString(); grp3.Controls["cmbHof"].Text = hofName + " || " + cardNo + " || " + mobileNo; grp3.Controls["txtFatherName"].Text = grdVwSearchResult.Rows[e.RowIndex].Cells["Gaurdian_Name"].Value.ToString(); grp3.Controls["cmbRelHof"].Text = grdVwSearchResult.Rows[e.RowIndex].Cells["Relation_With_Hof"].Value.ToString(); grp3.Controls["cmbRel"].Text = grdVwSearchResult.Rows[e.RowIndex].Cells["Gaurdian_Relation"].Value.ToString(); string custId = grdVwSearchResult.Rows[e.RowIndex].Cells["Customer_Id"].Value.ToString(); RationCardDetail card = MasterDataHelper.FetchFamilyCount(custId); grp3.Controls["txtTotalActiveCards"].Text = card.FamilyCount; grp3.Controls["txtTotalCards"].Text = card.CardCount; //grp3.Controls["txtHofCardNo"].Text = grdVwSearchResult.Rows[e.RowIndex].Cells["CardCount"].Value.ToString(); DateTimePicker dt = (DateTimePicker)ctrlsPanel2.Controls["dateTimePicker1"]; dt.Value = DateTime.ParseExact(grdVwSearchResult.Rows[e.RowIndex].Cells["Card_Created_Date"].Value.ToString(), "d", CultureInfo.InvariantCulture); CheckBox active = (CheckBox)ctrlsPanel2.Controls["chkActive"]; active.Checked = grdVwSearchResult.Rows[e.RowIndex].Cells["ActiveCard"].Value.ToString() == "True"; ctrlsPanel2.Controls["txtMobileNo"].Text = mobileNo; ctrlsPanel2.Controls["txtAge"].Text = grdVwSearchResult.Rows[e.RowIndex].Cells["Age"].Value.ToString(); ctrlsPanel2.Controls["txtAddress"].Text = grdVwSearchResult.Rows[e.RowIndex].Cells["Address"].Value.ToString(); ctrlsPanel2.Controls["txtRemarks"].Text = grdVwSearchResult.Rows[e.RowIndex].Cells["Remarks"].Value.ToString(); ctrlsPanel2.Controls["lblRationCardId"].Text = grdVwSearchResult.Rows[e.RowIndex].Cells["RationCard_Id"].Value.ToString(); ctrlsPanel2.Controls["lblCustId"].Text = custId; btnPanel.Controls["btnDelete"].Enabled = true; } catch (Exception ex) { Logger.LogError(ex); } }
public FrmSearchResult(FrmRationEntry frmObj) { InitializeComponent(); _frmEntry = frmObj; _catList = frmObj._catList; cmbCardCat.DataSource = _catList; cmbCardCat.DisplayMember = "Cat_Desc"; cmbCardCat.ValueMember = "Cat_Id"; }
public FrmCatwiseCount(FrmRationEntry frm) { InitializeComponent(); _frmSource = frm; }