protected void ddl_emp_SelectedIndexChanged(object sender, EventArgs e)
    {
        string str = "";

        str = "select ESS.ECODE,ESS.BASIC,ESS.PAY_BAND,ESS.CUR_PAY_GRADE,ESS.IT_Amount,MEM.Emp_Name,MEM.DATE_OF_BIRTH,ESS.GPF_ACCT_NO from  M_Emp_mast MEM inner join EMP_SALARY_STRUCTURE ESS ON MEM.ECODE=ESS.ECODE Where  ESS.ECODE='" + ddl_emp.SelectedValue + "'";

        DataTable dt = SQL_DBCS.ExecuteDataTable(str);

        if (dt.Rows.Count > 0)
        {
            lblShowName.Text = dt.Rows[0]["EMP_NAME"].ToString();

            lblPersonalNo.Text = dt.Rows[0]["ECODE"].ToString();
            lblBasicPay.Text   = dt.Rows[0]["BASIC"].ToString();
            lblPayAccount.Text = dt.Rows[0]["GPF_ACCT_NO"].ToString();
            //lblGPFNo.Text = dt.Rows[0]["GPF_ACCT_NO"].ToString();
            // lblRank.Text = ddlEmpType.SelectedItem.ToString();
            cc.FillDDL(ref ddlHdtrOffice, "---Select Department---", "DepartmentName", "DepartmentCode", "M_Department");
            ddlHdtrOffice.SelectedIndex = 1;
            lblCorpOffice.Text          = ddlHdtrOffice.SelectedItem.ToString();


            BindRefrenceno();
        }
        else
        {
            lblShowName.Visible = false;
        }

        BindRefrenceno();
    }
    protected void ddl_emp_SelectedIndexChanged(object sender, EventArgs e)
    {
        string str = "";

        str = "select ESS.ECODE,ESS.BASIC,ESS.PAY_BAND,ESS.CUR_PAY_GRADE,ESS.IT_Amount,MEM.Emp_Name,MEM.DATE_OF_BIRTH,ESS.GPF_ACCT_NO from  M_Emp_mast MEM inner join EMP_SALARY_STRUCTURE ESS ON MEM.ECODE=ESS.ECODE Where  ESS.ECODE='" + ddl_emp.SelectedValue + "'";

        // str = "select EMP_NAME,ECODE from M_Emp_mast where ECODE='" + ddl_emp.SelectedValue + "'";
        DataTable dt = SQL_DBCS.ExecuteDataTable(str);

        if (dt.Rows.Count > 0)
        {
            lblShowName.Text = dt.Rows[0]["EMP_NAME"].ToString();
            lblLevel.Text    = dt.Rows[0]["CUR_PAY_GRADE"].ToString();
            lblCell.Text     = dt.Rows[0]["PAY_BAND"].ToString();
            lblBasicPay.Text = dt.Rows[0]["BASIC"].ToString();
            lblDoB.Text      = dt.Rows[0]["DATE_OF_BIRTH"].ToString();
            lblGPFNo.Text    = dt.Rows[0]["GPF_ACCT_NO"].ToString();
            lblRank.Text     = ddlEmpType.SelectedItem.ToString();

            BindRefrenceno();
        }
        else
        {
            lblShowName.Visible = false;
        }
    }
    public void binddesig_type()
    {
        string    str = "select DES_Type_Name, DES_Type_Id from M_Designation_Type";
        DataTable dt  = SQL_DBCS.ExecuteDataTable(str);

        if (dt.Rows.Count > 0)
        {
            ddlEmpType.DataSource     = dt;
            ddlEmpType.DataTextField  = "DES_Type_Name";
            ddlEmpType.DataValueField = "DES_Type_Id";
            ddlEmpType.DataBind();
            ddlEmpType.Items.Insert(0, new ListItem("--Select--", "0"));
        }
    }
    protected void bind_FinancialYear()
    {
        try
        {
            CultureInfo Cult         = new CultureInfo("hi-IN");
            int         previousyear = Convert.ToDateTime(DateTime.Now, Cult).Year - 1;
            int         currentyear  = Convert.ToDateTime(DateTime.Now, Cult).Year;
            string      str          = "select * from [M_Financial_Year] order by year_id asc";
            DataTable   dt           = SQL_DBCS.ExecuteDataTable(str);


            if (dt.Rows.Count > 0)
            {
                ddlFinancial.DataTextField  = "fin_year";
                ddlFinancial.DataValueField = "fin_year";
                ddlFinancial.DataSource     = dt;
                ddlFinancial.DataBind();

                ddlFinancial.Items.Insert(0, "--Select--");
            }
            int year = Convert.ToDateTime(DateTime.Now).Year;
            year = Convert.ToDateTime(DateTime.Now).Year;
            if (year == 2019)
            {
                ddlFinancial.SelectedValue = "2019-2020";
            }
            else if (year == 2020)
            {
                ddlFinancial.SelectedValue = "2020-2021";
            }
            else if (year == 2021)
            {
                ddlFinancial.SelectedValue = "2021-2022";
            }
            else if (year == 2022)
            {
                ddlFinancial.SelectedValue = "2022-2023";
            }
        }
        catch (Exception ex)
        {
            Messagebox.Show(ex.Message);
        }
    }
