Esempio n. 1
0
    protected void DDLDeptName_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            DDLDesignation.DataSource     = BLayer.FillDesig(int.Parse(DDLDeptName.SelectedValue));
            DDLDesignation.DataValueField = "DesigId";
            DDLDesignation.DataTextField  = "DesigName";
            DDLDesignation.DataBind();
            DDLDesignation.Items.Insert(0, new ListItem("--Select Designation--", "0"));

            DDLDesignation.Focus();
        }
        catch (Exception ex)
        {
            Response.Write(ex.ToString());
        }
    }
    private void BindDesignations(int clubid)
    {
        DBconnection obj = new DBconnection();

        obj.SetCommandSP = "z_GetBODdesignation";
        obj.AddParam("@DistrictClubID", clubid);

        DataTable dt = new DataTable();

        dt = obj.ExecuteTable();

        DDLDesignation.DataTextField  = "designation";
        DDLDesignation.DataValueField = "id";

        DDLDesignation.DataSource = dt;
        DDLDesignation.DataBind();

        // DDLDesignation.Items.Insert(0, "Select");
    }
Esempio n. 3
0
    private void BindDesignations(int distID)
    {
        // int distID = int.Parse(Session["DistrictClubID"].ToString());

        BodBll obj = new BodBll();

        obj.ClubId = distID;

        DataTable dt = new DataTable();

        dt = obj.GetBodDesignationListByClubId();

        DDLDesignation.DataTextField  = "designation";
        DDLDesignation.DataValueField = "id";

        DDLDesignation.DataSource = dt;
        DDLDesignation.DataBind();

        // DDLDesignation.Items.Insert(0, "Select");
    }
Esempio n. 4
0
    protected void DDLDeptName_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            var DesigDs = from d in HRMLinq.Desig_Masts
                          where d.Dept_Id == int.Parse(DDLDeptName.SelectedValue)
                          orderby d.DesigName
                          select new { DesigId = d.Id, d.DesigName };

            DDLDesignation.DataSource     = DesigDs; //BLayer.FillDesig(int.Parse(DDLDeptName.SelectedValue));
            DDLDesignation.DataValueField = "DesigId";
            DDLDesignation.DataTextField  = "DesigName";
            DDLDesignation.DataBind();
            DDLDesignation.Items.Insert(0, new ListItem("--Select Designation--", "0"));
        }
        catch
        {
            Response.Redirect("~/ErrorPage.aspx");
        }
    }
