protected void txtMemberId_TextChanged(object sender, EventArgs e)
    {
        IncentivePoint j = new IncentivePoint();

        DdlYear.Items.Clear();
        fnRecordExist(sender, e);
    }
    protected void DdlYear_SelectedIndexChanged1(object sender, EventArgs e)
    {
        IncentiveBusiness obj = new IncentiveBusiness();
        IncentivePoint    j   = new IncentivePoint();
        int    pubCount       = 0;
        string memberid       = txtMemberId.Text.Trim();
        string year           = DdlYear.SelectedValue;

        txtPointsAwarded.Text = "";
        txtRemarks.Text       = "";
        j.MemberId            = memberid;
        j.Year = Convert.ToInt32(year);

        // string currentbalance = obj.SelectMemberCurrentBal(memberid);
        string currentbalance = obj.SelectYearWisePoints(memberid, year);

        j.CurrentBalance = Convert.ToDouble(currentbalance);
        txtcurbal.Text   = j.CurrentBalance.ToString();

        j                = obj.SelectPublicationCount(memberid, year);
        pubCount         = j.TotalNoOfPublications;
        txtPubcount.Text = pubCount.ToString();
        if (Convert.ToInt32(pubCount) >= Convert.ToInt32(ThresholdPubNowebConfig))
        {
            if (j.isAwarded == "Y")
            {
                txtPointsAwarded.Enabled = false;
                txtPointsAwarded.Text    = j.Points.ToString();
                lblNote.Text             = "Note: Point is already awarded.";
                lblNote.Visible          = true;
                btnSave.Enabled          = false;
            }
            else
            {
                txtPointsAwarded.Enabled = true;
                double value = (Convert.ToDouble(currentbalance) * 25) / 100;
                value = Math.Round(value, 2);
                txtPointsAwarded.Text = value.ToString();
                lblNote.Visible       = false;
                lblNote.Text          = "Note: Minimum System awarded point is '0.25'.";
                lblNote.Visible       = true;
                btnSave.Enabled       = true;
            }
        }
        else
        {
            txtPointsAwarded.Enabled = false;
            string CloseWindow1 = "alert('To enter points awarded, publication count must be greater than or euqual to 6')";
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "CloseWindow", CloseWindow1, true);
            txtMemberId.Text = "";
            DdlYear.Items.Clear();
            txtcurbal.Text        = "";
            txtPubcount.Text      = "";
            txtPointsAwarded.Text = "";
            btnSave.Enabled       = false;
            lblNote.Visible       = false;
            lblNote1.Visible      = false;
            return;
        }
    }
    protected void GridViewPatentSearch_SelectedIndexChanged(object sender, EventArgs e)
    {
        txtmemberPatent.Text     = "";
        TxtcurrentPatent.Text    = "";
        txttotalPointPatent.Text = "";
        //txtBasePoint.Text = "";
        //txtSNIPSJRPoint.Text = "";
        //txtThresholdPoint.Text = "";
        txttotalPointPatent.Text     = "";
        txtreferencePatent.Text      = "";
        btnupdatePatent.Enabled      = true;
        GridViewPatentSearch.Visible = true;
        GridViewRow row      = GridViewPatentSearch.SelectedRow;
        string      memberid = row.Cells[1].Text;

        txtmemberPatent.Text    = row.Cells[1].Text;
        txtreferencePatent.Text = row.Cells[3].Text;

        PatentBusiness busobj = new PatentBusiness();
        Patent         obj    = new Patent();

        obj = busobj.SelectPatentData(memberid, row.Cells[3].Text.Trim());
        //int ThresholdPublicationNo = Convert.ToInt16(ConfigurationManager.AppSettings["ThresholdPublicationNo"]);
        //int count = busobj.CountThresholdPublicationPoint(obj);
        //point 3 (crosses 6 publication) is awarded once in a year
        //if (count > ThresholdPublicationNo)
        //{
        //    if (obj.MUNonMU == "M")
        //    {
        //        txtThresholdPoint.Enabled = true;
        //    }
        //    else
        //    {
        //        txtThresholdPoint.Enabled = false;
        //    }
        //}
        //else
        //{
        //    txtThresholdPoint.Enabled = false;
        //    txtThresholdPoint.Text = "";
        //}

        //if (obj.AuthorType == "P" || obj.isCorrAuth == "Y")
        //{
        //    txtSNIPSJRPoint.Enabled = true;
        //}
        //else
        //{
        //    txtSNIPSJRPoint.Enabled = true;
        //    txtSNIPSJRPoint.Text = "";
        //}

        IncentivePoint obj1 = new IncentivePoint();

        obj1 = busobj.SelectPatentMemberCurBalance(memberid);
        TxtcurrentPatent.Text = obj1.CurrentBalance.ToString();
    }
