private void FindInfo(string myStr)
        {
            EmptyProperty();
            radGridViewSearch.DataSource = null;

            if (myStr.Trim().Count() == 10)
            {
                myStr  = myStr.Replace("\r\n", "");
                result = objManager.View_persons(null, null, null, null, null, null, null, null, null, null, myStr);
                if (result.success)
                {
                    radGridViewSearch.DataSource = result.ResultTable;
                    if (radGridViewSearch.Rows.Count > 0)
                    {
                        SetProperty(radGridViewSearch.Rows[0].Cells["Person_Name"].Value.ToString()
                                    , radGridViewSearch.Rows[0].Cells["Person_Surname"].Value.ToString()
                                    , radGridViewSearch.Rows[0].Cells["Person_LabelIsWoman"].Value.ToString());
                    }
                    else
                    {
                        if (ItemsPublic.IsDigitNumber(rtbSearchPerson.Text.Trim(), 10) && (ItemsPublic.NationalCodeIsTrue(rtbSearchPerson.Text.Trim())))
                        {
                            if (QuestionSureToAddNewUser())
                            {
                                var frm = new frm_PersonTempAddingGp2();
                                frm.uC_PersonDetailsMini21.rmebNationalCode.Text = rtbSearchPerson.Text;
                                frm.ShowDialog();
                                if (frm.DialogResult == DialogResult.OK)
                                {
                                    radGridViewSelected.Rows.AddNew();
                                    foreach (DataColumn col in frm.result.ResultTable.Columns)
                                    {
                                        if (col.ColumnName == "Person_Temp" || col.ColumnName == "Person_IsBlackTemp")
                                        {
                                            continue;
                                        }
                                        radGridViewSelected.CurrentRow.Cells[col.ColumnName].Value =
                                            frm.result.ResultTable.Rows[0][col.ColumnName];
                                    }
                                    radGridViewSelected.CurrentRow = null;
                                }
                                frm.Close();
                                rtbSearchPerson.Text = string.Empty;
                            }
                        }
                        else
                        {
                            MessageBox.Show("مقدار وارد شده جهت کد ملی نا معتبر می باشد");
                        }

                        rtbSearchPerson.Focus();
                    }
                }
                else
                {
                    MessageBox.Show(result.Message);
                }
            }
        }
示例#2
0
 private void rtbTagId_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (ItemsPublic.IsDigitNumber(rtbTagId.Text.Trim(), -1) && rtbTagId.Text.Trim().Count() > 3)
         {
             eventTagInput();
             rtbGpId.Focus();
             rtbGpId.SelectAll();
         }
         return;
     }
     else if (e.KeyCode == Keys.Escape)
     {
         rtbTagId.Text = "";
     }
 }