Exemple #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["UserID"] == null)
            {
                Response.Redirect("~\\Login.aspx");
            }
            else
            {
                string    str    = "~" + Request.FilePath;
                DataTable dtYear = new DataTable();
                dtYear = cc.EQ("select dbo.FIN_YEAR('" + Convert.ToDateTime(DateTime.Now).ToString("yyyy-MM-dd") + "')");
                if (Session["FinYear"].ToString().Trim() == dtYear.Rows[0][0].ToString().Trim())
                {
                    btnSave.Enabled  = true;
                    btnReset.Enabled = true;
                }
                else
                {
                    btnSave.Enabled  = false;
                    btnReset.Enabled = false;
                }
                string Userid = Session["UserID"].ToString();
                if (!cc.FormAuthorize(Userid, str))
                {
                    Response.Redirect("~\\MessagePage.aspx");
                }
            }
            BindgrdApplForMendatoryDocs();
            cc.FillDDL2(ref ddlVendor, "---Select---", "V_Name", "V_Code", "Master.VENDOR");

            if (Session["TypeCode"] != null)
            {
                ddlVendor.SelectedValue = Session["TypeCode"].ToString();
                ddlVendor.Enabled       = false;

                string    strDistributor = "SELECT V_CODE, Distb_CODE, Distb_NAME, Status FROM Master.Distributor WHERE V_Code='" + ddlVendor.SelectedValue.Trim() + "' And Status='A'";
                DataTable dtDistributor  = SQL_DBCS.ExecuteDataTable(strDistributor);
                ddlDistributor.DataSource     = dtDistributor;
                ddlDistributor.DataTextField  = "Distb_NAME";
                ddlDistributor.DataValueField = "Distb_CODE";
                ddlDistributor.DataBind();
                ddlDistributor.Items.Insert(0, "---Select---");
                ddlDistributor.SelectedIndex = 0;

                //cc.FillDDLFrom2(ref ddlDistributor, "---Select---", "Distb_NAME", "Distb_CODE", "Master.Distributor", "V_Code", ddlVendor.SelectedValue.Trim());
                txtApplNo.Focus();
            }
            BindgrdgrdUploadedMendatoryDocs();


            if (Request.QueryString["ApplNo"] != null)
            {
                //txtApplNo.Text = Request.QueryString["ApplNo"].ToString();
                string SQL = "", App_no;
                App_no = Request.QueryString["ApplNo"].ToString();
                SQL    = @"SELECT App_No,Name,V_NAME,B_NAME,D_NAME FROM Trans.APPLICATIONS  
INNER JOIN Master.VILLMST ON Trans.APPLICATIONS.V_CODE=Master.VILLMST.V_CODE
INNER JOIN Master.DSTMST ON Trans.APPLICATIONS.D_Code=Master.DSTMST.D_CODE
INNER JOIN Master.BLOCKMST ON Master.DSTMST.D_CODE = Master.BLOCKMST.D_CODE WHERE APP_NO='" + App_no + "'";
                DataTable dt = new DataTable();
                dt = cc.EQ(SQL);
                if (dt.Rows.Count > 0)
                {
                    lblAppNo.Text      = dt.Rows[0]["App_No"].ToString();
                    lblFarmerName.Text = dt.Rows[0]["Name"].ToString();
                    lblAddress.Text    = "Village:" + dt.Rows[0]["V_NAME"].ToString() + ",  Block:" + dt.Rows[0]["B_NAME"].ToString() + ",  District:" + dt.Rows[0]["D_NAME"].ToString();
                }
            }
        }
    }