Example #4
0
 public bool AdditionalPointAward(string memberid, IncentivePoint j)
 {
     try
     {
         return(obj.AdditionalPointAward(memberid, j));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #5
0
 public bool InsertUtilizationPoint(IncentivePoint data)
 {
     try
     {
         return(obj.InsertUtilizationPoint(data));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #6
0
    //Ashwini


    public bool UpdateCurBal(IncentivePoint Id)
    {
        try
        {
            return(obj.UpdateCurBal(Id));
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    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 #8
0
    protected void popSelected(Object sender, EventArgs e)
    {
        txtboxMemberId.Text   = "";
        txtcurbal.Text        = "";
        txtadjustment.Text    = "";
        txtRemarks.Text       = "";
        btnUpdate.Enabled     = true;
        popGridSearch.Visible = true;
        GridViewRow row      = popGridSearch.SelectedRow;
        string      memberid = row.Cells[1].Text;

        txtboxMemberId.Text = row.Cells[1].Text;
        IncentiveBusiness B   = new IncentiveBusiness();
        IncentivePoint    obj = new IncentivePoint();

        obj            = B.SelectMemberCurBalance(memberid);
        txtcurbal.Text = obj.CurrentBalance.ToString();
    }
Example #9
0
 public static double SelectMember(string Vid)
 {
     if (!(string.IsNullOrEmpty(Vid)))
     {
         IncentiveBusiness v   = new IncentiveBusiness();
         PublishData       obj = new PublishData();
         obj = v.SelectMemberDetails(Vid);
         if (obj.CurrentBalance != 0.0)
         {
             return(obj.CurrentBalance);
         }
         else
         {
             return(0.00);
         }
     }
     else
     {
         return(0.00);
     }
 }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (!Page.IsValid)
        {
            return;
        }
        try
        {
            IncentiveBusiness obj = new IncentiveBusiness();
            IncentivePoint    j   = new IncentivePoint();

            if (txtMemberId.Text.Trim() == "")
            {
                string CloseWindow1 = "alert('Please enter member id')";
                ScriptManager.RegisterStartupScript(EditUpdatePanel, EditUpdatePanel.GetType(), "alert", CloseWindow1, true);
                return;
            }
            string memberid      = txtMemberId.Text.Trim();
            string year          = DdlYear.SelectedValue;
            string pointsAwarded = txtPointsAwarded.Text.Trim();
            j.MemberId = memberid;
            j.Year     = Convert.ToInt32(year);


            j.Points         = Convert.ToDouble(pointsAwarded);
            j.TotalPoint     = j.Points;
            j.ThresholdPoint = j.Points;
            string currentbalance = obj.SelectMemberCurrentBal(memberid);
            j.CurrentBalance = Convert.ToDouble(currentbalance);
            j.CurrentBalance = j.CurrentBalance + j.TotalPoint;
            j.Remarks        = txtRemarks.Text;
            bool result = false;


            result = obj.AdditionalPointAward(memberid, j);

            if (result == true)
            {
                SendMail();
                string CloseWindow1 = "alert('Additional Points Saved successfully')";
                ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "CloseWindow", CloseWindow1, true);
                btnSave.Enabled       = false;
                txtPointsAwarded.Text = "";
                txtMemberId.Text      = "";
                txtcurbal.Text        = "";
                txtRemarks.Text       = "";
                lblNote.Visible       = false;
                lblNote1.Visible      = false;
                DdlYear.Items.Clear();
            }
            else
            {
                string CloseWindow1 = "alert('problem while saving')";
                ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "CloseWindow", CloseWindow1, true);
                btnSave.Enabled = false;
            }
        }
        catch (Exception ex)
        {
            string CloseWindow1 = "alert('problem while saving points')";
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "CloseWindow", CloseWindow1, true);
            btnSave.Enabled = true;
            log.Error(ex.Message);
            log.Error(ex.StackTrace);
        }
    }
Example #11
0
    protected void MemberIDChanged(object sender, EventArgs e)
    {
        txtCurrentBalance.Text = "";
        txtUtilization.Text    = "";
        txtRemarks.Text        = "";
        txtOldBalance.Text     = "";
        btnSave.Enabled        = true;
        string   memberid = txtID.Text.Trim();
        User     u        = new User();
        Business b        = new Business();

        u = b.findmembername(memberid);
        txtMembername.Text = u.membername;
        IncentiveBusiness B    = new IncentiveBusiness();
        IncentivePoint    obj  = new IncentivePoint();
        string            inst = Session["InstituteId"].ToString();
        string            role = Session["Role"].ToString();

        obj = B.SelectMemberCurBalanceInstitutewise(memberid, inst, role);
        if (obj.MemberId != null)
        {
            txtCurrentBalance.Text  = obj.CurrentBalance.ToString();
            txtOldBalance.Text      = obj.OpeningBalance.ToString();
            txtUtilizationDate.Text = DateTime.Now.ToShortDateString();

            string member     = txtmidSearch.Text.ToString();
            string membername = txtmnameSearch.Text.ToString();


            if (role == "7")
            {
                DataSet ds = B.SelectMembersInstitutewise(inst, memberid, u.membername);

                Panel1.Visible           = true;
                popGridSearch.DataSource = ds;
                popGridSearch.DataBind();
                popGridSearch.Visible = true;
                Panel4.Visible        = true;
            }
            else if (role == "17")
            {
                DataSet ds1 = B.SelectFacultyInstitutewise(inst, memberid, u.membername);
                Panel1.Visible           = true;
                popGridSearch.DataSource = ds1;
                popGridSearch.DataBind();
                popGridSearch.Visible = true;
                Panel4.Visible        = true;
            }
            else
            {
                DataSet ds2 = B.SelectStudentInstitutewise(inst, memberid, u.membername);
                if (u.MUNonMU != "M")
                {
                    Panel1.Visible           = true;
                    popGridSearch.DataSource = ds2;
                    popGridSearch.DataBind();
                    popGridSearch.Visible = true;
                    Panel4.Visible        = true;
                }
            }
            GridView2.Visible = true;
            Label1.Visible    = true;
        }

        DataTable dt = new DataTable();

        dt = B.CountUtilizationPoints(memberid);
        if (dt.Rows.Count > 0)
        {
            GridView2.Columns[2].FooterText = "Total";
            GridView2.Columns[3].FooterText = dt.Rows[0]["count1"].ToString();
            GridView2.Columns[4].FooterText = dt.Rows[0]["count2"].ToString();
            GridView2.DataSource            = dt;
            GridView2.DataBind();
        }
        else
        {
            GridView2.DataBind();
        }
    }
Example #12
0
 protected void BtnSave_Click(object sender, EventArgs e)
 {
     if (!Page.IsValid)
     {
         return;
     }
     try
     {
         if (ChkTypeOfUtilization.SelectedValue == "UTO")
         {
             if (txtOldBalance.Text == "0")
             {
                 string CloseWindow1 = "alert('Old scheme is zero.Cannot be used for Utilization')";
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true);
                 return;
             }
             if (Convert.ToDouble(txtOldBalance.Text) < Convert.ToDouble(txtUtilization.Text.Trim()))
             {
                 string CloseWindow1 = "alert('Utilization point must be eqaul or less than old scheme')";
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true);
                 return;
             }
         }
         else
         {
             if (txtCurrentBalance.Text == "0")
             {
                 string CloseWindow1 = "alert('Current  scheme is zero.Cannot be used for Utilization')";
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true);
                 return;
             }
             if (Convert.ToDouble(txtCurrentBalance.Text) < Convert.ToDouble(txtUtilization.Text.Trim()))
             {
                 string CloseWindow1 = "alert('Utilization point must be eqaul or less than current scheme')";
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true);
                 return;
             }
         }
         IncentivePoint obj = new IncentivePoint();
         obj.MemberId    = txtID.Text.Trim();
         obj.Utilization = Convert.ToDouble(txtUtilization.Text.Trim());
         obj.Remarks     = txtRemarks.Text.Trim();
         if (ChkTypeOfUtilization.SelectedValue == "UTN")
         {
             obj.CurrentBalance = Convert.ToDouble(txtCurrentBalance.Text.Trim());
             obj.CurrentBalance = obj.CurrentBalance - obj.Utilization;
         }
         else
         {
             obj.CurrentBalance = Convert.ToDouble(txtOldBalance.Text.Trim());
             obj.CurrentBalance = obj.CurrentBalance - obj.Utilization;
         }
         obj.Utilization     = Convert.ToDouble("-" + txtUtilization.Text.Trim());
         obj.TransactionType = ChkTypeOfUtilization.SelectedValue;
         obj.UtilizationType = ChkTypeOfUtilization.SelectedValue;
         // obj.UtilizationType = "UTN";
         obj.UtilizationDate = Convert.ToDateTime(txtUtilizationDate.Text.Trim());
         bool result1 = B.InsertUtilizationPoint(obj); //Business layer
         if (result1 == true)
         {
             string CloseWindow1 = "alert('Utilization point entered successfully')";
             //ScriptManager.RegisterStartupScript(EditUpdatePanel, EditUpdatePanel.GetType(), "alert", CloseWindow1, true);
             ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true);
             btnSave.Enabled = false;
             Label1.Visible  = true;
             DataTable dt = new DataTable();
             dt = B.CountUtilizationPoints(txtID.Text.Trim());
             if (dt.Rows.Count > 0)
             {
                 GridView2.Columns[2].FooterText = "Total";
                 GridView2.Columns[3].FooterText = dt.Rows[0]["count1"].ToString();
                 GridView2.Columns[4].FooterText = dt.Rows[0]["count2"].ToString();
                 GridView2.DataSource            = dt;
                 GridView2.DataBind();
             }
             {
                 GridView2.DataBind();
             }
             GridView2.Visible = true;
             if (ChkTypeOfUtilization.SelectedValue == "UTN")
             {
                 obj.CurrentBalance     = Convert.ToDouble(txtCurrentBalance.Text.Trim());
                 txtCurrentBalance.Text = (obj.CurrentBalance - Convert.ToDouble(txtUtilization.Text.Trim())).ToString();
             }
             else
             {
                 obj.CurrentBalance = Convert.ToDouble(txtOldBalance.Text.Trim());
                 txtOldBalance.Text = (obj.CurrentBalance - Convert.ToDouble(txtUtilization.Text.Trim())).ToString();
             }
             txtUtilization.Text     = "";
             txtRemarks.Text         = "";
             txtUtilizationDate.Text = DateTime.Now.ToShortDateString();
         }
         else
         {
             string CloseWindow1 = "alert('Problem while saving data')";
             ScriptManager.RegisterStartupScript(EditUpdatePanel, EditUpdatePanel.GetType(), "alert", CloseWindow1, true);
             btnSave.Enabled = true;
         }
     }
     catch (Exception ex)
     {
         log.Error(ex.StackTrace);
         log.Error(ex.Message);
         log.Error("Error!!!!!!!!!!!!!!!! ");
         ClientScript.RegisterStartupScript(Page.GetType(), "validation1", "<script language='javascript'>alert('Error!!!!!!!!!!')</script>");
     }
 }
