예제 #1
0
    protected void txtEmplname_TextChanged(object sender, EventArgs e)
    {
        string empid = string.Empty;

        if (txtEmplname.Text != "")
        {
            empid = txtEmplname.Text.Split('/')[txtEmplname.Text.Split('/').Length - 1];



            //  DataTable dtContactmaster = objContactmaster.GetAllCustomerName(Session["CompId"].ToString());
            DataTable dtEmpname = objEmpMaster.GetEmployeeMasterAllData(Session["CompId"].ToString());

            dtEmpname       = new DataView(dtEmpname, "Emp_Id='" + empid + "'", "", DataViewRowState.CurrentRows).ToTable();
            HidCustId.Value = empid;
            if (dtEmpname.Rows.Count > 0)
            {
                empid           = dtEmpname.Rows[0]["Emp_Id"].ToString();
                HidCustId.Value = empid;
            }
            else
            {
                DisplayMessage("Employee Not Exists");
                txtEmplname.Text = "";
                txtEmplname.Focus();
                //  HidCustId.Value = "";
                return;
            }
        }
    }
    public string GetEmployeeName(object empid)
    {
        string empname = string.Empty;

        DataTable dt = objEmp.GetEmployeeMasterAllData(Session["CompId"].ToString());

        dt = new DataView(dt, "Emp_Id='" + empid.ToString().Trim() + "'", "", DataViewRowState.CurrentRows).ToTable();

        if (dt.Rows.Count > 0)
        {
            empname = dt.Rows[0]["Emp_Name"].ToString();

            if (empname == "")
            {
                empname = "No Name";
            }
        }
        else
        {
            empname = "No Name";
        }

        return(empname);
    }
예제 #3
0
    public string GetEmpId(string empcode)
    {
        string empId = string.Empty;

        DataTable dt = objEmp.GetEmployeeMasterAllData(Session["CompId"].ToString());

        dt = new DataView(dt, "Emp_Code='" + empcode.ToString().Trim() + "'", "", DataViewRowState.CurrentRows).ToTable();

        if (dt.Rows.Count > 0)
        {
            empId = dt.Rows[0]["Emp_Id"].ToString();
        }


        return(empId);
    }