コード例 #1
0
        private void FillEmpPFUANDetailData2(string sDoc)
        {
            if (txtEcodeSearch.Text.ToString().Length > 0)
            {
                objHRInfo = new HRInfo();
                DataSet ds = null;
                try
                {
                    ds = objHRInfo.GetEmpPFUANDetailData2(txtEcodeSearch.Text, sDoc);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
                finally
                {
                    objHRInfo = null;
                }
                if (ds != null)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        flagUpdate1 = true;

                        if (CommonData.LogUserId.ToUpper() != "ADMIN" && flagUpdate1 == true)
                        {
                            btnSave.Enabled = false;
                        }
                        else
                        {
                            btnSave.Enabled = true;
                        }

                        cbTypeOfDoc.Text     = ds.Tables[0].Rows[0]["HAUMD_DOC_TYPE"].ToString();
                        txtDocNumber.Text    = ds.Tables[0].Rows[0]["HAUMD_DOC_NO"].ToString();
                        txtNameAsPerDoc.Text = ds.Tables[0].Rows[0]["HAUMD_NAME_AS_DOC"].ToString();
                        txtFatherAsDoc.Text  = ds.Tables[0].Rows[0]["HAUMD_FATHER_NAME"].ToString();
                        if (ds.Tables[0].Rows[0]["HAUMD_DOB"].ToString().Length > 0)
                        {
                            dtpDOBDate.Value = Convert.ToDateTime(ds.Tables[0].Rows[0]["HAUMD_DOB"].ToString());
                        }
                        if (cbTypeOfDoc.Text == "BANK ACCOUNT NUMBER")
                        {
                            txtBankAccIFSC.Text = ds.Tables[0].Rows[0]["HAUMD_BANK_ACC_IFSC"].ToString();
                        }
                        if (cbTypeOfDoc.Text == "DRIVING LICENSE" || cbTypeOfDoc.Text == "PASSPORT")
                        {
                            dtpExpDate.Value = Convert.ToDateTime(ds.Tables[0].Rows[0]["HAUMD_LICENCE_EXP"].ToString());
                        }
                        if (ds.Tables[0].Rows[0]["HAUMD_DOC_IMG"].ToString() != "")
                        {
                            GetImage((byte[])ds.Tables[0].Rows[0]["HAUMD_DOC_IMG"], "DOC");
                        }
                    }
                    else
                    {
                        flagUpdate1     = false;
                        btnSave.Enabled = true;

                        txtDocNumber.Text      = "";
                        txtNameAsPerDoc.Text   = "";
                        txtFatherAsDoc.Text    = "";
                        txtBankAccIFSC.Text    = "";
                        picDoc.BackgroundImage = null;
                        picDoc.Image           = null;
                    }
                }
                ds = null;
            }
        }