Example #13
0
    protected void popSelected(Object sender, EventArgs e)
    {
        txtOldBalance.Text     = "";
        txtID.Text             = "";
        txtCurrentBalance.Text = "";
        txtUtilization.Text    = "";
        txtRemarks.Text        = "";
        btnSave.Enabled        = true;
        popGridSearch.Visible  = true;
        GridViewRow row      = popGridSearch.SelectedRow;
        string      memberid = row.Cells[1].Text;

        txtID.Text = row.Cells[1].Text;

        txtMembername.Text = HttpUtility.HtmlDecode(row.Cells[2].Text);
        //string inst = row.Cells[3].Text;
        IncentiveBusiness B   = new IncentiveBusiness();
        IncentivePoint    obj = new IncentivePoint();

        obj = B.SelectMemberCurBalance(memberid);
        txtCurrentBalance.Text  = obj.CurrentBalance.ToString();
        txtOldBalance.Text      = obj.OpeningBalance.ToString();
        txtUtilizationDate.Text = DateTime.Now.ToShortDateString();
        //string inst = Session["InstituteId"].ToString();
        string UserId     = Session["UserId"].ToString();
        string member     = row.Cells[1].Text;
        string membername = row.Cells[2].Text;
        string inst       = row.Cells[3].Text;
        string role       = Session["Role"].ToString();

        if (role == "7")
        {
            DataSet ds = B.SelectMembersInstitutewise(inst, member, membername);
            Panel1.Visible           = true;
            popGridSearch.DataSource = ds;
            popGridSearch.DataBind();
            popGridSearch.Visible = true;
        }
        else if (role == "17")
        {
            DataSet ds1 = B.SelectFacultyInstitutewise(inst, member, membername);
            Panel1.Visible           = true;
            popGridSearch.DataSource = ds1;
            popGridSearch.DataBind();
            popGridSearch.Visible = true;
        }
        else
        {
            DataSet ds2 = B.SelectStudentInstitutewise(inst, member, membername);
            Panel1.Visible           = true;
            popGridSearch.DataSource = ds2;
            popGridSearch.DataBind();
            popGridSearch.Visible = true;
        }
        Panel4.Visible    = true;
        GridView2.Visible = true;
        Label1.Visible    = true;

        DataTable dt = new DataTable();

        dt = B.CountUtilizationPoints(memberid);
        if (dt.Rows.Count > 0)
        {
            GridView2.Columns[2].FooterText = "Total";
            GridView2.Columns[3].FooterText = dt.Rows[0]["count1"].ToString();
            GridView2.Columns[4].FooterText = dt.Rows[0]["count2"].ToString();
            GridView2.DataSource            = dt;
            GridView2.DataBind();
        }
        {
            GridView2.DataBind();
        }
    }
    protected void popSelected(Object sender, EventArgs e)
    {
        txtboxMemberId.Text  = "";
        txtcurbal.Text       = "";
        txtRemarks.Text      = "";
        txtBasePoint.Text    = "";
        txtSNIPSJRPoint.Text = "";
        //txtThresholdPoint.Text = "";
        txtTotalPoint.Text    = "";
        txtReferenceId.Text   = "";
        btnUpdate.Enabled     = true;
        popGridSearch.Visible = true;
        GridViewRow row      = popGridSearch.SelectedRow;
        string      memberid = row.Cells[1].Text;

        txtboxMemberId.Text = row.Cells[1].Text;
        txtReferenceId.Text = row.Cells[3].Text;

        IncentiveBusiness busobj = new IncentiveBusiness();
        PublishData       obj    = new PublishData();

        obj = busobj.SelectPublicationData(memberid, row.Cells[3].Text.Trim());
        int ThresholdPublicationNo = Convert.ToInt16(ConfigurationManager.AppSettings["ThresholdPublicationNo"]);
        int count = busobj.CountThresholdPublicationPoint(obj);

        obj = busobj.getIsStudentAuthor(txtReferenceId.Text);
        //point 3 (crosses 6 publication) is awarded once in a year
        //if (count > ThresholdPublicationNo)
        //{
        //    if (obj.MUNonMU == "M")
        //    {
        //        txtThresholdPoint.Enabled = true;
        //    }
        //    else
        //    {
        //        txtThresholdPoint.Enabled = false;
        //    }
        //}
        //else
        //{
        //    txtThresholdPoint.Enabled = false;
        //    txtThresholdPoint.Text = "";
        //}

        if (obj.AuthorType == "P" || obj.isCorrAuth == "Y")
        {
            txtSNIPSJRPoint.Enabled = true;
        }
        else
        {
            txtSNIPSJRPoint.Enabled = true;
            txtSNIPSJRPoint.Text    = "";
        }

        IncentivePoint obj1 = new IncentivePoint();

        obj1                 = busobj.SelectMemberCurBalance(memberid);
        txtcurbal.Text       = obj1.CurrentBalance.ToString();
        Session["IsStudent"] = obj.IsStudentAuthor;
        Session["Title"]     = obj.TitleWorkItem;
    }