Example #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["Role"].ToString() == "11")
         {
             table.Visible           = false;
             txtEmployeecode.Text    = Session["UserId"].ToString();
             lbl1.Visible            = true;
             Panel1.Visible          = true;
             Panel3.Visible          = true;
             Panel5.Visible          = true;
             lbl5.Visible            = true;
             Gridview.Visible        = true;
             GridView1.Visible       = true;
             GridView5.Visible       = true;
             table1.Visible          = true;
             GridviewStudent.Visible = false;
             PanelPRAISE.Visible     = false;
             lblnote.Text            = "Note: For any queries please contact Directorate of Research ([email protected])";
             IncentiveBusiness obj = new IncentiveBusiness();
             DataTable         dt  = new DataTable();
             dt = obj.CountRemainingPoints(txtEmployeecode.Text);
             if (dt.Rows.Count > 0)
             {
                 GridView1.Columns[2].FooterText = "Total";
                 GridView1.Columns[3].FooterText = dt.Rows[0]["count1"].ToString();
                 GridView1.Columns[4].FooterText = dt.Rows[0]["count2"].ToString();
                 GridView1.DataSource            = dt;
                 GridView1.DataBind();
             }
             {
                 GridView1.DataBind();
             }
         }
         else
         {
             table.Visible        = true;
             txtEmployeecode.Text = "";
             lbl1.Visible         = false;
             Panel1.Visible       = false;
             Panel3.Visible       = false;
             Panel5.Visible       = true;
             lbl5.Visible         = true;
             IncentiveBusiness obj        = new IncentiveBusiness();
             string            membertype = obj.SelectMemberType(txtEmployeecode.Text.Trim());
             if (membertype == "S")
             {
                 GridviewStudent.Visible = true;
             }
             else
             {
                 Gridview.Visible = false;
             }
             Gridview.Visible  = false;
             GridView1.Visible = false;
             GridView5.Visible = true;
         }
     }
 }
    private void fnRecordExist(object sender, EventArgs e)
    {
        clearData();
        IncentiveBusiness obj = new IncentiveBusiness();

        IncentivePoint j        = new IncentivePoint();
        string         memberid = txtMemberId.Text.Trim();

        j.MemberId = memberid;
        bool result1 = obj.CheckMemberId(j.MemberId);

        if (result1 == false)
        {
            string CloseWindow1 = "alert('Member id doesnot exist')";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true);
            txtMemberId.Text = "";
            return;
        }
        string memebrtype = obj.SelectMemberType(j.MemberId);

        if (memebrtype != "M")
        {
            string CloseWindow1 = "alert('Member id doesnot exist')";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true);
            txtMemberId.Text = "";
            return;
        }

        int currenntYear = DateTime.Now.Year;
        int year         = Convert.ToInt32(PublicationYearwebConfig);

        int yeardiff = currenntYear - year;

        if (yeardiff < 0)
        {
            yeardiff = -(yeardiff);
        }
        DdlYear.Items.Add(new ListItem("Select", "0", true));
        for (int i = 0; i <= yeardiff; i++)
        {
            int yeatAppend = year + i;

            DdlYear.Items.Add(new ListItem(yeatAppend.ToString(), yeatAppend.ToString(), true));
            DdlYear.Items.Remove("2015");
            DdlYear.Items.Remove("2016");
        }

        DdlYear.DataBind();
        //DdlYear_SelectedIndexChanged1(sender, e);
    }
Example #3
0
    protected void Btnsearch_Click(object sender, EventArgs e)
    {
        lbl1.Visible      = true;
        Panel1.Visible    = true;
        Panel3.Visible    = true;
        Gridview.Visible  = true;
        GridView1.Visible = true;
        IncentiveBusiness obj        = new IncentiveBusiness();
        string            membertype = obj.SelectMemberType(txtEmployeecode.Text.Trim());

        if (membertype == "S")
        {
            GridviewStudent.DataBind();
            GridviewStudent.Visible = true;
            GridView1.Visible       = true;
            Gridview.Visible        = false;
            PanelPRAISE.Visible     = true;
            Panel5.Visible          = false;
            PanelPatent.Visible     = false;
        }
        else
        {
            GridviewStudent.Visible = false;
            Gridview.Visible        = true;
            PanelPRAISE.Visible     = false;
            Panel5.Visible          = true;
            PanelPatent.Visible     = true;
        }

        DataTable dt = new DataTable();

        dt = obj.CountRemainingPoints(txtEmployeecode.Text);
        if (dt.Rows.Count > 0)
        {
            GridView1.Columns[2].FooterText = "Total";
            GridView1.Columns[3].FooterText = dt.Rows[0]["count1"].ToString();
            GridView1.Columns[4].FooterText = dt.Rows[0]["count2"].ToString();
            GridView1.DataSource            = dt;
            GridView1.DataBind();
            GridView1.Visible = true;
        }
        {
            GridView1.Visible = true;
            GridView1.DataBind();
        }
    }
