protected void btnSendMail_Click(object sender, EventArgs e) { if (!Page.IsValid) { return; } try { IncentiveBusiness b = new IncentiveBusiness(); EmailDetails details = new EmailDetails(); SendMailObject obj = new SendMailObject(); details.FromEmail = ConfigurationManager.AppSettings["FromAddress"].ToString(); string finance_emailid = Session["emailId"].ToString(); string employeeid = Session["MemberId"].ToString(); string referenceid = Session["referenceid"].ToString(); string toemail = txtTo.Text; string ccmail = txtCC.Text; details.ToEmail = toemail.ToString(); details.CCEmail = ccmail.ToString(); details.Type = referenceid; details.Id = ""; details.Module = Session["transctiontype"].ToString(); string FooterText = ConfigurationManager.AppSettings["FooterText"].ToString(); details.EmailSubject = txtSubject.Text; details.MsgBody = "<span style=\"font-size: 10pt; color: #3300cc; font-family: Verdana\"> <br>" + "<b> '" + txtMsgContent.Text + "' <br> " + "<br>" + "<br>" + "<br>" + "<br>" + FooterText + " </b><br><b> </b></span>"; bool resultv = obj.InsertIntoEmailQueue(details); if (resultv == true) { bool flag = b.UpdateUtilizationMailFlag(employeeid, referenceid, Session["transctiontype"].ToString()); Gridview.DataBind(); Gridview.Visible = true; PanelSendMail.Visible = false; txtTo.Text = ""; txtCC.Text = ""; txtSubject.Text = ""; txtMsgContent.Text = ""; string CloseWindow1 = "alert('Mail Sent successfully')"; ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true); } else { PanelSendMail.Visible = true; string CloseWindow1 = "alert('Problem while sending mail')"; ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true); } } catch (Exception ex) { log.Error(ex.StackTrace); log.Error(ex.Message); } }
protected void TextBoxYearJAQ_SelectedIndexChanged(object sender, EventArgs e) { PublishData c = new PublishData(); if (TextBoxYearJAQ.SelectedValue != "") { c = B.CheckQuartilevaluefromJQM(TextBoxYearJAQ.SelectedValue, txtboxID.Text); string Jquartilevalue = Convert.ToString(c.Jquartile); IncentiveBusiness ince_obj = new IncentiveBusiness(); PublishData obj = new PublishData(); obj = ince_obj.getquartileName(Jquartilevalue); DropDownQuartile.SelectedValue = c.Jquartile; // DropDownQuartile.SelectedItem.Text = obj.Name; if (obj.Name == null) { DropDownQuartile.Items.Clear(); DropDownQuartile.Items.Add(new ListItem("-Select-", "0", true)); DropDownQuartile.DataSourceID = "SqlDataSourceQuartileM"; DropDownQuartile.DataBind(); } //if (txtquartileID.Text != "") //{ // DropDownQuartile.SelectedValue = txtquartileID.Text; //} //DropDownQuartile.SelectedItem.Value = Jquartilevalue; //DropDownQuartile.DataBind(); } }
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; } } }
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; } }
private void SendMail() { EmailDetails details = new EmailDetails(); try { bool resultv = false; IncentiveBusiness b = new IncentiveBusiness(); SendMailObject obj = new SendMailObject(); string memberid = txtMemberId.Text.Trim(); string emailid = b.SelectAuthorEmailId(memberid); string point = txtPointsAwarded.Text; string year = DdlYear.SelectedValue; details.FromEmail = ConfigurationManager.AppSettings["FromAddress"].ToString(); details.ToEmail = emailid; details.Module = "APA"; details.EmailSubject = "Additional Point Award"; details.Type = ""; details.Id = ""; string FooterText = ConfigurationManager.AppSettings["FooterText"].ToString(); details.MsgBody = "<span style=\"font-size: 10pt; color: #3300cc; font-family: Verdana\"><h4>Dear Sir/Madam,</h4> <br>" + "<p>An additional incentive point for the year '" + year + "' is awarded '" + point + "' for more than 6 publication.</p>" + "<br>" + "<br>" + FooterText + " </b><br><b> </b></span>"; resultv = obj.InsertIntoEmailQueue(details); if (resultv == true) { string CloseWindow1 = "alert('Mail Sent successfully')"; ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true); btnSave.Enabled = false; } else { string CloseWindow1 = "alert('Problem while sending mail')"; ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true); btnSave.Enabled = false; } } catch (Exception ex) { string CloseWindow1 = "alert('Problem while sending mail')"; ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true); log.Error(ex.Message); log.Error(ex.StackTrace); btnSave.Enabled = false; } }
protected void btnExpt_Click(object sender, EventArgs e) { DataTable dy = null; DataTable dz = null; IncentiveBusiness obj = new IncentiveBusiness(); string MemberId = txtEmployeecode.Text; DataTable dt = obj.GetArticalWisePoints(MemberId); if (dt.Rows.Count == 0) { GridView5.Visible = false; Panel1.Visible = false; // noField.Visible = true; // noField.Text = "No Records Found"; } else { ViewState["GridViewStudentlist"] = dt; } // DataTable dt = (DataTable)ViewState["GridViewStudentlist"]; string filename = "ArticalWisePointExcel.xls"; string headerTable = @"<table width='100%' border='1' align='center' class='TestCssStyle'><h4>Artical Wise Points Summary<br/></h4></table>"; HttpContext.Current.Response.Write(headerTable); System.IO.StringWriter tw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw); DataGrid dgGrid = new DataGrid(); dgGrid.DataSource = dt; dgGrid.DataBind(); dgGrid.ShowHeader = true; dgGrid.RenderControl(hw); Response.ContentType = "application/vnd.ms-excel"; Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename + ""); this.EnableViewState = false; Response.Write(tw.ToString()); Response.End(); }
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); }
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(); } }
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(); }
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); } }
private void setModalWindow(object sender, EventArgs e) { string inst = Session["InstituteId"].ToString(); string member = txtmidSearch.Text.ToString(); IncentiveBusiness obj = new IncentiveBusiness(); string membername = ""; string role = Session["Role"].ToString(); string UserId = Session["UserId"].ToString(); ArrayList InstitutionList = new ArrayList(); InstitutionList = obj.selectHrAdditionalInstitute(UserId); if (InstitutionList.Count != 0) { InstitutionList.Add(inst); } if (role == "7") { if (InstitutionList.Count == 0) { DataSet ds = null; if (member != "") { if (ds.Tables.Count > 0) { ds = obj.SelectMembersInstitutewise(inst, member, membername); Panel1.Visible = true; popGridSearch.DataSource = ds; popGridSearch.DataBind(); popGridSearch.Visible = true; } } else { ds = obj.SelectMembersInstitute(inst); Panel1.Visible = true; popGridSearch.DataSource = ds; popGridSearch.DataBind(); popGridSearch.Visible = true; } } else { DataSet ds = null; if (member != "") { if (ds.Tables.Count > 0) { ds = obj.SelectMembersAdditionalInstitutewise(UserId, member, membername); Panel1.Visible = true; popGridSearch.DataSource = ds; popGridSearch.DataBind(); popGridSearch.Visible = true; } } else { ds = obj.SelectMembersAdditionalInstitute(UserId); Panel1.Visible = true; popGridSearch.DataSource = ds; popGridSearch.DataBind(); popGridSearch.Visible = true; } } } else if (role == "17") { DataSet ds1 = null; if (member != "") { if (ds1.Tables.Count > 0) { ds1 = obj.SelectFacultyInstitutewise(inst, member, membername); Panel1.Visible = true; popGridSearch.DataSource = ds1; popGridSearch.DataBind(); popGridSearch.Visible = true; } } else { ds1 = obj.SelectFacultyInstitute(inst); Panel1.Visible = true; popGridSearch.DataSource = ds1; popGridSearch.DataBind(); popGridSearch.Visible = true; } } else { DataSet ds2 = null; if (member != "") { // ds2 = obj.SelectStudentInstitutewise(inst, member, membername); // Panel1.Visible = true; // popGridSearch.DataSource = ds2; // popGridSearch.DataBind(); // popGridSearch.Visible = true; //} if (ds2.Tables.Count > 0) { ds2 = obj.SelectStudentInstitutewise(inst, member, membername); Panel1.Visible = true; popGridSearch.DataSource = ds2; popGridSearch.DataBind(); popGridSearch.Visible = true; } } else { ds2 = obj.SelectStudentInstitute(inst); Panel1.Visible = true; popGridSearch.DataSource = ds2; popGridSearch.DataBind(); popGridSearch.Visible = true; } } }
protected void btnSearch_Click(object sender, EventArgs e) { string inst = Session["InstituteId"].ToString(); string member = txtmidSearch.Text.ToString(); string membername = txtmnameSearch.Text.ToString(); string role = Session["Role"].ToString(); string UserId = Session["UserId"].ToString(); IncentiveBusiness obj = new IncentiveBusiness(); ArrayList InstitutionList = new ArrayList(); InstitutionList = obj.selectHrAdditionalInstitute(UserId); if (InstitutionList.Count != 0) { } if (role == "7") { if (InstitutionList.Count == 0) { DataSet ds = obj.SelectMembersInstitutewise(inst, member, membername); if (txtmidSearch.Text.Trim() == "") { Panel1.Visible = true; popGridSearch.DataSource = ds; popGridSearch.DataBind(); popGridSearch.Visible = true; } else { Panel1.Visible = true; popGridSearch.DataSource = ds; popGridSearch.DataBind(); popGridSearch.Visible = true; } } else { DataSet ds = obj.SelectMembersAdditionalInstitutewise(UserId, member, membername); if (txtmidSearch.Text.Trim() == "") { Panel1.Visible = true; popGridSearch.DataSource = ds; popGridSearch.DataBind(); popGridSearch.Visible = true; } else { Panel1.Visible = true; popGridSearch.DataSource = ds; popGridSearch.DataBind(); popGridSearch.Visible = true; } } } if (role == "17") { DataSet ds1 = obj.SelectFacultyInstitutewise(inst, member, membername); if (txtmidSearch.Text.Trim() == "") { Panel1.Visible = true; popGridSearch.DataSource = ds1; popGridSearch.DataBind(); popGridSearch.Visible = true; } else { Panel1.Visible = true; popGridSearch.DataSource = ds1; popGridSearch.DataBind(); popGridSearch.Visible = true; } } if (role == "18") { User u = new User(); Business b = new Business(); u = b.findmembername(member); if (u.MUNonMU != "M") { DataSet ds2 = obj.SelectStudentInstitutewise(inst, member, membername); if (txtmidSearch.Text.Trim() == "") { Panel1.Visible = true; popGridSearch.DataSource = ds2; popGridSearch.DataBind(); popGridSearch.Visible = true; } else { Panel1.Visible = true; popGridSearch.DataSource = ds2; popGridSearch.DataBind(); popGridSearch.Visible = true; } } } ModalPopupExtender2.Show(); }
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 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; //} }
protected void Btnsearch_Click(object sender, EventArgs e) { PublishData v = new PublishData(); string Pid = txtPublicationId.Text.Trim(); Business obj = new Business(); IncentiveBusiness ince_obj = new IncentiveBusiness(); string TypeEntry = "JA"; v = obj.fnfindjid(Pid, TypeEntry); TextBoxPubId.Text = Pid; txtboxTitleOfWrkItem.Text = v.TitleWorkItem; TextBoxPubJournal.Text = v.PublisherOfJournal; TextBoxNameJournal.Text = v.PublisherOfJournalName; DropDownListMuCategory.SelectedValue = v.MUCategorization; DropDownListMonthJA.SelectedValue = v.PublishJAMonth.ToString(); string PublicationYearwebConfig = ConfigurationManager.AppSettings["PublicationYear"]; int currenntYear = DateTime.Now.Year; int year = Convert.ToInt32(PublicationYearwebConfig); int yeardiff = currenntYear - year; if (yeardiff < 0) { yeardiff = -(yeardiff); } for (int i = 0; i <= yeardiff; i++) { int yeatAppend = year + i; TextBoxYearJA.Items.Add(new ListItem(yeatAppend.ToString(), yeatAppend.ToString(), true)); } TextBoxYearJA.DataBind(); TextBoxYearJA.SelectedValue = v.PublishJAYear; int pubyear = Convert.ToInt32(TextBoxYearJA.SelectedValue); int pubmonth = 0; pubmonth = Convert.ToInt32(DropDownListMonthJA.SelectedValue); if (pubyear >= 2018 && pubmonth >= 7) { string quartileid = v.QuartileOnIncentivize; lblQuartile.Visible = true; txtquartile.Visible = true; txtquartileid.Text = quartileid.ToString(); //Session["Quartile"] = txtquartileid.Text; //txtquartileid.Text = Session["Quartile"].ToString(); PublishData v2 = new PublishData(); if (txtquartileid.Text != "" && txtquartileid.Text != "0") { v2 = ince_obj.getquartileName(txtquartileid.Text); txtquartile.Text = v2.Name; if (Convert.ToInt16(v.PublishJAYear) >= 2018 && Convert.ToInt16(v.PublishJAMonth) >= 7) { v.ImpactFactor = txtquartileid.Text; } } } else { lblQuartile.Visible = false; txtquartile.Visible = false; } if (v.IncentivePointSatatus == "CAN" && v.Status == "CAN") { PanelCancel.Visible = true; txtcancelRemarks.Text = v.PubCancelRemarks; Gridview.Visible = true; Gridview.DataSourceID = "SqlDataSource3"; Gridview.DataBind(); if (Gridview.Rows.Count == 0) { } } else { PanelCancel.Visible = false; Gridview.Visible = true; Gridview.DataSourceID = "SqlDataSource2"; Gridview.DataBind(); if (Gridview.Rows.Count == 0) { } } TextBoxImpFact.Text = v.ImpactFactor; TextBoxImpFact5.Text = v.ImpactFactor5; if (v.IFApplicableYear != 0) { txtIFApplicableYear.Text = v.IFApplicableYear.ToString(); } TextBoxPageFrom.Text = v.PageFrom; TextBoxPageTo.Text = v.PageTo; TextBoxVolume.Text = v.Volume; TextBoxIssue.Text = v.Issue; DropDownListPubType.SelectedValue = v.Publicationtype; //Gridview.Visible = true; //Gridview.DataSourceID = "SqlDataSource2"; //Gridview.DataBind(); //if (Gridview.Rows.Count==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(); } }
protected void BtnSendMail_Click(object sender, EventArgs e) { try { IncentiveBusiness b = new IncentiveBusiness(); EmailDetails details = new EmailDetails(); SendMailObject obj = new SendMailObject(); details.FromEmail = ConfigurationManager.AppSettings["FromAddress"].ToString(); string finance_emailid = Session["emailId"].ToString(); int Index = ((GridViewRow)((sender as Control)).NamingContainer).RowIndex; string employeeid = Gridview.Rows[Index].Cells[0].Text; string referenceid = Gridview.Rows[Index].Cells[1].Text; string transctiontype = Gridview.Rows[Index].Cells[5].Text; Session["transctiontype"] = transctiontype; Session["MemberId"] = employeeid; Session["referenceid"] = referenceid; string membertype = Gridview.Rows[Index].Cells[6].Text; string emailid = null; if (membertype == "M") { emailid = b.SelectAuthorEmailId(employeeid); } else { //emailid = b.SelectStudentAuthorEmailId(employeeid); string id = ""; emailid = b.SelectStudentEmailId(employeeid, id); } string hr_emaild = b.SelectHREmailId(employeeid, referenceid, transctiontype); PanelSendMail.Visible = true; if (emailid != "") { txtTo.Text = hr_emaild + ',' + emailid; } else { txtTo.Text = hr_emaild; } txtCC.Text = finance_emailid; foreach (GridViewRow row in Gridview.Rows) { if (row.RowIndex == Index) { row.BackColor = ColorTranslator.FromHtml("#A1DCF2"); } else { row.BackColor = ColorTranslator.FromHtml("#FFFFFF"); } } } catch (Exception ex) { log.Error(ex.StackTrace); log.Error(ex.Message); //return obj1; } }
private void SendMail() { EmailDetails details = new EmailDetails(); IncentiveBusiness b = new IncentiveBusiness(); SendMailObject obj = new SendMailObject(); Business e = new Business(); try { bool resultv = false; int rowIndex = 0; string emailid = null; details.Module = "IPE"; string AuthorName = null; string Isstudent = null; details.EmailSubject = "Incentive Point Adjustment"; string empcode = txtboxMemberId.Text; string type = e.selectMemberType(empcode, txtReferenceId.Text); if (type == "M") { //Isstudent = "N"; emailid = b.SelectAuthorEmailId(empcode); AuthorName = b.SelectAuthorName(empcode); Session["AuthorName"] = AuthorName; if (emailid == "") { int result; //string AuthorName; AuthorName = b.SelectAuthorName(empcode); result = e.insertEmailtrackerIncentive(AuthorName, details, txtReferenceId.Text); } } else { //Isstudent = "S"; emailid = b.SelectStudentEmailId(empcode, txtReferenceId.Text); AuthorName = b.SelectStudentAuthorName(empcode, txtReferenceId.Text); Session["AuthorName"] = AuthorName; if (emailid == "") { int result; AuthorName = b.SelectStudentAuthorName(empcode, txtReferenceId.Text); result = e.insertEmailtrackerIncentive(AuthorName, details, txtReferenceId.Text); //Session["AuthorName"] = AuthorName; } } details.FromEmail = ConfigurationManager.AppSettings["FromAddress"].ToString(); if (emailid != "") { details.ToEmail = emailid; } string hremailid = b.SelectHRMailID(empcode, type, txtReferenceId.Text); string InstWiseHRMailid = b.SelectInstwiseHRMailid(empcode, type, txtReferenceId.Text); if (details.ToEmail != null && details.ToEmail != "") { if (InstWiseHRMailid != null) { if (InstWiseHRMailid != "") { if (details.ToEmail != null) { details.ToEmail = details.ToEmail + "," + InstWiseHRMailid; } else { details.ToEmail = InstWiseHRMailid; } } else { // details.ToEmail = details.ToEmail; } } else { // details.ToEmail = details.ToEmail; } } else { if (InstWiseHRMailid != null) { if (InstWiseHRMailid != "") { if (details.ToEmail != null) { details.ToEmail = InstWiseHRMailid; } else { details.ToEmail = InstWiseHRMailid; } } else { // details.ToEmail = details.ToEmail; } } else { // details.ToEmail = details.ToEmail; } } ArrayList list = new ArrayList(); list = b.SelectHODMailid(empcode, type, txtReferenceId.Text); for (int j = 0; j < list.Count; j++) { if (j == 0) { if (list[j].ToString() != "") { details.HODmailid = list[j].ToString(); } } else { if (list[j].ToString() != "") { details.HODmailid = details.HODmailid + ',' + list[j].ToString(); } } } if (details.ToEmail != null && details.ToEmail != "") { if (hremailid != null) { if (hremailid != "") { details.ToEmail = details.ToEmail + "," + hremailid; } else { // details.ToEmail = details.ToEmail; } } else { // details.ToEmail = details.ToEmail; } } else { if (hremailid != null) { if (hremailid != "") { details.ToEmail = hremailid; } else { // details.ToEmail = details.ToEmail; } } else { // details.ToEmail = details.ToEmail; } } if (details.ToEmail != null && details.ToEmail != "") { if (details.HODmailid != null) { if (details.HODmailid != "") { details.ToEmail = details.ToEmail + "," + details.HODmailid; //details.ToEmail = details.ToEmail + "," + hremailid + "," + details.HODmailid; } else { //details.ToEmail = details.ToEmail; } } else { //details.ToEmail = details.ToEmail; } } else { if (details.HODmailid != null) { if (details.HODmailid != "") { details.ToEmail = details.HODmailid; //details.ToEmail = details.ToEmail + "," + hremailid + "," + details.HODmailid; } else { //details.ToEmail = details.ToEmail; } } else { //details.ToEmail = details.ToEmail; } } // details.CCEmail = hremailid; // details.CCEmail = Session["emailId"].ToString(); details.Module = "IPE"; details.EmailSubject = "Incentive Point Adjustment"; //details.Type = DropDownListPublicationEntry.SelectedValue; details.Id = txtReferenceId.Text; string FooterText = ConfigurationManager.AppSettings["FooterText"].ToString(); string isStudent = Session["IsStudent"].ToString(); if (isStudent == "Y") { if (type == "S") { details.MsgBody = "<span style=\"font-size: 10pt; color: #3300cc; font-family: Verdana\"><h4>Dear Sir/Madam,</h4> <br>" + "<p>For Certificate of Appreciation and encashment of research incentive points, request you to contact student research section of your institution/department along with the Bank detail form available in RMS Portal.</p>" + "<b>Incentive points with the rating : " + txtTotalPoint.Text + "" + Session["Numbertype"].ToString() + "<br>" + "<br>" + "Author Name : " + Session["AuthorName"].ToString() + "<br>" + "Publication Id : " + txtReferenceId.Text + "<br>" + "Article Name :" + Session["Title"].ToString() + "<br>" + "<br>" + FooterText + " </b><br><b> </b></span>"; } else { details.MsgBody = "<span style=\"font-size: 10pt; color: #3300cc; font-family: Verdana\"><h4>Dear Sir/Madam,</h4> <br>" + //"<b> Incentive points with the rating '" + total.Text + "' added. <br> " + "<b>Incentive points with the rating : " + txtTotalPoint.Text + " " + Session["Numbertype"].ToString() + "<br>" + "<br>" + "Author Name : " + Session["AuthorName"].ToString() + "<br>" + "Publication Id : " + txtReferenceId.Text + "<br>" + "Article Name :" + Session["Title"].ToString() + "<br>" + "<br>" + FooterText + " </b><br><b> </b></span>"; } } else { if (type == "S") { details.MsgBody = "<span style=\"font-size: 10pt; color: #3300cc; font-family: Verdana\"><h4>Dear Sir/Madam,</h4> <br>" + "<p>For encashment of research incentive points, request you to contact student research section of your institution/department along with the Bank detail form available in RMS Portal.</p>" + "<b>Incentive points with the rating : " + txtTotalPoint.Text + " " + Session["Numbertype"].ToString() + "<br>" + //"<b> Incentive points with the rating '" + total.Text + "' added. <br> " + "<br>" + "Author Name : " + Session["AuthorName"].ToString() + "<br>" + "Publication Id : " + txtReferenceId.Text + "<br>" + "Article Name :" + Session["Title"].ToString() + "<br>" + "<br>" + FooterText + " </b><br><b> </b></span>"; } else { details.MsgBody = "<span style=\"font-size: 10pt; color: #3300cc; font-family: Verdana\"><h4>Dear Sir/Madam,</h4> <br>" + //"<b> Incentive points with the rating '" + total.Text + "' added. <br> " + "<b>Incentive points with the rating : " + txtTotalPoint.Text + " " + Session["Numbertype"].ToString() + "<br>" + "<br>" + "Author Name : " + Session["AuthorName"].ToString() + "<br>" + "Publication Id : " + txtReferenceId.Text + "<br>" + "Article Name :" + Session["Title"].ToString() + "<br>" + "<br>" + FooterText + " </b><br><b> </b></span>"; } } if (details.ToEmail != "" && details.ToEmail != null) { resultv = obj.InsertIntoEmailQueue(details); } IncentiveData obj3 = new IncentiveData(); IncentiveBusiness C = new IncentiveBusiness(); if (emailid == "") { string AuthorName1 = Session["AuthorName"].ToString(); obj3 = C.CheckUniqueIdIncentive(txtReferenceId.Text, "JA", details); int data = C.updateEmailtrackerIncentive(txtReferenceId.Text, "JA", details, obj3, AuthorName1); } if (resultv == true) { string CloseWindow1 = "alert('Mail Sent successfully')"; ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true); } else { string CloseWindow1 = "alert('Problem while sending mail')"; ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true); } } catch (Exception ex) { string CloseWindow1 = "alert('Problem while sending mail')"; ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true); log.Error(ex.Message); log.Error(ex.StackTrace); } }
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; }
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); } }
protected void JournalIDTextChanged(object sender, EventArgs e) { ArrayList list = new ArrayList(); //txtboxYear.Text = ""; txtboxTitle.Text = ""; //cblActiveyear.ClearSelection(); popupPanelJournal.Visible = false; JournalValueObj.JournalID = txtboxID.Text; // JournalValueObj.year = txtBoxYear.Text; JournalData j = new JournalData(); j = B.JournalEntryCheckExistance(JournalValueObj); if (j.jid != null) { log.Debug("inside --JournalIDTextChanged--update publish" + j.jid); txtboxTitle.Text = j.name; string year = DateTime.Now.Year.ToString(); int Jyear = Convert.ToInt32(year) - 1; list = B.SelectActiveYear(JournalValueObj); //for (int i = 0; i < list.Count; i++) //{ // //ListItem currentCheckBox = cblActiveyear.Items.FindByValue(list[i].ToString()); // //if (currentCheckBox != null) // //{ // // currentCheckBox.Selected = true; // //} //} PublishData obj = new PublishData(); string jyear = TextBoxYearJAQ.SelectedItem.Text; obj = B.checkQuartileValue(txtboxID.Text, jyear); txtquartileID.Text = Convert.ToString(obj.Jquartile); IncentiveBusiness ince_obj = new IncentiveBusiness(); obj = ince_obj.getquartileName(txtquartileID.Text); //txtquartile.Text = obj.Name; //DropDownQuartile.DataSourceID = "SqlDataSourceQuartileM"; //DropDownQuartile.DataTextField = "Name"; //DropDownQuartile.DataValueField = "Id"; //DropDownQuartile.DataBind(); DropDownQuartile.Items.Clear(); DropDownQuartile.Items.Add(new ListItem("-Select-", "0", true)); DropDownQuartile.DataSourceID = "SqlDataSourceQuartileM"; DropDownQuartile.DataBind(); if (txtquartileID.Text != "") { DropDownQuartile.SelectedValue = txtquartileID.Text; } //DropDownQuartile.SelectedItem.Value = txtquartileID.Text; } else { log.Debug("inside --JournalIDTextChanged--New Publish Id" + j.jid); btnSaveUpdate.Enabled = true; ClientScript.RegisterStartupScript(Page.GetType(), "validation1", "<script language='javascript'>alert('New Entry..Please enter the details !!!!')</script>"); txtboxTitle.Enabled = true; } }