Пример #1
0
    protected void TxtEmployeeId_TextChanged(object sender, EventArgs e)
    {
        string empid = string.Empty;

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

            DataTable dtEmp = ObjEmp.GetEmployeeMaster(strCompId);

            dtEmp = new DataView(dtEmp, "Emp_Code='" + empid + "'", "", DataViewRowState.CurrentRows).ToTable();

            if (dtEmp.Rows.Count > 0)
            {
                empid          = dtEmp.Rows[0]["Emp_Id"].ToString();
                HidEmpId.Value = empid;
            }
            else
            {
                DisplayMessage("Employee Not Exists");
                TxtEmployeeId.Text = "";
                TxtEmployeeId.Focus();
                HidEmpId.Value = "";
                return;
            }
        }
    }
Пример #2
0
    protected void btnAddDocument_Click(object sender, EventArgs e)
    {
        if (TxtEmployeeId.Enabled == true)
        {
            DisplayMessage("First Of All Search Directory");
            TxtEmployeeId.Focus();

            return;
        }

        Paneladddocument.Visible = true;

        ddlDocumentName.Focus();
    }
Пример #3
0
    protected void btnSaveLeave_Click(object sender, EventArgs e)
    {
        FillGrid();
        int       Directoryid;
        DataTable dt = (DataTable)Session["File"];
        //dt = new DataView(dt, "Brand_Id='" + Session["BrandId"].ToString() + "' and Location_Id='" + Session["LocId"].ToString() + "' ", "", DataViewRowState.CurrentRows).ToTable();


        DataTable DtDirectory = new DataTable();

        DtDirectory = (DataTable)Session["Dir"];

        if (TxtEmployeeId.Text == "")
        {
            TxtEmployeeId.Focus();
            DisplayMessage("Enter Employee Name");
            return;
        }
        TxtEmployeeId.Enabled = false;

        DtDirectory = new DataView(DtDirectory, "Directory_Name ='" + HidEmpId.Value + "'", "", DataViewRowState.CurrentRows).ToTable();

        if (DtDirectory.Rows.Count > 0)
        {
            Directoryid = Convert.ToInt32(DtDirectory.Rows[0]["Id"].ToString());
            dt          = new DataView(dt, "Directory_Id =" + Directoryid + "", "", DataViewRowState.CurrentRows).ToTable();
        }

        if (DtDirectory.Rows.Count > 0)
        {
            if (dt.Rows.Count > 0)
            {
                gvFileMaster.DataSource = dt;
                gvFileMaster.DataBind();
            }
            else
            {
                dt.Clear();
                gvFileMaster.DataSource = dt;
                gvFileMaster.DataBind();
                DisplayMessage("Directory Exists");
            }
            ddlDirectory.SelectedValue = DtDirectory.Rows[0]["Id"].ToString();
        }
        else
        {
            DataTable Dtclear = new DataTable();
            gvFileMaster.DataSource = Dtclear;
            gvFileMaster.DataBind();
            int    b            = 0;
            string NewDirectory = Server.MapPath(HidEmpId.Value);
            int    i            = CreateDirectoryIfNotExist(NewDirectory.ToString());
            DisplayMessage("Directory Created");
            b = objDir.InsertDirectorymaster(strCompId, HidEmpId.Value, "", "0", "", "", "", false.ToString(), DateTime.Now.ToString(), true.ToString(), Session["UserId"].ToString(), DateTime.Now.ToString(), Session["UserId"].ToString(), DateTime.Now.ToString());


            BindDirectoryList();
            DataTable DtDir = new DataTable();
            string    Dirid = "0";
            DtDir = objDir.getDirectoryMaster(strCompId, Dirid);
            DtDir = new DataView(DtDir, "Directory_Name ='" + HidEmpId.Value + "'", "", DataViewRowState.CurrentRows).ToTable();



            ddlDirectory.SelectedValue = DtDir.Rows[0]["Id"].ToString();
        }
    }