Example #4
0
    protected void Btnsearch_Click(object sender, EventArgs e)
    {
        lbl1.Visible      = true;
        Panel1.Visible    = true;
        Panel3.Visible    = true;
        Gridview.Visible  = true;
        GridView1.Visible = true;
        IncentiveBusiness obj         = new IncentiveBusiness();
        string            membertype  = obj.SelectMemberType(txtEmployeecode.Text.Trim());
        string            institution = obj.CheckInstitution(txtEmployeecode.Text.Trim());
        string            role        = Session["Role"].ToString();
        string            user        = Session["UserId"].ToString();
        ArrayList         rolelist    = new ArrayList();

        rolelist = obj.SelectCountOfRole(user);
        if (rolelist.Contains(18))
        {
            if (membertype != "M")
            {
                if (institution == Session["InstituteId"].ToString())
                {
                    GridviewStudent.DataBind();
                    GridviewStudent.Visible = true;
                    GridView1.Visible       = true;
                    Gridview.Visible        = false;
                    PanelPRAISE.Visible     = true;
                    Panel5.Visible          = false;
                }
                else
                {
                    Panel1.Visible          = false;
                    GridviewStudent.Visible = false;
                    Gridview.Visible        = false;
                    Panel1.Visible          = false;
                    GridviewStudent.Visible = false;
                    PanelPRAISE.Visible     = false;
                    Panel5.Visible          = false;
                    GridView5.Visible       = false;
                    lbl5.Visible            = false;
                    Panel3.Visible          = false;
                }
                if (institution == Session["InstituteId"].ToString())
                {
                    DataTable dt = new DataTable();
                    dt = obj.CountRemainingPoints(txtEmployeecode.Text);
                    if (dt.Rows.Count > 0)
                    {
                        GridView1.Columns[2].FooterText = "Total";
                        GridView1.Columns[3].FooterText = dt.Rows[0]["count1"].ToString();
                        GridView1.Columns[4].FooterText = dt.Rows[0]["count2"].ToString();
                        GridView1.DataSource            = dt;
                        GridView1.DataBind();
                        GridView1.Visible = true;
                    }
                    {
                        GridView1.Visible = true;
                        GridView1.DataBind();
                    }
                }
                else
                {
                    Gridview.Visible        = false;
                    Panel1.Visible          = false;
                    GridviewStudent.Visible = false;
                    PanelPRAISE.Visible     = false;
                    Panel5.Visible          = false;
                    GridView5.Visible       = false;
                    lbl5.Visible            = false;
                    Panel1.Visible          = false;
                    Panel3.Visible          = false;
                    GridviewStudent.Visible = false;
                }
            }
            else
            {
                Gridview.Visible  = false;
                GridView1.Visible = false;
            }
        }
        else if (rolelist.Contains(17))
        {
            if (membertype != "S")
            {
                if (institution == Session["InstituteId"].ToString())
                {
                    GridviewStudent.Visible = false;
                    Gridview.Visible        = true;
                    PanelPRAISE.Visible     = false;
                    Panel5.Visible          = true;
                    GridView5.Visible       = true;
                    lbl5.Visible            = true;
                }
                else
                {
                    Gridview.Visible        = false;
                    Panel1.Visible          = false;
                    GridviewStudent.Visible = false;
                    PanelPRAISE.Visible     = false;
                    Panel5.Visible          = false;
                    GridView5.Visible       = false;
                    lbl5.Visible            = false;
                    Panel1.Visible          = false;
                    Panel3.Visible          = false;
                    GridviewStudent.Visible = false;
                }
            }
            else
            {
                Gridview.Visible  = false;
                GridView1.Visible = false;
            }
        }
        else if ((rolelist.Contains(19)) || rolelist.Contains(7))
        {
            if (membertype == "S")
            {
                if (institution == Session["InstituteId"].ToString())
                {
                    GridviewStudent.DataBind();
                    GridviewStudent.Visible = true;
                    GridView1.Visible       = true;
                    Gridview.Visible        = false;
                    PanelPRAISE.Visible     = true;
                    Panel5.Visible          = false;
                }
                else
                {
                    Panel1.Visible          = false;
                    GridviewStudent.Visible = false;
                    Gridview.Visible        = false;
                    Panel1.Visible          = false;
                    GridviewStudent.Visible = false;
                    PanelPRAISE.Visible     = false;
                    Panel5.Visible          = false;
                    GridView5.Visible       = false;
                    lbl5.Visible            = false;
                    Panel3.Visible          = false;
                }
            }
            else
            {
                if (institution == Session["InstituteId"].ToString())
                {
                    GridviewStudent.Visible = false;
                    Gridview.Visible        = true;
                    PanelPRAISE.Visible     = false;
                    Panel5.Visible          = true;
                    GridView5.Visible       = true;
                    lbl5.Visible            = true;
                }
                else
                {
                    Gridview.Visible        = false;
                    Panel1.Visible          = false;
                    GridviewStudent.Visible = false;
                    PanelPRAISE.Visible     = false;
                    Panel5.Visible          = false;
                    GridView5.Visible       = false;
                    lbl5.Visible            = false;
                    Panel1.Visible          = false;
                    Panel3.Visible          = false;
                    GridviewStudent.Visible = false;
                }
            }
            if (institution == Session["InstituteId"].ToString())
            {
                DataTable dt = new DataTable();
                dt = obj.CountRemainingPoints(txtEmployeecode.Text);
                if (dt.Rows.Count > 0)
                {
                    GridView1.Columns[2].FooterText = "Total";
                    GridView1.Columns[3].FooterText = dt.Rows[0]["count1"].ToString();
                    GridView1.Columns[4].FooterText = dt.Rows[0]["count2"].ToString();
                    GridView1.DataSource            = dt;
                    GridView1.DataBind();
                    GridView1.Visible = true;
                }
                {
                    GridView1.Visible = true;
                    GridView1.DataBind();
                }
            }
            else
            {
                Gridview.Visible        = false;
                Panel1.Visible          = false;
                GridviewStudent.Visible = false;
                PanelPRAISE.Visible     = false;
                Panel5.Visible          = false;
                GridView5.Visible       = false;
                lbl5.Visible            = false;
                Panel1.Visible          = false;
                Panel3.Visible          = false;
                GridviewStudent.Visible = false;
            }
        }
        else
        {
            //if (Session["Role"].ToString() == "11")
            //{
            table.Visible           = false;
            txtEmployeecode.Text    = Session["UserId"].ToString();
            txtEmployeecode.Visible = false;
            lbl1.Visible            = true;
            Panel1.Visible          = true;
            Panel3.Visible          = true;
            Panel5.Visible          = true;
            lbl5.Visible            = true;
            Gridview.Visible        = true;
            GridView1.Visible       = true;
            GridView5.Visible       = true;
            table1.Visible          = true;
            GridviewStudent.Visible = false;
            PanelPRAISE.Visible     = false;
            lblnote.Text            = "Note: For any queries please contact Directorate of Research ([email protected])";
            //IncentiveBusiness obj = new IncentiveBusiness();
            DataTable dt = new DataTable();
            dt = obj.CountRemainingPoints(txtEmployeecode.Text);
            if (dt.Rows.Count > 0)
            {
                GridView1.Columns[2].FooterText = "Total";
                GridView1.Columns[3].FooterText = dt.Rows[0]["count1"].ToString();
                GridView1.Columns[4].FooterText = dt.Rows[0]["count2"].ToString();
                GridView1.DataSource            = dt;
                GridView1.DataBind();
            }
            {
                GridView1.DataBind();
            }
        }
        //else
        //{
        //    table.Visible = true;
        //    txtEmployeecode.Text = "";
        //    lbl1.Visible = false;
        //    Panel1.Visible = false;
        //    Panel3.Visible = false;
        //    Panel5.Visible = true;
        //    lbl5.Visible = true;
        //    //IncentiveBusiness obj = new IncentiveBusiness();
        //    string membertype1 = obj.SelectMemberType(txtEmployeecode.Text.Trim());
        //    if (membertype1 == "S")
        //    {
        //        GridviewStudent.Visible = true;
        //    }
        //    else
        //    {
        //        Gridview.Visible = false;
        //    }
        //    Gridview.Visible = false;
        //    GridView1.Visible = false;
        //    GridView5.Visible = true;
        //}
    }