Esempio n. 5
0
    protected void DispRecord(string pStrNavigation)
    {
        int IntId = 0;

        StrSql        = new StringBuilder();
        StrSql.Length = 0;
        if (pStrNavigation == "EXAC")
        {
            IntId = int.Parse(HidFldId.Value);
        }
        else if (pStrNavigation.Trim().ToUpper() == "FIRST")
        {
            StrSql.AppendLine("Select Top 1 Id From Emp_Mast Order By Id");
        }
        else if (pStrNavigation.Trim().ToUpper() == "NEXT")
        {
            if (HidFldId.Value == "")
            {
                LblMsg.Text = "Data not found";
                return;
            }
            StrSql.AppendLine("Select Top 1 Id From Emp_Mast Where Id > " + int.Parse(HidFldId.Value));
        }
        else if (pStrNavigation.Trim().ToUpper() == "PREV")
        {
            if (HidFldId.Value == "")
            {
                LblMsg.Text = "Data not found";
                return;
            }
            StrSql.AppendLine("Select Top 1 Id From Emp_Mast Where Id < " + int.Parse(HidFldId.Value) + " Order By Id Desc");
        }
        else if (pStrNavigation.Trim().ToUpper() == "LAST")
        {
            StrSql.AppendLine("Select Top 1 Id From Emp_Mast Order By Id Desc");
        }

        if (pStrNavigation != "EXAC")
        {
            dtTemp = new DataTable();
            dtTemp = SqlFunc.ExecuteDataTable(StrSql.ToString());
            if (dtTemp.Rows.Count != 0)
            {
                IntId = int.Parse(dtTemp.Rows[0]["Id"].ToString());
            }
        }

        StrSql        = new StringBuilder();
        StrSql.Length = 0;

        StrSql.AppendLine("Select E.Id,E.EmpName,E.EmpGroup,E.EMailId,E.MobNo,E.Password ");
        StrSql.AppendLine(",E.DeptId,E.DesigId,E.FJobTime,E.TJobTime,E.TotTime");
        StrSql.AppendLine(",E.BasicRate,Convert(Varchar(10),E.DOJ,103) As DOJ,Convert(Varchar(10),E.DOB,103) As DOB,E.Gender");
        StrSql.AppendLine(",E.CountryId,E.StateId,E.CityId");
        StrSql.AppendLine(",E.Address1,E.PinCode");
        StrSql.AppendLine(",E.Phone,E.BloodGroup,Convert(Varchar(10),E.LeftDate,103) As LeftDate");
        StrSql.AppendLine("From Emp_Mast E");
        StrSql.AppendLine("Where E.Id=" + IntId);

        dtTemp = new DataTable();
        dtTemp = SqlFunc.ExecuteDataTable(StrSql.ToString());

        if (dtTemp.Rows.Count == 0)
        {
            ClearAll();
            LblMsg.Text = "Data not found";
            return;
        }

        LblMsg.Text = "";

        HidFldId.Value  = IntId.ToString();
        TxtEmpName.Text = dtTemp.Rows[0]["EmpName"].ToString();

        //DDLDeptName.SelectedValue = dtTemp.Rows[0]["DeptId"].ToString();
        //DDLDesignation.SelectedValue = dtTemp.Rows[0]["DesigId"].ToString();

        DDLDeptName.Items.Clear();
        DDLDeptName.DataSource     = BLayer.FillDept();
        DDLDeptName.DataValueField = "DeptId";
        DDLDeptName.DataTextField  = "DeptName";
        DDLDeptName.DataBind();
        DDLDeptName.Items.Insert(0, new ListItem("--Select Department--", "0"));

        if (dtTemp.Rows[0]["DeptId"].ToString() != "")
        {
            DDLDeptName.SelectedValue = dtTemp.Rows[0]["DeptId"].ToString();
        }

        DDLDesignation.Items.Clear();
        DDLDesignation.DataSource     = BLayer.FillDesig();
        DDLDesignation.DataValueField = "DesigId";
        DDLDesignation.DataTextField  = "DesigName";
        DDLDesignation.DataBind();
        DDLDesignation.Items.Insert(0, new ListItem("--Select Designation--", "0"));

        if (dtTemp.Rows[0]["DesigId"].ToString() != "")
        {
            DDLDesignation.SelectedValue = dtTemp.Rows[0]["DesigId"].ToString();
        }

        DDLEmpGroup.SelectedValue = dtTemp.Rows[0]["EmpGroup"].ToString();

        TxtFJobTime.Text = dtTemp.Rows[0]["FJobTime"].ToString();
        TxtTJobTime.Text = dtTemp.Rows[0]["TJobTime"].ToString();
        TxtTotHours.Text = dtTemp.Rows[0]["TotTime"].ToString();

        double basicsal = ValueConvert.ValDouble(dtTemp.Rows[0]["BasicRate"].ToString());

        TxtBasicSal.Text = basicsal.ToString("00");

        TxtDOJ.Text = dtTemp.Rows[0]["DOJ"].ToString();
        TxtDOB.Text = dtTemp.Rows[0]["DOB"].ToString();

        rblGender.SelectedValue = dtTemp.Rows[0]["Gender"].ToString();

        TxtEMailId.Text = dtTemp.Rows[0]["EMailId"].ToString();

        //ddlCountry.SelectedValue = dtTemp.Rows[0]["CountryId"].ToString();
        //ddlState.SelectedValue = dtTemp.Rows[0]["StateID"].ToString();
        //ddlCity.SelectedValue = dtTemp.Rows[0]["CityId"].ToString();

        ddlCountry.Items.Clear();
        ddlCountry.DataSource     = BLayer.FillCountry();
        ddlCountry.DataValueField = "CountryId";
        ddlCountry.DataTextField  = "CountryName";
        ddlCountry.DataBind();
        ddlCountry.Items.Insert(0, new ListItem("--Select Country--", "0"));
        if (dtTemp.Rows[0]["CountryId"].ToString() != "")
        {
            ddlCountry.SelectedValue = dtTemp.Rows[0]["CountryId"].ToString();
        }

        ddlState.Items.Clear();
        ddlState.DataSource     = BLayer.FillState(int.Parse(ddlCountry.SelectedValue));
        ddlState.DataValueField = "StateId";
        ddlState.DataTextField  = "StateName";
        ddlState.DataBind();
        ddlState.Items.Insert(0, new ListItem("--Select State--", "0"));
        if (dtTemp.Rows[0]["StateID"].ToString() != "")
        {
            ddlState.SelectedValue = dtTemp.Rows[0]["StateID"].ToString();
        }

        ddlCity.Items.Clear();
        ddlCity.DataSource     = BLayer.FillCity(int.Parse(ddlState.SelectedValue));
        ddlCity.DataValueField = "CityId";
        ddlCity.DataTextField  = "CityName";
        ddlCity.DataBind();
        ddlCity.Items.Insert(0, new ListItem("--Select City--", "0"));
        if (dtTemp.Rows[0]["CityId"].ToString() != "")
        {
            ddlCity.SelectedValue = dtTemp.Rows[0]["CityId"].ToString();
        }

        TxtAddress1.Text = dtTemp.Rows[0]["Address1"].ToString();
        TxtPinCode.Text  = dtTemp.Rows[0]["PinCode"].ToString();
        TxtMobNo.Text    = dtTemp.Rows[0]["MobNo"].ToString();
        TxtPhone.Text    = dtTemp.Rows[0]["Phone"].ToString();

        if (dtTemp.Rows[0]["BloodGroup"].ToString() != "")
        {
            ddlBloodGrp.SelectedValue = dtTemp.Rows[0]["BloodGroup"].ToString();
        }
        else
        {
            ddlBloodGrp.SelectedIndex = 0;
        }

        TxtLeftDate.Text = dtTemp.Rows[0]["LeftDate"].ToString();
        TxtPassword.Text = dtTemp.Rows[0]["Password"].ToString();
    }