+ All Categories
Home > Documents > Skripsi Hard Cover Binusian Profile -...

Skripsi Hard Cover Binusian Profile -...

Date post: 17-Mar-2019
Category:
Upload: dohanh
View: 213 times
Download: 0 times
Share this document with a friend
345
L1 LAMPIRAN Notulen Rapat Binusian Profile NOTULEN RAPAT Rapat : Rapat Rancangan Binusian Profile Nomor Undangan Rapat : Hari/Tanggal : Selasa / 12 October 2010 T empat/Lokasi : Ruang Meeting IV, Syahdan Agenda Rapat : Diskusi Mengenai Rancangan Binusian Profile di New Binusmaya Ketua Ra pat : Wihendro, S.Kom.,MM No. Rincian Pembahasan Rencana Tindak Lanjut Batas Waktu Penanggung Jawab 1 INFORMASI Yang disediakan untuk Personal S1 Informasi Wa jib Ada : Name in Birth Certificate ID (ID card type and number) Name in Card ID card Scan Imag e Place of Birth (Place and Country) Date of Birth Gender Religion Nationality Marital Status Informasi Optional : Marital Date Informasi Tidak Ditampilkan : Title Informasi Tidak Boleh Diubah : Name in Birth Certificate Title ID (ID card type and number) Name in Card ID card Scan Imag e Place of Birth (Place and Country) Date of Birth Gender Informasi Boleh Diubah dan perlu Approval : Religion Nationality Marital Status Marital Date 2 INFORMASI Yang disediakan untuk Personal Informasi Wa jib Ada : Name in Birth Certificate Title
Transcript

L1

LAMPIRAN

• Notulen Rapat Binusian Profile

NOTULEN RAPAT

Rapat : Rapat Rancangan Binusian Profile

Nomor Undangan Rapat :

Hari/Tanggal : Selasa / 12 October 2010 Tempat/Lokasi : Ruang Meeting IV, Syahdan

Agenda Rapat : Diskusi Mengenai Rancangan Binusian Profile di New Binusmaya

Ketua Rapat : Wihendro, S.Kom.,MM

No. Rincian

Pembahasan Rencana Tindak Lanjut Batas

Waktu Penanggung

Jawab

1 INFORMASI Yang disediakan untuk Personal S1

Informasi Wajib Ada : • Name in Birth Certificate • ID (ID card type and number) • Name in Card • ID card Scan Image • Place of Birth (Place and Country) • Date of Birth • Gender • Religion • Nationality • Marital Status • Informasi Optional : • Marital Date

Informasi Tidak Ditampilkan : • Title • Informasi Tidak Boleh Diubah : • Name in Birth Certificate • Title • ID (ID card type and number) • Name in Card • ID card Scan Image • Place of Birth (Place and Country) • Date of Birth • Gender

Informasi Boleh Diubah dan perlu Approval : • Religion • Nationality • Marital Status • Marital Date

2 INFORMASI Yang disediakan untuk Personal

Informasi Wajib Ada : • Name in Birth Certificate • Title

L2

S2

• ID (ID card type and number) • Name in Card • ID card Scan Image • Place of Birth (Place and Country) • Date of Birth • Gender • Religion • Nationality • Marital Status

Informasi Optional : • Marital Date

Informasi Tidak Boleh Diubah : • Name in Birth Certificate • Title • ID (ID card type and number) • Name in Card • ID card Scan Image • Place of Birth (Place and Country) • Date of Birth • Gender

Informasi Boleh Diubah dan perlu Approval : • Religion • Nationality • Marital Status • Marital Date

3 INFORMASI

Yang disediakan untuk Personal Alumni

Informasi Wajib Ada : • Name in Birth Certificate • Title • ID (ID card type and number) • Name in Card • ID card Scan Image • Place of Birth (Place and Country) • Date of Birth • Gender • Religion • Nationality • Marital Status

Informasi Optional : • Marital Date

Informasi Tidak Boleh Diubah : • Name in Birth Certificate • Title • Name in Card • Place of Birth (Place and Country) • Date of Birth • Gender

Informasi Boleh Diubah dan perlu Approval : • Religion • Nationality • ID (ID card type and number) • ID card Scan Image • Marital Status

L3

Marital Date

4 INFORMASI Yang disediakan untuk Personal Dosen

Informasi Wajib Ada : • Name in Birth Certificate • Title • ID (ID card type and number) • Name in Card • ID card Scan Image • Place of Birth (Place and Country) • Date of Birth • Gender • Religion • Nationality • Marital Status

Informasi Optional : • Marital Date

Informasi Tidak Boleh Diubah : • Name in Birth Certificate • Title • Name in Card • Place of Birth (Place and Country) • Date of Birth • Gender

Informasi Boleh Diubah dan perlu Approval : • Religion • Nationality • ID (ID card type and number) • ID card Scan Image • Marital Status • Marital Date

4 Catatan untuk Bagian Personal:

• Penggantian dapat dilakukan secara offline dengan bukti tertulis untuk field yang tidak boleh berubah

• Alumni bisa approve by phone, pada saat job expo tidak perlu approval lagi

• Semua organisasi terkait dapat approve, jika personal memiliki banyak role. Jika salah satu sudah approve, organisasi lain tidak perlu approve lagi

• Bahan pertimbangan apakah perlu penambahan golongan darah?

5 INFORMASI Yang disediakan untuk bagian Contact

Residence : • Primary : Alamat utama/bukan, wajib ada alamat utama • Address • Country • Province/State, Nama Field Disesuaikan negara • District, Nama Field Disesuaikan negara • Sub District, Nama Field Disesuaikan negara • Post Codes • Status of residence, Permanent/Temporary

Phone: • Primary : Telepon utama/bukan, wajib ada telepon

utama, nomor XL bagi yang sudah ikut program

L4

• Emergency : Emergency Contact • Phone Number • Ext : Optional • Type : Fixed Line/Mobile

Fax: • Fax Number : Optional

Email: • Primary : email yang disediakan binus • Email Address

Website: • URL : Optional

Social Network Account : • BB PIN : Optional • Facebook : Optional • Twitter : Optional

Catatan untuk Bagian Contact: • Semua informasi bebas diubah kecuali nomor telepon

tipe fixed line dan nomor handphoneXL bagi yang ikut program ,serta email binusian yang diinput oleh sistem

• Maks memiliki telepon 5

6 INFORMASI yang disediakan untuk bagian FAMILY - Personal

• Relationship : Father / Mother / Guardian / Spouse / Sibling / Child / Uncle / Auntie

• Full Name • Place of Birth (Place and Country) • Date of Birth • Gender • Status : Alive/Deceased • Tax Status : Tertanggung/tidak, hanya untuk yang

rolenya dosen/staff serta hubungan spouse/child • Educational Degree • Work Field • Family Card scan Image

7 INFORMASI yang disediakan untuk FAMILY-Contact

Informasi Contact untuk Family - Contact sama seperti Contact tanpa Kategori Social Network Account dan Website

8 Tabel Approval FAMILY

Untuk Mahasiswa : • Father : Personal dan Contact Tidak boleh diubah • Mother: Personal dan Contact Tidak boleh diubah • Guardian: Personal dan Contact Tidak boleh diubah • Spouse : Personal dan Contact Bebas ubah, kecuali

binusian status alive • Sibling: Personal dan Contact Bebas ubah, kecuali

binusian status alive • Child : Personal dan Contact Bebas ubah, kecuali

binusian status alive Untuk Dosen / Staff:

• Father : Personal dan Contact Bebas ubah, kecuali binusian status alive

• Mother: Personal dan Contact Bebas ubah, kecuali

L5

binusian status alive • Guardian: Personal dan Contact Bebas ubah, kecuali

binusian status alive • Spouse : Personal dan Contact Memerlukan Approval • Sibling: Personal dan Contact Bebas ubah, kecuali

binusian status alive • Child : Personal dan Contact Memerlukan Approval

9 Informasi yang disediakan untuk NPWP

• Number • Name on NPWP • Address on NPWP • Ownership • Date Registered • Branch Office Registered • NPWP card Scan image

Catatan : NPWP hanya untuk Dosen dan Staff dan memerlukan approval

10 INFORMASI yang disediakan untuk Bank Account

• Account Number • Name on Account • Branch Office • Virtual Account : Berisi balance/saldo

Catatan : Bank Account hanya untuk mahasiswa S2 dan tidak bisa diubah

11 Catatan Lain

• MENU TRAINING untuk dosen • STUDENT ACTIVITY hanya untuk mahasiswa S1 • Akan didiskusikan lebih lanjut mengenai konsep

BinusianID • Akan diset waktu lagi untuk mendiskusikan field

lainnya yang belum sempat dibahas(tab Portfolio)

Hadir : 1. Nelly, S.Kom., MM

2. Drs. Andreas Chang, MBA 3. Siswono, S.Kom., MM 4.Astrini, M.Psi., Psikolog. 5. Farrah 6.Wihendro, S.Kom., MM 7.Hendi 8.Danu

Tidak Hadir : 1. Iman H. Kartowisastro, Ph.D. 2. Henry Antonius Eka W, S.Kom., MM 3. Reina, S.Kom., MM Mengetahui, Wihendro, S.Kom, MM Ketua Rapat

Jakarta, 28-10-2010 Hendi Notulist

L6

• Disclaimer.aspx.cs

using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Collections.Generic; using BinusmayaV3.Business.ApplicationFacade; using BinusmayaV3.Business.Entities; using BinusmayaV3.CrossCutting.Security; using BinusmayaV3.CrossCutting.OperationalManagement; using BinusmayaV3.UserControl; using BinusmayaV3.Business.Entities.Enum; namespace BinusmayaV3.Disclaimer1 { public partial class Disclaimer : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { String defPass = ""; if (Session["defPass"] != null) { defPass = Session["defPass"].ToString(); if (defPass == "0") { } else { Session["defPass"] = 1; Response.Redirect("~/ChangePassword.aspx"); } } if (Session["hint"] != null) { if (Session["hint"].ToString() == "1") { Session["hint"] = 1; // Response.Redirect("~/ChangePassword.aspx"); } } if (Session["UserId"] != null) { List<DisclaimerData> _listDisclaimer = new DisclaimerSystem().getDisclaimerData(); foreach (DisclaimerData _data in _listDisclaimer)

L7

{ if (Convert.ToInt32(_data.LanguageId) == 1) { litIndonesiaHidden.Text = _data.LanguageId; lnkIndonesia.Text = _data.LanguageName + " v." + _data.VersionName; litIsi.Text = _data.Disclaimer; } else if (Convert.ToInt32(_data.LanguageId) == 2) { litEnglishHidden.Text = _data.LanguageId; lnkEnglish.Text = _data.LanguageName + " v." + _data.VersionName; } } List<DisclaimerData> disclaimerData = new DisclaimerSystem().getDisclaimerData(); //if (disclaimerData.Count == 0) //{ // rptLanguageList.Visible = false; //} //else //{ // rptLanguageList.DataSource = disclaimerData; // rptLanguageList.DataBind(); //} } else { Response.Redirect("~/Default.aspx"); } } } //protected void rptLanguageList_ItemDataBound(object sender, RepeaterItemEventArgs e) //{ // if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) // { // DisclaimerData disclaimerData = (DisclaimerData)e.Item.DataItem; // LinkButton linkLanguage = (LinkButton)e.Item.FindControl("linkLanguage"); // linkLanguage.Text = disclaimerData.LanguageName + " - ver " + disclaimerData.VersionName; // } //} protected void lnkEnglish_Click(object sender, EventArgs e) { DisclaimerData _data = new DisclaimerSystem().getDisclaimerData(litEnglishHidden.Text); litIsi.Text = _data.Disclaimer; } protected void lnkIndonesia_Click(object sender, EventArgs e) { DisclaimerData _data = new DisclaimerSystem().getDisclaimerData(litIndonesiaHidden.Text); litIsi.Text = _data.Disclaimer; } } }

L8

• Master2.Master.cs

using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Collections.Generic; using BinusmayaV3.Business.ApplicationFacade; using BinusmayaV3.Business.Entities; using BinusmayaV3.CrossCutting.Security; using BinusmayaV3.CrossCutting.OperationalManagement; using BinusmayaV3.UserControl; namespace BinusmayaV3.MasterPage { public partial class Master2 : System.Web.UI.MasterPage { private UserSystem userSystem = new UserSystem(); protected void Page_Load(object sender, EventArgs e) { Session.Timeout = SystemConfiguration.SessionTimeOut; if (!IsPostBack) { if (Session["UserId"] == null) { Response.Redirect("~/Default.aspx"); } if (Session["defPass"] != null) { String defPass = Session["defPass"].ToString(); } if (Session["UserId"] == null) { Response.Redirect(Request.ApplicationPath.TrimEnd('/') + "/Default.aspx"); return; } litUserId.Text = userSystem.GetUserDataByBinusianId(Session["UserId"].ToString()).Name; #region Greeting string day = ((Day)((byte)DateTime.Today.DayOfWeek)).ToString(); string date = DateTime.Today.ToString("dd"); string month = ((Month)DateTime.Today.Month).ToString(); string year = DateTime.Today.Year.ToString(); litDate.Text = string.Format("{0}, {1} {2} {3} :: ", day, date, month, year); DateTime time = new DateTime(); time = DateTime.Now; if (time.Hour >= 0 && time.Hour < 12) { litGreeting.Text = "Good Morning, ";

L9

} else if (time.Hour >= 12 && time.Hour < 18) { litGreeting.Text = "Good Afternoon, "; } else if (time.Hour >= 18) { litGreeting.Text = "Good Evening, "; } #endregion } } protected void lnkNotification_Click(object sender, EventArgs e) { Response.Redirect(Request.ApplicationPath.TrimEnd('/') + "/Notification.aspx"); } protected void lnkDisclaimer_Click(object sender, EventArgs e) { Response.Redirect("~/Disclaimer/Disclaimer.aspx"); } public enum Day : byte { Sunday = 0, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday } public enum Month : byte { January = 1, February, March, April, May, June, July, August, September, October, November, Desember } protected void timer1_Tick(object sender, EventArgs e) { if (Session["UserId"] == null) { Response.Redirect("~/Default.aspx"); } string newNoti = new NotificationSystem().getNewNotification(Session["UserId"].ToString()); if (newNoti != "0") { lnkNotification.Text = "Notification (" + newNoti.Trim() + ")"; }

L10

else { lnkNotification.Text = "Notification"; } int newMessage = new MessageSystem().GetMessageListByBinusianIdByPagingSearchingDataCount(Session["UserId"].ToString(),"","",1); if (newMessage != 0) { lnkInbox.Text = "Inbox (" + newMessage.ToString().Trim() + ")"; } else { lnkInbox.Text = "Inbox"; } timer1.Interval = 300000; } } }

• Message.Master.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BinusmayaV3.Business.ApplicationFacade; namespace BinusmayaV3.MasterPage { public partial class Message : System.Web.UI.MasterPage { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!new UserSystem().CheckStatusGabungan(Session["UserId"].ToString(), 2)) { btnNewMessage.Visible = false; } litInbox.Text = "<li><a href='../Message/Inbox.aspx'>Inbox</a></li>"; litOutbox.Text = "<li><a href='../Message/Outbox.aspx'>Sent</a></li>"; litTrash.Text = "<li><a href='../Message/Trash.aspx'>Trash</a></li>"; } } protected void btnNewMessage_Click(object sender, EventArgs e) { Response.Redirect("~/Message/CreateMessage.aspx"); } } }

• CreateMessage.aspx.cs

using System; using System.Collections.Generic; using System.Linq;

L11

using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Inbox.Business.ApplicationFacade; using Inbox.Business.Entities; using Inbox.CrossCutting.Security; namespace Inbox { public partial class CreateMessage : SecurePage { protected string ID { get { return Convert.ToString(ViewState["id"]); } set { ViewState["id"] = value; } } protected int Forward { get { return Convert.ToInt32(ViewState["f"]); } set { ViewState["f"] = value; } } protected int Reply { get { return Convert.ToInt32(ViewState["r"]); } set { ViewState["r"] = value; } } protected int Read { get { return Convert.ToInt32(ViewState["rd"]); } set { ViewState["rd"] = value; } } private void SaveViewStates() { if (Request.QueryString["id"] != null) { string tempId = Request.QueryString["id"].ToString().Trim(); ID = Convert.ToString(Rijndael.Decrypt(tempId)); } if (Request.QueryString["r"] != null) { Reply = Convert.ToInt32(Request.QueryString["r"]);

L12

} if (Request.QueryString["rd"] != null) { Read = Convert.ToInt32(Request.QueryString["rd"]); } if (Request.QueryString["f"] != null) { Forward = Convert.ToInt32(Request.QueryString["f"]); } } private static string binusianid,kddsn,priod,kdsem; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SaveViewStates(); binusianid = Session["UserId"].ToString(); litSuccess.Text += " <a href='MessageInbox.aspx'>Back To Inbox.</a>"; pnlMessage.Visible = true; btnSend.Visible = true; pnlError.Visible = false; pnlSuccess.Visible = false; txtTo.Enabled = false; kddsn = new UserSystem().GetKdDosenForLecturer(binusianid); if (kddsn != null && kddsn != "") { ibFind.Visible = true; PeriodeData _dataperiod = new MessageSystem().GetPeriodeBerlaku(); priod = _dataperiod.Priod; kdsem = _dataperiod.KdSem; litPeriode.Text = priod; if (kdsem == "1") { litSemester.Text = "Odd"; } else { litSemester.Text = "Even"; } ddlClass.DataSource = new MessageSystem().GetDDLForClassByKddsn(priod, kdsem, kddsn); ddlClass.DataTextField = "KdMtk"; ddlClass.DataValueField = "Kelas"; ddlClass.DataBind(); List<UserData> _list = new List<UserData>(); _list = new MessageSystem().GetListBinusianByKddsnKelas(priod, kdsem, kddsn, ddlClass.SelectedItem.Value, 1); rptMahasiswa.DataSource = _list; rptMahasiswa.DataBind(); } else { ibFind.Visible = false; } if (Reply == 1) { ibFind.Visible = false; bool insert = new MessageSystem().InsertUpdateTrAccessMessage(binusianid, ID); if (!insert)

L13

{ Response.Redirect("~/MessageInbox.aspx"); } MessageData _data = new MessageSystem().GetMessageDetail(binusianid, ID); txtSubject.Text = "Re: " +_data.Subject; txtTo.Text = _data.SenderId; txtContent.Text = "\n\n\n--------------------------------------------------------------------------------------------------------------------------------------------------\nFrom:" + _data.SenderId.Trim() + " - " + _data.SenderName.Trim() + "\nTo:" + _data.ListBinusian + "\nSend Date:" + _data.SendDate + "\nSubject:" + _data.Subject + "\n\n" + _data.Message.Replace("<br/>", "\n"); } else if (Forward == 1) { bool insert = new MessageSystem().InsertUpdateTrAccessMessage(binusianid, ID); if (!insert) { Response.Redirect("~/MessageInbox.aspx"); } MessageData _data = new MessageSystem().GetMessageDetail(binusianid, ID); txtSubject.Text = "Fwd: " + _data.Subject; txtContent.Text = "\n\n\n--------------------------------------------------------------------------------------------------------------------------------------------------\nFrom:" + _data.SenderId.Trim() + " - " + _data.SenderName.Trim() + "\nTo:" + _data.ListBinusian + "\nSend Date:" + _data.SendDate + "\nSubject:" + _data.Subject + "\n\n" + _data.Message.Replace("<br/>", "\n"); } } } protected void btnSend_Click(object sender, EventArgs e) { int error = 0; litError.Text = ""; pnlError.Visible = false; pnlSuccess.Visible = false; if (txtSubject.Text.Trim() == "") { litError.Text += "<li>Field Subject Must be Filled</li>"; error++; } if (txtTo.Text.Trim() == "") { litError.Text += "<li>Field Send To Must be Filled</li>"; error++; } if (txtContent.Text.Trim() == "") { litError.Text += "<li>Field Content To Must be Filled</li>"; error++; } if (error > 0) { pnlError.Visible = true; return; } else { MessageData _data = new MessageData(); _data.Subject = txtSubject.Text.Trim(); if (Reply == 1 || Forward == 1)

L14

{ _data.Message = txtContent.Text.Replace("\n","<br/>"); } else { _data.Message = txtContent.Text.Trim(); } _data.SenderId = binusianid; bool success = new MessageSystem().CreateMessagePerBinusian(_data, txtTo.Text.Trim(), binusianid,1,1,"",1); if (success) { pnlSuccess.Visible = true; pnlMessage.Visible = false; btnSend.Visible = false; } else { pnlError.Visible = true; litError.Text = "<li>Error Sending Message</li>"; } } } protected void btnBack_Click(object sender, EventArgs e) { if (Read == 1) { Response.Redirect("~/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(ID))); } else { Response.Redirect("~/MessageInbox.aspx"); } } protected void ibFind_Click(object sender, ImageClickEventArgs e) { modalSearch.Show(); } protected void rptMahasiswa_ItemBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { UserData _data = (UserData)e.Item.DataItem; CheckBox chkCheck = (CheckBox)e.Item.FindControl("chkCheck"); Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); Literal litName = (Literal)e.Item.FindControl("litName"); Literal litClass = (Literal)e.Item.FindControl("litClass"); Literal litkdmtk = (Literal)e.Item.FindControl("litkdmtk"); litBinusianId.Text = _data.UserId; litName.Text = _data.Name; litClass.Text = _data.Kelas; litkdmtk.Text = _data.Kdmtk; } } protected void btnInsert_Click(object sender, EventArgs e) { txtTo.Text = ""; foreach (RepeaterItem _item in rptMahasiswa.Items) { CheckBox chkCheck = (CheckBox)_item.FindControl("chkCheck"); Literal litBinusianId = (Literal)_item.FindControl("litBinusianId");

L15

if (chkCheck.Checked == true) { txtTo.Text += litBinusianId.Text.Trim() + ";"; } } } protected void ddlClass_SelectedIndexChanged(object sender, EventArgs e) { modalSearch.Hide(); chkAll.Checked = false; List<UserData> _list = new List<UserData>(); _list = new MessageSystem().GetListBinusianByKddsnKelas(priod, kdsem, kddsn, ddlClass.SelectedItem.Value, 1); rptMahasiswa.DataSource = _list; rptMahasiswa.DataBind(); modalSearch.Show(); } protected void chkAll_CheckedChanged(object sender, EventArgs e) { if (chkAll.Checked == true) { foreach (RepeaterItem _item in rptMahasiswa.Items) { CheckBox chkCheck = (CheckBox)_item.FindControl("chkCheck"); chkCheck.Checked = true; } } else { foreach (RepeaterItem _item in rptMahasiswa.Items) { CheckBox chkCheck = (CheckBox)_item.FindControl("chkCheck"); chkCheck.Checked = false; } } modalSearch.Show(); } } }

• Inbox.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Inbox.Business.ApplicationFacade; using Inbox.Business.Entities; using Inbox.Business.Entities.Enum; using Inbox.CrossCutting.Security; using Inbox.CrossCutting.OptManagement; namespace Inbox { public partial class MessageInbox : SecurePage { private static string binusianid;

L16

protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } } protected void ShowData() { string periode; int semester; //String[] _list = ddlPeriod.Text.Split('.'); //periode = _list[0]; //semester = Convert.ToInt32(_list[1]); List<MessageData> _listData = new MessageSystem().GetMessageListByBinusianIdByPagingSearching(binusianid, ddlOrder.SelectedItem.Value, ddlOrderType.SelectedItem.Value, ddlSearch.SelectedItem.Value, txtSearch.Text.Trim(), Convert.ToInt32(SystemConfiguration.TotalShowPage), CurrPage); int jumlah = _listData.Count; if (_listData.Count == 0) { rptMessage.Visible = false; ucPagingControl.Visible = false; litEmpty.Visible = true; } else { rptMessage.Visible = true; ucPagingControl.Visible = true; litEmpty.Visible = false; rptMessage.DataSource = _listData; rptMessage.DataBind(); } } #region Paging private void FillPaging() { string periode; int semester; //String[] _list = ddlPeriod.Text.Split('.'); //periode = _list[0]; //semester = Convert.ToInt32(_list[1]);

L17

int countPage = new MessageSystem().GetMessageListByBinusianIdByPagingSearchingDataCount(binusianid, ddlSearch.SelectedItem.Value, txtSearch.Text.Trim(), 0); int sumPage = 1; if (countPage % Convert.ToInt32(SystemConfiguration.TotalShowPage) == 0) { sumPage = countPage / Convert.ToInt32(SystemConfiguration.TotalShowPage); } else { sumPage = countPage / Convert.ToInt32(SystemConfiguration.TotalShowPage) + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); } #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack)

L18

{ pnlError.Visible = false; pnlSuccess.Visible = false; litEmpty.Visible = false; SaveViewStates(); binusianid = Session["UserId"].ToString().Trim(); ddlSearch.Items.Add(new ListItem("Sender Id", "senderid")); ddlSearch.Items.Add(new ListItem("Name", "namanongelar")); ddlSearch.Items.Add(new ListItem("Subject", "subject")); ddlSearch.Items.Add(new ListItem("Content", "message")); ddlOrder.Items.Add(new ListItem("Date", "datein")); ddlOrder.Items.Add(new ListItem("Subject", "subject")); ddlOrder.Items.Add(new ListItem("Sender", "senderid")); ddlOrder.Items.Add(new ListItem("Has Read", "isnew")); ddlOrderType.Items.Add(new ListItem("Descending", "desc")); ddlOrderType.Items.Add(new ListItem("Ascending", "asc")); //ddlPeriod.DataSource = new MessageSystem().getPeriodeForDDLPeriode(binusianid); //ddlPeriod.DataBind(); ShowData(); ucPagingControl.CurrentPage = CurrPage; FillPaging(); if (!new UserSystem().CheckStatusGabungan(binusianid, 2)) { btnForward.Visible = false; // btnReply.Visible = false; } btnDelete.Attributes.Add("onclick", "return confirm('Are you sure want to delete this message?');"); // btnSpam.Attributes.Add("onclick", "return confirm('Are you sure want to report this message as spam?');"); btnBlock.Attributes.Add("onclick", "return confirm('Are you sure want to block this sender?');"); btnBlock.Visible = false; } else { ucPagingControl.DataBind(); } } protected void rptMessage_ItemDataBound(Object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { MessageData data = (MessageData)e.Item.DataItem; LinkButton lnkSubject = (LinkButton)e.Item.FindControl("lnkSubject"); LinkButton lnkFrom = (LinkButton)e.Item.FindControl("lnkFrom"); LinkButton lnkDate = (LinkButton)e.Item.FindControl("lnkDate"); Literal litNew = (Literal)e.Item.FindControl("litNew"); HiddenField hfMsMessageId = (HiddenField)e.Item.FindControl("hfMsMessageId"); HiddenField hfBinusianId = (HiddenField)e.Item.FindControl("hfBinusianId"); HiddenField hdfIsCanReply = (HiddenField)e.Item.FindControl("hdfIsCanReply");

L19

hdfIsCanReply.Value = data.IsCanReply.ToString().Trim(); hfMsMessageId.Value = data.MsMessageId.Trim(); hfBinusianId.Value = data.SenderId.Trim(); if (data.IsNew == 1) { lnkSubject.Text = "<b>" + data.Subject.Trim() + "</b>"; lnkSubject.PostBackUrl = "~/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(data.MsMessageId)); if (data.IsNotVisibleFrom == 0) { lnkFrom.Text = "<b>" + data.SenderId.Trim() + " - " + data.NamaNonGelar.Trim() + "</b>"; } else { lnkFrom.Text = " - "; } lnkFrom.PostBackUrl = "~/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(data.MsMessageId)); lnkDate.Text = "<b>" + data.SendDate.Trim() + "</b>"; lnkDate.PostBackUrl = "~/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(data.MsMessageId)); litNew.Visible = true; } else { lnkSubject.Text = data.Subject.Trim(); lnkSubject.PostBackUrl = "~/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(data.MsMessageId)); if (data.IsNotVisibleFrom == 0) { lnkFrom.Text = data.SenderId.Trim() + " - " + data.NamaNonGelar.Trim(); } else { lnkFrom.Text = " - "; } lnkFrom.PostBackUrl = "~/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(data.MsMessageId)); lnkDate.Text = data.SendDate.Trim(); lnkDate.PostBackUrl = "~/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(data.MsMessageId)); litNew.Visible = false; } } } protected void btnSearch_Click(object sender, EventArgs e) { ShowData(); ucPagingControl.CurrentPage = CurrPage; FillPaging(); } protected void ddlOrder_SelectedIndexChanged(object sender, EventArgs e) { ShowData();

L20

ucPagingControl.CurrentPage = CurrPage; FillPaging(); } protected void ddlOrderType_SelectedIndexChanged(object sender, EventArgs e) { ShowData(); ucPagingControl.CurrentPage = CurrPage; FillPaging(); } protected void btnDelete_Click(object sender, EventArgs e) { pnlError.Visible = false; pnlSuccess.Visible = false; int delete = 0; foreach (RepeaterItem _item in rptMessage.Items) { CheckBox chkChoose = (CheckBox)_item.FindControl("chkChoose"); HiddenField hfMsMessageId = (HiddenField)_item.FindControl("hfMsMessageId"); if (chkChoose.Checked == true) { bool success = new MessageSystem().InsertUpdateTrashMessage(binusianid, hfMsMessageId.Value, 1, binusianid, 1); if (success) { delete++; } } } if (delete == 0) { litError.Text = "You Must Choose Minimal 1 Message To Perform This Action."; pnlError.Visible = true; } else { litSuccess.Text = "Success Deleting Message."; pnlSuccess.Visible = true; ShowData(); ucPagingControl.CurrentPage = CurrPage; FillPaging(); } } protected void btnReply_Click(object sender, EventArgs e) { string id = ""; pnlError.Visible = false; pnlSuccess.Visible = false; int iscanreply = 0; int item = 0; foreach (RepeaterItem _item in rptMessage.Items) { CheckBox chkChoose = (CheckBox)_item.FindControl("chkChoose"); HiddenField hfMsMessageId = (HiddenField)_item.FindControl("hfMsMessageId"); HiddenField hdfIsCanReply = (HiddenField)_item.FindControl("hdfIsCanReply"); if (chkChoose.Checked == true)

L21

{ iscanreply = Convert.ToInt32(hdfIsCanReply.Value); id = hfMsMessageId.Value; item++; } } if (item != 1) { litError.Text = "You Must Choose Exactly 1 Message To Perform This Action."; pnlError.Visible = true; } else { if (iscanreply == 1) { Response.Redirect("~/CreateMessage.aspx?r=1&id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(id))); } else { litError.Text = "You Cannot Reply This Message."; pnlError.Visible = true; } } } protected void btnForward_Click(object sender, EventArgs e) { pnlError.Visible = false; pnlSuccess.Visible = false; string id = ""; int item = 0; foreach (RepeaterItem _item in rptMessage.Items) { CheckBox chkChoose = (CheckBox)_item.FindControl("chkChoose"); HiddenField hfMsMessageId = (HiddenField)_item.FindControl("hfMsMessageId"); if (chkChoose.Checked == true) { id = hfMsMessageId.Value; item++; } } if (item != 1) { litError.Text = "You Must Choose Exactly 1 Message To Perform This Action."; pnlError.Visible = true; } else { Response.Redirect("~/CreateMessage.aspx?f=1&id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(id))); } } protected void btnSpam_Click(object sender, EventArgs e) { pnlError.Visible = false; pnlSuccess.Visible = false; string binusianidspam = ""; string msmessageid = "";

L22

int item = 0; foreach (RepeaterItem _item in rptMessage.Items) { CheckBox chkChoose = (CheckBox)_item.FindControl("chkChoose"); HiddenField hfMsMessageId = (HiddenField)_item.FindControl("hfMsMessageId"); HiddenField hfBinusianId = (HiddenField)_item.FindControl("hfBinusianId"); if (chkChoose.Checked == true) { binusianidspam = hfBinusianId.Value.Trim(); msmessageid = hfMsMessageId.Value.Trim(); item++; } } if (item == 0) { litError.Text = "You Must Choose Minimal 1 Message To Perform This Action."; pnlError.Visible = true; } else { bool success = new MessageSystem().InsertUpdateTrSpamMessage(binusianid, binusianidspam, msmessageid, "A", binusianid, "0"); ShowData(); ucPagingControl.CurrentPage = CurrPage; FillPaging(); } } protected void btnBlock_Click(object sender, EventArgs e) { pnlError.Visible = false; pnlSuccess.Visible = false; string binusianidspam = ""; string msmessageid = ""; int item = 0; foreach (RepeaterItem _item in rptMessage.Items) { CheckBox chkChoose = (CheckBox)_item.FindControl("chkChoose"); HiddenField hfMsMessageId = (HiddenField)_item.FindControl("hfMsMessageId"); HiddenField hfBinusianId = (HiddenField)_item.FindControl("hfBinusianId"); if (chkChoose.Checked == true) { binusianidspam = hfBinusianId.Value.Trim(); msmessageid = hfMsMessageId.Value.Trim(); item++; } } if (item == 0) { litError.Text = "You Must Choose Minimal 1 Message To Perform This Action."; pnlError.Visible = true; }

L23

else { bool success = new MessageSystem().InsertUpdateTrBlockMessage(binusianid, binusianidspam, "A", binusianid); ShowData(); ucPagingControl.CurrentPage = CurrPage; FillPaging(); } } //protected void ddlPeriod_SelectedIndexChanged(object sender, EventArgs e) //{ // ShowData(); // ucPagingControl.CurrentPage = CurrPage; // FillPaging(); //} } }

• Outbox.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BinusmayaV3.Business.ApplicationFacade; using BinusmayaV3.Business.Entities; using BinusmayaV3.Business.Entities.Enum; using BinusmayaV3.CrossCutting.Security; using BinusmayaV3.CrossCutting.OperationalManagement; namespace BinusmayaV3.Message { public partial class Outbox : System.Web.UI.Page { private static string binusianid; protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } } protected void ShowData() {

L24

List<MessageData> _listData = new MessageSystem().GetOutboxListByBinusianIdByPagingSearching(binusianid, ddlOrder.SelectedItem.Value, ddlOrderType.SelectedItem.Value, ddlSearch.SelectedItem.Value, txtSearch.Text.Trim(), Convert.ToInt32(SystemConfiguration.TotalShowPage), CurrPage); int jumlah = _listData.Count; if (_listData.Count == 0) { rptMessage.Visible = false; ucPagingControl.Visible = false; litEmpty.Visible = true; } else { rptMessage.DataSource = _listData; rptMessage.DataBind(); } } #region Paging private void FillPaging() { int countPage = new MessageSystem().GetOutboxListByBinusianIdByPagingSearchingDataCount(binusianid, ddlSearch.SelectedItem.Value, txtSearch.Text.Trim()); int sumPage = 1; if (countPage % Convert.ToInt32(SystemConfiguration.TotalShowPage) == 0) { sumPage = countPage / Convert.ToInt32(SystemConfiguration.TotalShowPage); } else { sumPage = countPage / Convert.ToInt32(SystemConfiguration.TotalShowPage) + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); } #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage;

L25

} else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { pnlError.Visible = false; pnlSuccess.Visible = false; litEmpty.Visible = false; SaveViewStates(); binusianid = Session["UserId"].ToString().Trim(); if (!new UserSystem().CheckStatusGabungan(binusianid, 2)) { btnForward.Visible = false; btnReply.Visible = false; } ddlSearch.Items.Add(new ListItem("To", "ListBinusian")); ddlSearch.Items.Add(new ListItem("Name", "namanongelar")); ddlSearch.Items.Add(new ListItem("Subject", "subject")); ddlSearch.Items.Add(new ListItem("Content", "message")); ddlOrder.Items.Add(new ListItem("Date", "datein")); ddlOrder.Items.Add(new ListItem("Subject", "subject")); ddlOrder.Items.Add(new ListItem("To", "listbinusian")); ddlOrderType.Items.Add(new ListItem("Descending", "desc")); ddlOrderType.Items.Add(new ListItem("Ascending", "asc")); ShowData(); ucPagingControl.CurrentPage = CurrPage; FillPaging(); btnDelete.Attributes.Add("onclick", "return confirm('Are you sure want to delete this message?');"); } else { ucPagingControl.DataBind(); } } protected void rptMessage_ItemDataBound(Object sender, RepeaterItemEventArgs e) {

L26

if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { MessageData data = (MessageData)e.Item.DataItem; LinkButton lnkSubject = (LinkButton)e.Item.FindControl("lnkSubject"); LinkButton lnkTo = (LinkButton)e.Item.FindControl("lnkTo"); LinkButton lnkDate = (LinkButton)e.Item.FindControl("lnkDate"); Literal litNew = (Literal)e.Item.FindControl("litNew"); HiddenField hfMsMessageId = (HiddenField)e.Item.FindControl("hfMsMessageId"); HiddenField hfBinusianId = (HiddenField)e.Item.FindControl("hfBinusianId"); hfMsMessageId.Value = data.MsMessageId.Trim(); hfBinusianId.Value = data.SenderId.Trim(); if (data.IsNew == 1) { lnkSubject.Text = "<b>" + data.Subject.Trim() + "</b>"; lnkSubject.PostBackUrl = "~/Message/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(data.MsMessageId)); lnkTo.Text = "<b>" + data.SenderId.Trim() + " - " + data.NamaNonGelar.Trim() + "</b>"; lnkTo.PostBackUrl = "~/Message/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(data.MsMessageId)); lnkDate.Text = "<b>" + data.SendDate.Trim() + "</b>"; lnkDate.PostBackUrl = "~/Message/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(data.MsMessageId)); litNew.Visible = true; } else { lnkSubject.Text = data.Subject.Trim(); lnkSubject.PostBackUrl = "~/Message/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(data.MsMessageId)); lnkTo.Text = data.ListBinusian.Trim(); lnkTo.PostBackUrl = "~/Message/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(data.MsMessageId)); lnkDate.Text = data.SendDate.Trim(); lnkDate.PostBackUrl = "~/Message/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(data.MsMessageId)); litNew.Visible = false; } } } protected void btnSearch_Click(object sender, EventArgs e) { ShowData(); ucPagingControl.CurrentPage = CurrPage; FillPaging(); } protected void ddlOrder_SelectedIndexChanged(object sender, EventArgs e) { ShowData(); ucPagingControl.CurrentPage = CurrPage; FillPaging(); } protected void ddlOrderType_SelectedIndexChanged(object sender, EventArgs e) { ShowData();

L27

ucPagingControl.CurrentPage = CurrPage; FillPaging(); } protected void btnDelete_Click(object sender, EventArgs e) { pnlError.Visible = false; pnlSuccess.Visible = false; int delete = 0; foreach (RepeaterItem _item in rptMessage.Items) { CheckBox chkChoose = (CheckBox)_item.FindControl("chkChoose"); HiddenField hfMsMessageId = (HiddenField)_item.FindControl("hfMsMessageId"); if (chkChoose.Checked == true) { bool success = new MessageSystem().DeleteMessage(binusianid, hfMsMessageId.Value, 1); if (success) { delete++; } } } if (delete == 0) { litError.Text = "You Must Choose Minimal 1 Message To Perform This Action."; pnlError.Visible = true; } else { litSuccess.Text = "Success Deleting Message."; pnlSuccess.Visible = true; ShowData(); ucPagingControl.CurrentPage = CurrPage; FillPaging(); } } protected void btnReply_Click(object sender, EventArgs e) { string id = ""; pnlError.Visible = false; pnlSuccess.Visible = false; int item = 0; foreach (RepeaterItem _item in rptMessage.Items) { CheckBox chkChoose = (CheckBox)_item.FindControl("chkChoose"); HiddenField hfMsMessageId = (HiddenField)_item.FindControl("hfMsMessageId"); if (chkChoose.Checked == true) { id = hfMsMessageId.Value; item++; } } if (item != 1) {

L28

litError.Text = "You Must Choose Exactly 1 Message To Perform This Action."; pnlError.Visible = true; } else { Response.Redirect("~/Message/CreateMessage.aspx?r=1&id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(id))); } } protected void btnForward_Click(object sender, EventArgs e) { pnlError.Visible = false; pnlSuccess.Visible = false; string id = ""; int item = 0; foreach (RepeaterItem _item in rptMessage.Items) { CheckBox chkChoose = (CheckBox)_item.FindControl("chkChoose"); HiddenField hfMsMessageId = (HiddenField)_item.FindControl("hfMsMessageId"); if (chkChoose.Checked == true) { id = hfMsMessageId.Value; item++; } } if (item != 1) { litError.Text = "You Must Choose Exactly 1 Message To Perform This Action."; pnlError.Visible = true; } else { Response.Redirect("~/Message/CreateMessage.aspx?f=1&id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(id))); } } } }

• ReadMessage.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BinusmayaV3.Business.ApplicationFacade; using BinusmayaV3.Business.Entities; using BinusmayaV3.CrossCutting.Security; namespace BinusmayaV3.Message { public partial class ReadMessage : System.Web.UI.Page { protected string ID

L29

{ get { return Convert.ToString(ViewState["id"]); } set { ViewState["id"] = value; } } private void SaveViewStates() { if (Request.QueryString["id"] != null) { string tempId = Request.QueryString["id"].ToString().Trim(); ID = Convert.ToString(Rijndael.Decrypt(tempId)); } } private static string binusianid,binusianidspam; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SaveViewStates(); binusianid = Session["UserId"].ToString(); if (!new UserSystem().CheckStatusGabungan(binusianid, 2)) { btnForward.Visible = false; // btnReply.Visible = false; } bool insert = new MessageSystem().InsertUpdateTrAccessMessage(binusianid, ID); if (!insert) { Response.Redirect("~/Message/Inbox.aspx"); } MessageData _data = new MessageSystem().GetMessageDetail(binusianid, ID); litSubject.Text = _data.Subject; litSender.Text = _data.SenderId + " - " + _data.SenderName; litTo.Text = _data.ListBinusian; litDate.Text = _data.SendDate; litContent.Text = _data.Message; binusianidspam = _data.SenderId; btnDelete.Attributes.Add("onclick", "return confirm('Are you sure want to delete this message?');"); } } protected void btnDelete_Click(object sender, EventArgs e) { bool success = new MessageSystem().DeleteMessage(binusianid, ID, 0); if (success) { Response.Redirect("~/Message/Inbox.aspx"); } } protected void btnReply_Click(object sender, EventArgs e)

L30

{ Response.Redirect("~/Message/CreateMessage.aspx?rd=1&r=1&id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(ID))); } protected void btnForward_Click(object sender, EventArgs e) { Response.Redirect("~/Message/CreateMessage.aspx?rd=1&f=1&id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(ID))); } } }

• Trash.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BinusmayaV3.Business.ApplicationFacade; using BinusmayaV3.Business.Entities; using BinusmayaV3.Business.Entities.Enum; using BinusmayaV3.CrossCutting.Security; using BinusmayaV3.CrossCutting.OperationalManagement; namespace BinusmayaV3.Message { public partial class Trash : System.Web.UI.Page { private static string binusianid; protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } } protected void ShowData() { List<MessageData> _listData = new MessageSystem().GetTrashListByBinusianIdByPagingSearching(binusianid, ddlOrder.SelectedItem.Value, ddlOrderType.SelectedItem.Value,

L31

ddlSearch.SelectedItem.Value, txtSearch.Text.Trim(), Convert.ToInt32(SystemConfiguration.TotalShowPage), CurrPage); int jumlah = _listData.Count; if (_listData.Count == 0) { rptMessage.Visible = false; ucPagingControl.Visible = false; litEmpty.Visible = true; } else { rptMessage.DataSource = _listData; rptMessage.DataBind(); } } #region Paging private void FillPaging() { int countPage = new MessageSystem().GetTrashListByBinusianIdByPagingSearchingDataCount(binusianid, ddlSearch.SelectedItem.Value, txtSearch.Text.Trim()); int sumPage = 1; if (countPage % Convert.ToInt32(SystemConfiguration.TotalShowPage) == 0) { sumPage = countPage / Convert.ToInt32(SystemConfiguration.TotalShowPage); } else { sumPage = countPage / Convert.ToInt32(SystemConfiguration.TotalShowPage) + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); } #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) {

L32

// ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { pnlError.Visible = false; pnlSuccess.Visible = false; litEmpty.Visible = false; SaveViewStates(); binusianid = Session["UserId"].ToString().Trim(); ddlSearch.Items.Add(new ListItem("Sender Id", "senderid")); ddlSearch.Items.Add(new ListItem("Name", "namanongelar")); ddlSearch.Items.Add(new ListItem("Subject", "subject")); ddlSearch.Items.Add(new ListItem("Content", "message")); ddlOrder.Items.Add(new ListItem("Date", "datein")); ddlOrder.Items.Add(new ListItem("Subject", "subject")); ddlOrder.Items.Add(new ListItem("Sender", "senderid")); ddlOrder.Items.Add(new ListItem("Has Read", "isnew")); ddlOrderType.Items.Add(new ListItem("Descending", "desc")); ddlOrderType.Items.Add(new ListItem("Ascending", "asc")); ShowData(); ucPagingControl.CurrentPage = CurrPage; FillPaging(); btnDelete.Attributes.Add("onclick", "return confirm('Are you sure want to delete this message?');"); btnNotSpam.Attributes.Add("onclick", "return confirm('Are you sure want to restore this message?');"); if (!new UserSystem().CheckStatusGabungan(binusianid, 2)) { btnForward.Visible = false; // btnReply.Visible = false; } } else { ucPagingControl.DataBind(); } } protected void rptMessage_ItemDataBound(Object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)

L33

{ MessageData data = (MessageData)e.Item.DataItem; LinkButton lnkSubject = (LinkButton)e.Item.FindControl("lnkSubject"); LinkButton lnkFrom = (LinkButton)e.Item.FindControl("lnkFrom"); LinkButton lnkDate = (LinkButton)e.Item.FindControl("lnkDate"); Literal litNew = (Literal)e.Item.FindControl("litNew"); HiddenField hfMsMessageId = (HiddenField)e.Item.FindControl("hfMsMessageId"); HiddenField hfBinusianId = (HiddenField)e.Item.FindControl("hfBinusianId"); hfMsMessageId.Value = data.MsMessageId.Trim(); hfBinusianId.Value = data.SenderId.Trim(); if (data.IsNew == 1) { lnkSubject.Text = "<b>" + data.Subject.Trim() + "</b>"; lnkSubject.PostBackUrl = "~/Message/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(data.MsMessageId)); lnkFrom.Text = "<b>" + data.SenderId.Trim() + " - " + data.NamaNonGelar.Trim() + "</b>"; lnkFrom.PostBackUrl = "~/Message/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(data.MsMessageId)); lnkDate.Text = "<b>" + data.SendDate.Trim() + "</b>"; lnkDate.PostBackUrl = "~/Message/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(data.MsMessageId)); litNew.Visible = true; } else { lnkSubject.Text = data.Subject.Trim(); lnkSubject.PostBackUrl = "~/Message/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(data.MsMessageId)); lnkFrom.Text = "<b>" + data.SenderId.Trim() + " - " + data.NamaNonGelar.Trim() + "</b>"; lnkFrom.PostBackUrl = "~/Message/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(data.MsMessageId)); lnkDate.Text = data.SendDate.Trim(); lnkDate.PostBackUrl = "~/Message/ReadMessage.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(data.MsMessageId)); litNew.Visible = false; } } } protected void btnSearch_Click(object sender, EventArgs e) { ShowData(); ucPagingControl.CurrentPage = CurrPage; FillPaging(); } protected void ddlOrder_SelectedIndexChanged(object sender, EventArgs e) { ShowData(); ucPagingControl.CurrentPage = CurrPage; FillPaging(); } protected void ddlOrderType_SelectedIndexChanged(object sender, EventArgs e) { ShowData();

L34

ucPagingControl.CurrentPage = CurrPage; FillPaging(); } protected void btnDelete_Click(object sender, EventArgs e) { pnlError.Visible = false; pnlSuccess.Visible = false; int delete = 0; foreach (RepeaterItem _item in rptMessage.Items) { CheckBox chkChoose = (CheckBox)_item.FindControl("chkChoose"); HiddenField hfMsMessageId = (HiddenField)_item.FindControl("hfMsMessageId"); if (chkChoose.Checked == true) { bool success = new MessageSystem().DeletePermanentMessage(binusianid, hfMsMessageId.Value, 0); if (success) { delete++; } } } if (delete == 0) { litError.Text = "You Must Choose Minimal 1 Message To Perform This Action."; pnlError.Visible = true; } else { litSuccess.Text = "Success Deleting Message."; pnlSuccess.Visible = true; ShowData(); ucPagingControl.CurrentPage = CurrPage; FillPaging(); } } protected void btnReply_Click(object sender, EventArgs e) { string id = ""; pnlError.Visible = false; pnlSuccess.Visible = false; int item = 0; foreach (RepeaterItem _item in rptMessage.Items) { CheckBox chkChoose = (CheckBox)_item.FindControl("chkChoose"); HiddenField hfMsMessageId = (HiddenField)_item.FindControl("hfMsMessageId"); if (chkChoose.Checked == true) { id = hfMsMessageId.Value; item++; } } if (item != 1) {

L35

litError.Text = "You Must Choose Exactly 1 Message To Perform This Action."; pnlError.Visible = true; } else { Response.Redirect("~/Message/CreateMessage.aspx?r=1&id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(id))); } } protected void btnForward_Click(object sender, EventArgs e) { pnlError.Visible = false; pnlSuccess.Visible = false; string id = ""; int item = 0; foreach (RepeaterItem _item in rptMessage.Items) { CheckBox chkChoose = (CheckBox)_item.FindControl("chkChoose"); HiddenField hfMsMessageId = (HiddenField)_item.FindControl("hfMsMessageId"); if (chkChoose.Checked == true) { id = hfMsMessageId.Value; item++; } } if (item != 1) { litError.Text = "You Must Choose Exactly 1 Message To Perform This Action."; pnlError.Visible = true; } else { Response.Redirect("~/Message/CreateMessage.aspx?f=1&id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(id))); } } protected void btnRestore_Click(object sender, EventArgs e) { pnlError.Visible = false; pnlSuccess.Visible = false; string binusianidspam = ""; string msmessageid = ""; int item = 0; foreach (RepeaterItem _item in rptMessage.Items) { CheckBox chkChoose = (CheckBox)_item.FindControl("chkChoose"); HiddenField hfMsMessageId = (HiddenField)_item.FindControl("hfMsMessageId"); HiddenField hfBinusianId = (HiddenField)_item.FindControl("hfBinusianId"); if (chkChoose.Checked == true) { binusianidspam = hfBinusianId.Value.Trim(); msmessageid = hfMsMessageId.Value.Trim(); item++; }

L36

} if (item != 1) { litError.Text = "You Must Choose Exactly 1 Message To Perform This Action."; pnlError.Visible = true; } else { bool success = new MessageSystem().InsertUpdateTrRestoreMessage(binusianid, msmessageid, "D", binusianid, "0"); ShowData(); ucPagingControl.CurrentPage = CurrPage; FillPaging(); } } } }

• ChangePassword.aspx.cs

using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Collections.Generic; using BinusmayaV3.Business.ApplicationFacade; using BinusmayaV3.Business.Entities; using BinusmayaV3.CrossCutting.Security; using BinusmayaV3.CrossCutting.OperationalManagement; using BinusmayaV3.UserControl; using System.Net.Mail; using System.Text.RegularExpressions; using BinusmayaV3.Business.Entities.Enum; namespace BinusmayaV3 { public partial class ChangePassword : System.Web.UI.Page { #region printWarn private void printWarn(string msg) { if (msg.Trim() != "") { lblWarn.Visible = true; lblWarn.Text = msg; } else { lblWarn.Visible = false; } } #endregion

L37

#region printWarnHint private void printWarnHint(string msg) { if (msg.Trim() != "") { lblWarnHint.Visible = true; lblWarnHint.Text = msg; } else { lblWarnHint.Visible = false; } } #endregion #region cekStrongPassword private bool cekStrongPassword(string pwd) { //string pattern = "̂ [a-zA-Z]\\w{3,14}$"; printWarn(Convert.ToString(Regex.Match(pwd, SystemConfiguration.RegexStrongPassword.ToString()))); if (Regex.Match(pwd, SystemConfiguration.RegexStrongPassword.ToString()).ToString().Trim() != "") { return true; } else { return false; } } #endregion protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["UserId"] != null) { pnlNoHint.Visible = false; String emailStatus = ""; if (Session["NoEmail"] != null) { emailStatus = Session["NoEmail"].ToString().Trim(); } if (emailStatus == "1") { Response.Redirect("CreateEmail.aspx"); } if (Session["defPass"] != null) { if (Session["defPass"].ToString() == "1") { pnlDefPass.Visible = true; } else { pnlDefPass.Visible = false; } } if (Session["hint"] != null) { if (Session["hint"].ToString() == "1") { pnlNoHint.Visible = true; }

L38

else { pnlNoHint.Visible = false; } } printWarn(""); printWarnHint(""); //generate image ucSecureImageControl.GenerateNewCode(); //load hint //AccountData accountData = new AccountData(); //accountData = (AccountData)Session[SessionNameFactory.AccountData]; // txtHint.Text = new BusinessFacade.StudentSystem().returnHintStudent(accountData.UserID); txtHint.Text = new UserSystem().GetHint(Session["UserId"].ToString()); } else { Response.Redirect("~/Default.aspx"); } } } protected void btnSubmit_Click(object sender, EventArgs e) { //Page.Validate(); //if (Page.IsValid) //{ lblWarn.Text = ""; txtOldPassword.Text = txtOldPassword.Text.Trim(); txtNewPassword.Text = txtNewPassword.Text.Trim(); txtConfirmPassword.Text = txtConfirmPassword.Text.Trim(); if (txtOldPassword.Text == "") { ucSecureImageControl.GenerateNewCode(); printWarn("Old password cannot be null!!"); return; } if (txtNewPassword.Text == "") { ucSecureImageControl.GenerateNewCode(); printWarn("New password cannot be null!!"); return; } if (txtConfirmPassword.Text == "") { ucSecureImageControl.GenerateNewCode(); printWarn("New password (confirm) cannot be null!!"); return; } if (!ucSecureImageControl.IsInputValid) { ucSecureImageControl.GenerateNewCode(); return; } String user = Session["Userid"].ToString();

L39

if (txtNewPassword.Text != txtConfirmPassword.Text) { ucSecureImageControl.GenerateNewCode(); printWarn("New password must be the same as confirm new password!!"); txtConfirmPassword.Focus(); } else { // /*CEK OLD PASSWORD*/ string oldpass = FormsAuthentication.HashPasswordForStoringInConfigFile(txtOldPassword.Text, SystemConfiguration.Hash); string newpass =txtNewPassword.Text; int Result = new UserSystem().checkPassword(user, oldpass, newpass); if (Result==2) { ucSecureImageControl.GenerateNewCode(); printWarn("<ul class='list1'><li>Invalid old password!!</li></ul>"); txtOldPassword.Focus(); return; } else if(Result==3) { ucSecureImageControl.GenerateNewCode(); printWarn("<ul class='list1'><li>Please do not use default password as your password!!</li></ul>"); txtNewPassword.Focus(); return; } bool bSuccessLogin = false; bool cSuccessLogin = false; //CEK NEW PASSWORD if (cekStrongPassword(txtNewPassword.Text)) { bSuccessLogin = true; } else { ucSecureImageControl.GenerateNewCode(); printWarn("<ul class='list1'><li>Wrong format new password!!</li></ul>"); bSuccessLogin = false; return; } //CEK CONFIRM PASSWORD if (cekStrongPassword(txtConfirmPassword.Text)) { cSuccessLogin = true; } else { ucSecureImageControl.GenerateNewCode(); printWarn("<ul class='list1'><li>Wrong format new password (confirm)!!</li></ul>"); cSuccessLogin = false; return;

L40

} newpass = FormsAuthentication.HashPasswordForStoringInConfigFile(newpass, SystemConfiguration.Hash); if (bSuccessLogin && cSuccessLogin) { string pwd = txtNewPassword.Text.Trim(); string oldPwd = txtOldPassword.Text.Trim(); //save ke dalam database bool boolSave; boolSave = new UserSystem().updateNewPasswordBinusian(user, newpass); if (boolSave) { UserData userData = new UserSystem().GetUserDataByBinusianId(user); Session["defPass"] = "0"; string email = userData.Email; DateTime dt = DateTime.Now; MailAddress to = new MailAddress(email); MailAddress from = new MailAddress(SystemConfiguration.AdminEmail); MailMessage mailMessage = new MailMessage(from, to); //mailMessage.CC.Add(email); mailMessage.Subject = "[NewBinusMaya] You Have Changed Your NewBinusMaya Password"; string body = "Password baru Anda adalah : " + pwd + "\r\n\r\n" + "Your new password is : " + pwd + "\r\n\r\n" + "Regards,\r\n" + "New BinusMaya HelpDesk"; mailMessage.Body = body; try { SmtpClient smtpClient = new SmtpClient(SystemConfiguration.SMTPServer); smtpClient.Send(mailMessage); } catch (Exception ex) { printWarn("<ul class='list1'><li>Error sending email. Please try again.</li></ul>"); } //assign new password ke accountData //LinkButton lnkLogout = (LinkButton)Master.FindControl("lnkLogout"); //Label Separator3 = (Label)Master.FindControl("Separator3"); //Response.Redirect("~/Default.aspx"); panelChangePassword.Visible = false; panelSuccess.Visible = true; pnlDefPass.Visible = false; string hint = new UserSystem().GetHint(Session["UserId"].ToString()); if (hint == null) { hint = ""; } if (hint != "")

L41

{ Session["hint"] = "0"; //lnkLogout.Visible = true; //Separator3.Visible = true; } else { txtHint.Text = ""; Session["hint"] = "1"; pnlNoHint.Visible = true; } } else { ucSecureImageControl.GenerateNewCode(); printWarn("<ul class='list1'><li>Error when saving to database!!</li></ul>"); } } } } protected void btnReset_Click(object sender, EventArgs e) { Response.Redirect("~/ChangePassword.aspx"); } protected void btnSubmitHint_Click(object sender, EventArgs e) { printWarnHint(""); //save hint dan answer bool boolResult = false; //LinkButton lnkLogout = (LinkButton)Master.FindControl("lnkLogout"); //Label Separator3 = (Label)Master.FindControl("Separator3"); boolResult = new UserSystem().SaveHintAndAnswer(Session["Userid"].ToString(), txtHint.Text.Trim(), txtAnswer.Text.Trim()); if (boolResult) { panelSuccessHint.Visible = true; panelHint.Visible = false; pnlNoHint.Visible = false; Session["hint"] = "0"; List<string> _list = new UserSystem().checkisDefaultPassword(Session["UserId"].ToString()); string pwd = _list[0].ToString(); string pwd2 = _list[1].ToString(); pwd2 = FormsAuthentication.HashPasswordForStoringInConfigFile(pwd2, SystemConfiguration.Hash); if (pwd.Trim() != pwd2.Trim()) { Session["defPass"] = "0"; pnlDefPass.Visible = false; //lnkLogout.Visible = true; //Separator3.Visible = true; } else { Session["defPass"] = "1"; pnlDefPass.Visible = true; } }

L42

} protected void btnResetHint_Click(object sender, EventArgs e) { Response.Redirect("~/ChangePassword.aspx"); } } }

• CreateEmail.aspx.cs

using System; using System.Data; using System.Configuration; using System.Collections; using System.Security; using System.Security.Cryptography; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; using BinusmayaV3.Business.ApplicationFacade; using BinusmayaV3.Business.Entities; using BinusmayaV3.CrossCutting.Security; using BinusmayaV3.CrossCutting.OperationalManagement; using BinusmayaV3.UserControl; namespace BinusmayaV3 { public partial class CreateEmail : System.Web.UI.Page { string userID =""; protected void Page_Load(object sender, EventArgs e) { if (Session["UserId"] == null) { Response.Redirect("Default.aspx"); } if (Session["UserId"] != null) { userID = new UserSystem().GetUserDataByBinusianId(Session["UserId"].ToString()).UserId.ToString().Trim(); if (!IsPostBack) { String LecturerStatus = ""; if (Session["IsLecturer"] != null) { LecturerStatus = Session["IsLecturer"].ToString().Trim(); } String emailStatus = ""; if (Session["NoEmail"] != null) { emailStatus = Session["NoEmail"].ToString().Trim(); } if (emailStatus == "1") { if (LecturerStatus == null || LecturerStatus == "") { placeHolderCreateEmailLecturer.Visible = false;

L43

placeHolderCreateEmailStudent.Visible = true; pnlConfirmationStudent.Visible = false; pnlDataStudent.Visible = false; pnlStudentEmail.Visible = true; } else if (LecturerStatus == "1") { placeHolderCreateEmailLecturer.Visible = true; placeHolderCreateEmailStudent.Visible = false; pnlConfirmationLecturer.Visible = false; pnlDataLecturer.Visible = false; pnlLecturerEmail.Visible = true; } } else { if (LecturerStatus == null || LecturerStatus == "") { placeHolderCreateEmailStudent.Visible = true; placeHolderCreateEmailLecturer.Visible = false; pnlDataStudent.Visible = false; pnlStudentEmail.Visible = false; pnlConfirmationStudent.Visible = true; MailData mailData = new MailSystem().GetStudentEmail(userID); ltCreatedEmailStudent.Text = mailData.UserName; ltDateStudent.Text = mailData.InputDate.AddDays(1).ToLongDateString(); } else if (LecturerStatus == "1") { placeHolderCreateEmailLecturer.Visible = true; placeHolderCreateEmailStudent.Visible = false; pnlDataLecturer.Visible = false; pnlLecturerEmail.Visible = false; pnlConfirmationLecturer.Visible = true; string kdDosen = new UserSystem().GetKdDosenForLecturer(userID); MailData mailData = new MailSystem().GetLecturerEmail(kdDosen); ltCreatedEmailLecturer.Text = mailData.UserName; ltDateLecturer.Text = mailData.InputDate.AddDays(1).ToLongDateString(); } } } } } protected void btnAgreeEmailStudent_Click(object sender, EventArgs e) { pnlConfirmationStudent.Visible = false; pnlDataStudent.Visible = true; pnlStudentEmail.Visible = false; } protected void btnAgreeEmailLecturer_Click(object sender, EventArgs e) { pnlConfirmationLecturer.Visible = false; pnlDataLecturer.Visible = true; pnlLecturerEmail.Visible = false; } protected void btnCheckAvailableStudent_Click(object sender, EventArgs e) { if (txtUsernameStudent.Text.Trim() != "") {

L44

bool checkUserName = new MailSystem().IsEmailStudentUsernameExist(txtUsernameStudent.Text); if (checkUserName == true) { lblUserNameAvailableStudent.Text = "User name telah digunakan, silakan masukkan user name yang lain"; lblUserNameAvailableStudent.Visible = true; pnlConfirmationStudent.Visible = false; pnlDataStudent.Visible = true; } else { if (!Regex.IsMatch(txtUsernameStudent.Text.Trim(), @"^([\w-\.]+)$")) { lblUserNameAvailableStudent.Text = "User name tidak boleh menggunakan tanda petik(',\") atau spasi"; lblUserNameAvailableStudent.Visible = true; pnlConfirmationStudent.Visible = false; pnlDataStudent.Visible = true; } else { lblUserNameAvailableStudent.Text = "User name tersedia"; lblUserNameAvailableStudent.Visible = true; pnlConfirmationStudent.Visible = false; pnlDataStudent.Visible = true; } } } else { lblUserNameAvailableStudent.Text = "Masukkan user name email Anda"; lblUserNameAvailableStudent.Visible = true; } } protected void btnCheckAvailableLecturer_Click(object sender, EventArgs e) { if (txtUsernameLecturer.Text.Trim() != "") { int checkUserName = new MailSystem().CheckLecturersEmail(txtUsernameLecturer.Text); bool checkUserNameBool = Convert.ToBoolean(checkUserName); if (checkUserNameBool == true) { lblUserNameAvailableLecturer.Text = "User name telah digunakan, silakan masukkan user name yang lain"; lblUserNameAvailableLecturer.Visible = true; } else { if (!Regex.IsMatch(txtUsernameLecturer.Text.Trim(), @"^([\w-\.]+)$")) { lblUserNameAvailableLecturer.Text = "User name tidak boleh menggunakan tanda petik(',\") atau spasi"; lblUserNameAvailableLecturer.Visible = true; } else { lblUserNameAvailableLecturer.Text = "User name tersedia"; lblUserNameAvailableLecturer.Visible = true; } } } else { lblUserNameAvailableLecturer.Text = "Masukkan user name email Anda"; lblUserNameAvailableLecturer.Visible = true; } }

L45

protected void btnCreateEmailStudent_Click(object sender, EventArgs e) { if (IsValid) { if (txtUsernameStudent.Text.Trim() != "") { userID = new UserSystem().GetUserDataByBinusianId(Session["UserId"].ToString()).UserId.ToString().Trim(); bool checkUserName = new MailSystem().IsEmailStudentUsernameExist(txtUsernameStudent.Text); if (checkUserName == true) { lblUserNameAvailableStudent.Text = "User name telah digunakan, silakan masukkan user name yang lain"; lblUserNameAvailableStudent.Visible = true; } else { if (!Regex.IsMatch(txtUsernameStudent.Text.Trim(), @"̂ ([a-zA-Z|0-9][\w-\.]+)$")) { lblUserNameAvailableStudent.Text = "User name tidak boleh menggunakan tanda petik(',\") atau spasi"; lblUserNameAvailableStudent.Visible = true; } else { MailData mailData = new MailData(); mailData.UserName = txtUsernameStudent.Text.Trim(); mailData.Password = txtPasswordStudent.Text; mailData.StatusCreate = 0; bool createSuccess = new MailSystem().CreateEmailStudent(userID, mailData, userID); if (createSuccess == true) { Session.Remove("NoEmail"); Response.Redirect("CreateEmail.aspx"); //pnlDataStudent.Visible = false; //pnlConfirmationStudent.Visible = true; //ltCreatedEmailLecturer.Text = txtUsernameStudent.Text; //ltDateStudent.Text = DateTime.Now.AddDays(1).ToLongDateString(); } /*if (new MailSystem().CreateEmailStudent(userID, mailData, userID)) { string subject = "Detail registrasi email @binusian.org Anda"; string message = "Ini adalah alamat email Anda : " + txtUsernameStudent.Text.Trim() + ", password : " + txtPasswordStudent.Text + "<br />Anda dapat melakukan login di http://mail.binusian.org<br /><br /><br />"; string signature = "<p><br />UNIVERSITAS BINA NUSANTARA" + "<br /><br />Kampus Anggrek" + "<br />Jl. Kebon Jeruk Raya No. 27, Kebon Jeruk" + "<br />Jakarta Barat 11530" + "<br />Admission Hotline: (+62 - 21) 53 - 69 - 69 - 69, 53 - 69 - 69 - 99" + "<br />Fax. : (+62 - 21) 530 - 0244" + "<br />" + "<br />Kampus Kijang" + "<br />Jl. Kemanggisan Ilir III No. 45, Kemanggisan / Palmerah" + "<br />Jakarta Barat 11480" + "<br />Telp. : (+62 - 21) 532 - 7630" + "<br />Fax. : (+62 - 21) 533 - 2985" +

L46

"<br />" + "<br />Kampus Syahdan" + "<br />Jl. K. H. Syahdan No. 9, Kemanggisan / Palmerah" + "<br />Jakarta Barat 11480" + "<br />Telp. : (+62 - 21) 534 - 5830, 535 - 0660" + "<br />Fax. : (+62 - 21) 530 - 0244" + "<br />Email: [email protected]" + "<br />Website : www.binus.ac.id" + "</p>"; OverideMailService mailService = new OverideMailService(); string recipientEmail = new BusinessFacade.StudentSystem().GetStudentEmail(UserID); try { if (mailService.SendMail("SACBackEndMail", subject, SystemConfiguration.ForgotPasswordEmailAdmin, recipientEmail, message + signature, SystemConfiguration.SMTPBinusACID)) { dataPanel.Visible = false; confirmationPanel.Visible = true; createdEmail.Text = nameTextBox.Text; DateTime a = new DateTime(); a = DateTime.Now.AddDays(1); dateLiteral.Text = a.Day.ToString() + " " + CalendarHelper.Instance.GiveMonthName(a.Month) + " " + a.Year.ToString(); } } catch { dataPanel.Visible = false; confirmationPanel.Visible = true; createdEmail.Text = nameTextBox.Text; DateTime a = new DateTime(); a = DateTime.Now.AddDays(1); dateLiteral.Text = a.Day.ToString() + " " + CalendarHelper.Instance.GiveMonthName(a.Month) + " " + a.Year.ToString(); }*/ } } } } else { lblUserNameAvailableStudent.Text = "Masukan user name email anda"; lblUserNameAvailableStudent.Visible = true; } } public static string ParseLecturerPassword(string pass) { byte[] dataToHash = ConvertStringToByteArray(pass); byte[] hashValue = ((HashAlgorithm)CryptoConfig.CreateFromName, SystemConfiguration.Hash)).ComputeHash(dataToHash); StringBuilder sb = new StringBuilder(BitConverter.ToString(hashValue)); sb.Replace("-", ""); return sb.ToString(); } private static Byte[] ConvertStringToByteArray(String s) { return (new UnicodeEncoding()).GetBytes(s); } protected void btnCreateEmailLecturer_Click(object sender, EventArgs e)

L47

{ //LecturerSystem sistemDosen = new LecturerSystem(); //LecturerData dataDosen = new LecturerData(); //dataDosen = sistemDosen.GetCVDosen(UserID.Trim()); if (IsValid) { userID = new UserSystem().GetUserDataByBinusianId(Session["UserId"].ToString()).UserId.ToString().Trim(); int createMailResult = 0; if (txtUsernameLecturer.Text.Trim() != "") { int checkUserName = new MailSystem().CheckLecturersEmail(txtUsernameLecturer.Text); bool checkUserNameBool = Convert.ToBoolean(checkUserName); if (checkUserNameBool == true) { lblUserNameAvailableLecturer.Text = "User name telah digunakan, silakan memasukkan user name yang lain"; lblUserNameAvailableLecturer.Visible = true; } else { if (!Regex.IsMatch(txtUsernameLecturer.Text.Trim(), @"^([\w-\.]+)$")) { lblUserNameAvailableLecturer.Text = "User name tidak boleh menggunakan tanda petik(',\") dan spasi"; lblUserNameAvailableLecturer.Visible = true; } else { MailData lecturerEmail = new MailData(); //UserData lecturerData = new UserSystem(). lecturerEmail.KdDosen = new UserSystem().GetKdDosenForLecturer(userID); //lecturerEmail.User = ((AccountData)Session[SessionNameFactory.AccountData]).UserName.ToString(); //lecturerEmail.Us = UserID; lecturerEmail.UserName = txtUsernameLecturer.Text; lecturerEmail.Password = txtPasswordLecturer.Text; lecturerEmail.HashedPassword = ParseLecturerPassword(txtPasswordLecturer.Text); lecturerEmail.SecurityQuestion = txtQuestionLecturer.Text; lecturerEmail.SecurityAnswer = txtAnswerLecturer.Text; lecturerEmail.SecondEmail = txtAlternateEmailLecturer.Text; lecturerEmail.NmNonGelar = new UserSystem().GetNamaNonGelar(userID); createMailResult = new MailSystem().CreateLecturerEmail(lecturerEmail); if (createMailResult == 0) { Session.Remove("NoEmail"); Response.Redirect("CreateEmail.aspx"); //pnlDataLecturer.Visible = false; //pnlConfirmationLecturer.Visible = true; //ltCreatedEmailLecturer.Text = txtUsernameLecturer.Text; //ltDateLecturer.Text = DateTime.Now.AddDays(1).ToLongDateString(); } } } } else { lblUserNameAvailableLecturer.Text = "Masukan user name email anda"; lblUserNameAvailableLecturer.Visible = true;

L48

} } } protected void btnResetStudent_Click(object sender, EventArgs e) { txtUsernameStudent.Text = ""; txtPasswordStudent.Text = ""; txtPasswordConfirmStudent.Text = ""; lblUserNameAvailableStudent.Visible = false; } protected void btnResetLecturer_Click(object sender, EventArgs e) { txtUsernameLecturer.Text = ""; txtPasswordLecturer.Text = ""; txtPasswordConfirmLecturer.Text = ""; txtQuestionLecturer.Text = ""; txtAnswerLecturer.Text = ""; txtAlternateEmailLecturer.Text = ""; lblUserNameAvailableLecturer.Visible = false; } protected void lbGoToHomeLecturer_Click(object sender, EventArgs e) { Response.Redirect("Home.aspx"); } protected void lbGoToHomeStudent_Click(object sender, EventArgs e) { Response.Redirect("Home.aspx"); } } }

• ForgotPassword.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Security; using BinusmayaV3.Business.ApplicationFacade; using BinusmayaV3.Business.Entities; using System.Net.Mail; using BinusmayaV3.CrossCutting.OperationalManagement; using System.Text.RegularExpressions; namespace BinusmayaV3 { public partial class ForgotPassword : System.Web.UI.Page { private UserSystem userSystem = new UserSystem(); protected void Page_Load(object sender, EventArgs e) { labelErrorMessage.Text = ""; if (!IsPostBack) { List<string> tanggal = new List<string>(); for (int a = 1; a <= 31; a++) {

L49

tanggal.Add(a.ToString()); } textBoxBirthDate.DataSource = tanggal; textBoxBirthDate.DataBind(); ucSecureImageControl.GenerateNewCode(); txtUserId.Attributes.Add("onkeyup", "loadHint();"); pnlLogin.Visible = true; lblMsg.Text = ""; if (Request.QueryString["s"] == null) { lblMsg.Text = "Please input your binusian ID to retrieve new password"; } else if (Request.QueryString["s"] == "1") { pnlLogin.Visible = false; lblMsg.Text = "Your new password has already been sent to your primary email"; } } } protected void btnSubmit_Click(object sender, EventArgs e) { string uid = txtUserId.Text; if (!ucSecureImageControl.IsInputValid) { ucSecureImageControl.GenerateNewCode(); return; } UserData userData = userSystem.GetUserDataByBinusianId(uid); if (userData == null) { ucSecureImageControl.GenerateNewCode(); lblError.Text = "Invalid User Id"; return; } txtUserId_TextChanged(sender, e); int date = Convert.ToInt32(textBoxBirthDate.Text); int month = Convert.ToInt32(dropDownListBirthMonth.SelectedValue); int year = Convert.ToInt32(textBoxBirthYear.Text); try { DateTime dateTime = new DateTime(year, month, date); } catch { ucSecureImageControl.GenerateNewCode(); labelErrorMessage.Text = "<b>Warning!</b> Birthday is invalid date"; btnSubmit.Enabled = true; return; } if (new UserSystem().CheckBirthdate(uid,date, month, year) == false) { ucSecureImageControl.GenerateNewCode(); labelErrorMessage.Text = "<b>Warning!</b> Wrong Username or Birthday"; return; } if (txtHint.Text.Trim() != "") {

L50

if (txtAnswer.Text.Trim() == "") { ucSecureImageControl.GenerateNewCode(); labelErrorMessage.Text = labelErrorMessage.Text = "<b>Warning!</b> Please fill in your answer for the hint given!!"; return; } } if (!new UserSystem().checkAnswer(uid, txtAnswer.Text.Trim())) { ucSecureImageControl.GenerateNewCode(); labelErrorMessage.Text = labelErrorMessage.Text = "<b>Warning!</b> Wrong answer given!!"; return; } string email = userData.Email; if (!Utility.ValidateEmail(email)) { ucSecureImageControl.GenerateNewCode(); lblError.Text = "Invalid Email Format"; return; } string newPwd = "binus" + Utility.To2Digit(NewPass); string newpass = FormsAuthentication.HashPasswordForStoringInConfigFile(newPwd, SystemConfiguration.Hash); bool boolSave; boolSave = new UserSystem().updateNewPasswordBinusian(uid, newpass); if (boolSave) { DateTime dt = DateTime.Now; MailAddress to = new MailAddress(email); MailAddress from = new MailAddress(SystemConfiguration.AdminEmail); MailMessage mailMessage = new MailMessage(from, to); //mailMessage.CC.Add(email); mailMessage.Subject = "[Binusmaya] Forgot Password Service Requested By : " + uid; string body = "Password baru Anda adalah : " + newPwd + "\r\n\r\n" + "Jangan lupa untuk mengganti password ini setelah berhasil melakukan login. \r\n" + "Atas perhatiannya kami ucapkan terima kasih.\r\n\r\n" + "Your new password is : " + newPwd + "\r\n\r\n" + "Don't forget to change it after you succeed to login. Thank you for your attention.\r\n\r\n" + "Regards,\r\n" + "New BinusMaya HelpDesk"; mailMessage.Body = body; try { SmtpClient smtpClient = new SmtpClient(SystemConfiguration.SMTPServer); smtpClient.Send(mailMessage); } catch (Exception ex) { ucSecureImageControl.GenerateNewCode(); lblError.Text = "Error sending email. Please try again."; return;

L51

} Response.Redirect(Request.ApplicationPath.TrimEnd('/') + "/ForgotPassword.aspx?s=1"); } } protected void txtUserId_TextChanged(object sender, EventArgs e) { txtUserId.Text = txtUserId.Text.Trim(); if (txtUserId.Text.Length == 5 && txtUserId.Text.Trim().ToLower().Substring(0,1) =="d" ) { txtHint.Text = new UserSystem().GetHint(txtUserId.Text.Trim()); } else if (txtUserId.Text.Length == 10) { txtHint.Text = new UserSystem().GetHint(txtUserId.Text.Trim()); } } protected void btnRefreshHint_Click(object sender, EventArgs e) { txtUserId_TextChanged(sender, e); } } }

• Home.aspx.cs

using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Collections.Generic; using BinusmayaV3.Business.ApplicationFacade; using BinusmayaV3.Business.Entities; using BinusmayaV3.CrossCutting.Security; using BinusmayaV3.CrossCutting.OperationalManagement; namespace BinusmayaV3 { public partial class Home : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Session["defPass"] = 0; Session["NoEmail"] = 0; lblError.Text = ""; if (Session["Userid"] != null) { int staff = 0; if (Session["UserId"] == null) { placeHolderEmailReg.Visible = false; placeHolderWelcome.Visible = false; } else {

L52

UserData data = new UserSystem().GetUserDataByBinusianId(Session["UserId"].ToString()); String LecturerStatus = ""; if (new UserSystem().CheckStatusGabungan(Session["UserId"].ToString(), 3)) { staff = 1; Session["NoEmail"] = 0; } if (staff == 0) { if (Session["IsLecturer"] != null) { LecturerStatus = Session["IsLecturer"].ToString().Trim(); } if (LecturerStatus == null || LecturerStatus == "") { MailData tempMailData = new MailSystem().GetStudentEmail(data.UserId); if (tempMailData.UserName == null || tempMailData.UserName == "") { Session["NoEmail"] = 1; Response.Redirect("CreateEmail.aspx"); } } else if (LecturerStatus == "1") { string kdDosen = new UserSystem().GetKdDosenForLecturer(data.UserId); string tempEmail = new MailSystem().GetLecturerEmail(kdDosen).UserName; if (tempEmail == null || tempEmail == "") { Session["NoEmail"] = 1; Response.Redirect("CreateEmail.aspx"); } } } if (data.Email.Equals("") && staff == 0) { placeHolderEmailReg.Visible = true; pnlDisclaimer.Visible = true; pnlSuccess.Visible = false; if (Session["IsLecturer"] == null || Session["IsLecturer"].ToString().Trim() == "") { txtEmail1.Text = new MailSystem().GetStudentEmail(data.UserId).UserName + "@binusian.org"; } else if (Session["IsLecturer"].ToString().Trim() == "1") { txtEmail1.Text = new MailSystem().GetLecturerEmail(data.UserId).UserName + "@binus.ac.id"; } List<DisclaimerData> _listDisclaimer = new DisclaimerSystem().getDisclaimerData(); foreach (DisclaimerData _data in _listDisclaimer) { if (Convert.ToInt32(_data.LanguageId) == 1) { chkAgree.Text = " Saya setuju dengan pernyataan di atas";

L53

litIndonesiaHidden.Text = _data.LanguageId; lnkIndonesia.Text = _data.LanguageName + " v." + _data.VersionName; litIsi.Text = _data.Disclaimer; } else if (Convert.ToInt32(_data.LanguageId) == 2) { litEnglishHidden.Text = _data.LanguageId; lnkEnglish.Text = _data.LanguageName + " v." + _data.VersionName; } } } else { String user = Session["Userid"].ToString(); placeHolderWelcome.Visible = true; placeHolderEmailReg.Visible = false; List<string> _list = new UserSystem().checkisDefaultPassword(user); string pwd = _list[0].ToString(); string pwd2 = _list[1].ToString(); pwd2 = FormsAuthentication.HashPasswordForStoringInConfigFile(pwd2, SystemConfiguration.Hash); if (pwd.Trim() != pwd2.Trim()) { string hint = new UserSystem().GetHint(Session["UserId"].ToString()); if (hint == null) { hint = ""; } if (hint != "") { Session["hint"] = 0; pnlWelcome.Visible = true; } else { Session["hint"] = 1; // Response.Redirect("~/ChangePassword.aspx"); } Response.Redirect("AccessAppNoHeader.aspx?home=1&appid=" + HttpUtility.UrlEncode(Encryption64.Encrypt(SystemConfiguration.AppIdHome, SystemConfiguration.EncryptionKey))); } else { Session["defPass"] = 1; Response.Redirect("~/ChangePassword.aspx"); } } } } else { Response.Redirect("~/default.aspx"); } } }

L54

protected void lnkEnglish_Click(object sender, EventArgs e) { chkAgree.Text = " I agree to the above agreement"; DisclaimerData _data = new DisclaimerSystem().getDisclaimerData(litEnglishHidden.Text); litIsi.Text = _data.Disclaimer; } protected void lnkIndonesia_Click(object sender, EventArgs e) { chkAgree.Text = " Saya setuju dengan pernyataan di atas"; DisclaimerData _data = new DisclaimerSystem().getDisclaimerData(litIndonesiaHidden.Text); litIsi.Text = _data.Disclaimer; } protected void btnSubmit_Click(object sender, EventArgs e) { lblError.Text = ""; string email = txtEmail1.Text.Trim(); string domain = ""; if (!Utility.ValidateEmail(email)) { lblError.Text = "Invalid E-mail Format"; return; } if (!new UserSystem().CheckEmailAvailability(Session["UserId"].ToString(), email)) { lblError.Text = "This Email Address Has Been Taken"; return; } if (txtEmail1.Text.Trim() != "") { string[] split = email.Split(new Char[] { '@' }); int a = split.Length; split = split[1].Split(new Char[] { '.' }); domain = split[0]; } string email2 = ""; string domain2 = ""; email2 = txtEmail2.Text.Trim(); if (email2 != "") { if (!Utility.ValidateEmail(email2)) { lblError2.Text = "Invalid E-mail Format"; return; } //if (!new UserSystem().CheckEmailAvailability2(Session["UserId"].ToString(), email2)) //{ // lblError2.Text = "This Email Address Has Been Taken"; // return; //} string[] split2 = email2.Split(new Char[] { '@' }); split2 = split2[1].Split(new Char[] { '.' });

L55

domain2 = split2[0]; } string email3 = ""; email3 = txtEmail3.Text.Trim(); string domain3 = ""; if (email3 != "") { if (!Utility.ValidateEmail(email3)) { lblError3.Text = "Invalid E-mail Format"; return; } //if (!new UserSystem().CheckEmailAvailability2(Session["UserId"].ToString(), email3)) //{ // lblError3.Text = "This Email Address Has Been Taken"; // return; //} string[] split3 = email3.Split(new Char[] { '@' }); split3 = split3[1].Split(new Char[] { '.' }); domain3 = split3[0]; } new UserSystem().UpdateUserEmail(Session["UserId"].ToString(), email, Session["UserId"].ToString(),domain); if (email2 != "" || email3 != "") { new UserSystem().InsertOptionalEmail(Session["UserId"].ToString(), email2, domain2, email3, domain3); } Response.Redirect("Home.aspx"); } protected void chkAgree_CheckedChanged(object sender, EventArgs e) { if (chkAgree.Checked == true) { btnSubmit.Visible = true; } else { btnSubmit.Visible = false; } } } }

• Notification.aspx.cs

using System; using System.Data; using System.Configuration; using System.Collections; using System.Web;

L56

using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Collections.Generic; using BinusmayaV3.Business.ApplicationFacade; using BinusmayaV3.Business.Entities; using BinusmayaV3.CrossCutting.Security; using BinusmayaV3.CrossCutting.OperationalManagement; using BinusmayaV3.UserControl; using BinusmayaV3.Business.Entities.Enum; namespace BinusmayaV3 { public partial class Notification : System.Web.UI.Page { private static List<NotificationData> _listSend0 = null; private static List<NotificationData> _listSend1 = null; private static List<NotificationData> _listSend7 = null; private static List<NotificationData> _listSend30 = null; protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } } protected void ShowData() { List<NotificationData> listdataNotification = new NotificationSystem().GetNotificationData(Convert.ToInt32(SystemConfiguration.TotalShowPage), CurrPage, (Session["UserId"].ToString())); int jumlah = listdataNotification.Count; if (listdataNotification.Count == 0) { ucPagingControl.Visible = false; litEmpty.Visible = true; } else { int now = 0; _listSend0 = new List<NotificationData>(); _listSend1 = new List<NotificationData>(); _listSend7 = new List<NotificationData>(); _listSend30 = new List<NotificationData>(); for (int i = 0; i < jumlah; i++)

L57

{ if (listdataNotification[i].SelisihHari == 0) { _listSend0.Add((NotificationData)listdataNotification[i]); } else if (listdataNotification[i].SelisihHari == 1) { _listSend1.Add((NotificationData)listdataNotification[i]); } else if (listdataNotification[i].SelisihHari > 1 && listdataNotification[i].SelisihHari <= 7) { _listSend7.Add((NotificationData)listdataNotification[i]); } else { _listSend30.Add((NotificationData)listdataNotification[i]); } } if (_listSend0.Count == 0 && _listSend1.Count == 0 && _listSend7.Count == 0 && _listSend30.Count == 0) { ucPagingControl.Visible = false; rpt_Date.Visible = false; } else { List<string> date = new List<string>(); date.Add("0"); date.Add("1"); date.Add("7"); date.Add("30"); rpt_Date.DataSource = date; rpt_Date.DataBind(); } } } #region Paging private void FillPaging() { int countPage = new NotificationSystem().getNotificationCount((Session["UserId"].ToString())); int sumPage = 1; if (countPage % Convert.ToInt32(SystemConfiguration.TotalShowPage) == 0) { sumPage = countPage / Convert.ToInt32(SystemConfiguration.TotalShowPage); } else { sumPage = countPage / Convert.ToInt32(SystemConfiguration.TotalShowPage) + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind();

L58

} #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SaveViewStates(); String emailStatus = ""; if (Session["NoEmail"] != null) { emailStatus = Session["NoEmail"].ToString().Trim(); } if (emailStatus == "1") { Response.Redirect("CreateEmail.aspx"); } String defPass = ""; if (Session["defPass"] != null) { defPass = Session["defPass"].ToString(); if (defPass == "0") { }

L59

else { Session["defPass"] = 1; Response.Redirect("~/ChangePassword.aspx"); } } if (Session["hint"] != null) { if (Session["hint"].ToString() == "1") { Session["hint"] = 1; // Response.Redirect("~/ChangePassword.aspx"); } } if (Session["UserId"] != null) { litEmpty.Visible = false; LinkButton lnkNotification = (LinkButton)Master.FindControl("lnkNotification"); string newNoti = new NotificationSystem().getNewNotification(Session["UserId"].ToString()); if (newNoti != "0") { lnkNotification.Text = " Notification (" + newNoti.Trim() + ") |"; } else { lnkNotification.Text = " Notification "; } int totalShowRecord = Convert.ToInt32(SystemConfiguration.TotalShowPage); ShowData(); ucPagingControl.CurrentPage = CurrPage; FillPaging(); bool success = new NotificationSystem().InsertUpdateTRAccessNotification((Session["UserId"].ToString())); } } else { ucPagingControl.DataBind(); } } protected void rpt_Date_ItemDataBound(object sender, RepeaterItemEventArgs e)

L60

{ if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { string date = (string)e.Item.DataItem; Literal litDate = (Literal)e.Item.FindControl("litDate"); Repeater rptNotification = (Repeater)e.Item.FindControl("rptNotification"); Panel pnlJudul = (Panel)e.Item.FindControl("pnlJudul"); if (date == "0") { if (_listSend0.Count != 0) { litDate.Text = "Today"; rptNotification.DataSource = _listSend0; rptNotification.DataBind(); } else { pnlJudul.Visible = false; } } if (date == "1") { if (_listSend1.Count != 0) { litDate.Text = "Yesterday"; rptNotification.DataSource = _listSend1; rptNotification.DataBind(); } else { pnlJudul.Visible = false; } } if (date == "7") { if (_listSend7.Count != 0) { litDate.Text = "Last 7 days"; rptNotification.DataSource = _listSend7; rptNotification.DataBind(); } else { pnlJudul.Visible = false; } } if (date == "30") { if (_listSend30.Count != 0) { litDate.Text = "Last 30 days"; rptNotification.DataSource = _listSend30; rptNotification.DataBind(); } else { pnlJudul.Visible = false; } } } } protected void rptNotification_ItemDataBound(object sender, RepeaterItemEventArgs e) {

L61

if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { NotificationData dataNotification = (NotificationData)e.Item.DataItem; Literal litMessage = (Literal)e.Item.FindControl("litMessage"); Literal lnkApplication = (Literal)e.Item.FindControl("lnkApplication"); LinkButton lnkBlock = (LinkButton)e.Item.FindControl("lnkBlock"); Literal litNew = (Literal)e.Item.FindControl("litNew"); litMessage.Text = dataNotification.Message; ApplicationData data = new ApplicationSystem().GetApplicationDataByMSAppId(Session["UserId"].ToString(), dataNotification.MsApplicationId); if (data == null) { return; } if (data.HasHeader == 0) { lnkApplication.Text += "<a href=\"" + Request.ApplicationPath.TrimEnd('/') + "/AccessAppNoHeader.aspx?AppId=" + Encryption64.Encrypt(data.MSApplicationID, SystemConfiguration.EncryptionKey) + "\">" + data.ApplicationName + "</a>"; // string a = Request.ApplicationPath.TrimEnd('/') + "/AccessAppNoHeader.aspx?lnk=" + Encryption64.Encrypt("http://10.21.1.132/event/DetailEvent.aspx?id=1", SystemConfiguration.EncryptionKey)>" + data.ApplicationName + "</a>"; // litAppList.Text += "<li><a href=\"" + Request.ApplicationPath.TrimEnd('/') + "/AccessAppNoHeader.aspx?lnk=" + Encryption64.Encrypt("http://10.21.1.132/event/DetailEvent.aspx?id=1", SystemConfiguration.EncryptionKey) +>" + data.ApplicationName + "</a></li>"; } else { lnkApplication.Text += "<a href=\"" + Request.ApplicationPath.TrimEnd('/') + "/AccessApp.aspx?AppId=" + Encryption64.Encrypt(data.MSApplicationID, SystemConfiguration.EncryptionKey) + "\">" + data.ApplicationName + "</a>"; } if (dataNotification.NewMessage == 1) { litNew.Visible = true; } else { litNew.Visible = false; } lnkBlock.CommandName = "Block"; lnkBlock.CommandArgument = data.MSApplicationID; lnkBlock.Attributes.Add("onclick", "return confirm('Are you sure want to block all of notifications from this application?');"); } } protected void rptNotification_ItemCommand(object source, RepeaterCommandEventArgs e)

L62

{ if (e.CommandName == "Block") { bool success = new NotificationSystem().InsertUpdateStatusDenyNotification(Session["UserId"].ToString(), e.CommandArgument.ToString(), "A", Session["UserId"].ToString()); if (success) { Response.Redirect("~/Notification.aspx"); } } } } }

• SettingNotification.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BinusmayaV3.Business.ApplicationFacade; using BinusmayaV3.Business.Entities; using BinusmayaV3.CrossCutting.OperationalManagement; using BinusmayaV3.CrossCutting.Security; namespace BinusmayaV3 { public partial class SettingNotification : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { List<ApplicationData> listApp = new ApplicationSystem().LoadMSApplicationByBinusianID(Session["UserId"].ToString()); cblApp.DataSource = listApp; cblApp.DataTextField = "ApplicationName"; cblApp.DataValueField = "MSApplicationID"; cblApp.DataBind(); for (int i = 0; i < cblApp.Items.Count; i++) { cblApp.Items[i].Selected = true; } List<ApplicationData> listDeny = new NotificationSystem().LoadDenyApplicationByBinusianId(Session["UserId"].ToString()); int deny = 0; if (listDeny != null) { for (int i = 0; i < cblApp.Items.Count; i++) { if (cblApp.Items[i].Value.Trim() == listDeny[deny].MSApplicationID.Trim()) { cblApp.Items[i].Selected = false; deny++; } if (listDeny.Count == deny) { break; } }

L63

} } } protected void btnSubmit_Click(object sender, EventArgs e) { bool success = false; for (int i = 0; i < cblApp.Items.Count; i++) { if (cblApp.Items[i].Selected == true) { success = new NotificationSystem().InsertUpdateStatusDenyNotification(Session["UserId"].ToString(), cblApp.Items[i].Value, "D", Session["UserId"].ToString()); if (success == false) { break; } } if (cblApp.Items[i].Selected == false) { success = new NotificationSystem().InsertUpdateStatusDenyNotification(Session["UserId"].ToString(), cblApp.Items[i].Value, "A", Session["UserId"].ToString()); if (success == false) { break; } } } if (success) { Response.Redirect("~/Notification.aspx"); } } } }

• PersonalInfo.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.AppFacade; using Business.Entities.Data; namespace BinusianProfile.Information { public partial class PersonalInfo : System.Web.UI.Page { private static string binusianId = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; } PersonalData basicInfo = new PersonalSystem().GetPersonalDataByBinusianId(binusianId);

L64

ltBirthName.Text = basicInfo.BirthName; ltNameTitle.Text = basicInfo.NameTitle; if (basicInfo.IdType == "-") { ltIDType.Text = basicInfo.IdType; ltIDNumber.Visible = false; } else { ltIDType.Text = basicInfo.IdType; if (basicInfo.IdNumber != "-") { ltIDNumber.Text = " - " + basicInfo.IdNumber; } else { ltIDNumber.Visible = false; } } ltIDName.Text = basicInfo.IdName; ltPoB.Text = basicInfo.PlaceOfBirth; ltDoB.Text = basicInfo.DateOfBirth.ToString("dd MMMM yyyy"); ltGender.Text = basicInfo.Gender; ltReligion.Text = basicInfo.Religion; ltNationality.Text = basicInfo.Nationality; ltMaritalStat.Text = basicInfo.MaritalStatus; } } protected void lbEditPersonalInfo_Click(object sender, EventArgs e) { Response.Redirect("EditBasicInfo.aspx"); } } }

• EditBasicInfo.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.AppFacade; using Business.Entities.Data; namespace BinusianProfile.Information { public partial class EditBasicInfo : SecurePage//System.Web.UI.Page { private static string binusianId = ""; private static string binusianRole = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; binusianRole = new BinusianSsytem().GetBinusianRole(binusianId); } PersonalData basicInfo = new PersonalSystem().GetPersonalDataByBinusianId(binusianId); ltBirthName.Text = basicInfo.BirthName;

L65

ltNameTitle.Text = basicInfo.NameTitle; ltIDName.Text = basicInfo.IdName; ddlIdType.DataSource = new PersonalSystem().GetIdTypeForDDL(); ddlIdType.DataValueField = "IdCardTypeId"; ddlIdType.DataTextField = "IdType"; ddlIdType.DataBind(); if (basicInfo.IdNumber != "-") { txtIDNumber.Text = basicInfo.IdNumber; } ltPoB.Text = basicInfo.PlaceOfBirth; ltDob.Text = basicInfo.DateOfBirth.ToString("dd MMMM yyyy"); ltGender.Text = basicInfo.Gender; ddlReligion.DataSource = new PersonalSystem().GetReligionForDDL(); ddlReligion.DataValueField = "ReligionId"; ddlReligion.DataTextField = "Religion"; ddlReligion.DataBind(); ddlReligion.SelectedValue = basicInfo.ReligionId; ddlNationality.Items.Add("Indonesian"); ddlNationality.Items.Add("Foreigner"); if (basicInfo.NationalityId == "1") { ddlNationality.SelectedValue = "Indonesian"; } else { ddlNationality.SelectedValue = "Foreigner"; } ddlMaritalStatus.DataSource = new PersonalSystem().GetMaritalForDDL(); ddlMaritalStatus.DataValueField = "MaritalId"; ddlMaritalStatus.DataTextField = "MaritalStatus"; ddlMaritalStatus.DataBind(); ddlMaritalStatus.SelectedValue = basicInfo.MaritalId; if (binusianRole == "01" || binusianRole == "02") { ddlIdType.Enabled = false; txtIDNumber.Enabled = false; flUploadID.Enabled = false; } else if (binusianRole == "03" || binusianRole == "11") { ddlIdType.Enabled = true; txtIDNumber.Enabled = true; flUploadID.Enabled = true; } } } protected void lbBackToPersonalInfo_Click(object sender, EventArgs e) { Response.Redirect("PersonalInfo.aspx"); } protected void btnSubmitBasicInfo_Click(object sender, EventArgs e) { if (txtIDNumber.Enabled == true && txtIDNumber.Text == "") { lblWarn.Visible = true; lblWarn.Text = "Please input your ID Card Number"; return; } PersonalData basicInfo = new PersonalData();

L66

if (txtIDNumber.Enabled == true) { basicInfo.IdNumber = txtIDNumber.Text; } if (ddlIdType.Enabled == true) { basicInfo.IdType = ddlIdType.SelectedValue; } basicInfo.ReligionId = ddlReligion.SelectedValue; basicInfo.Nationality = ddlNationality.SelectedValue; if (basicInfo.Nationality == "Indonesian") { basicInfo.NationalityId = "1"; } else { basicInfo.NationalityId = "0"; } basicInfo.MaritalId = ddlMaritalStatus.SelectedValue; string userIn = binusianId; if(new PersonalSystem().InsertUpdatePersonalData(binusianId, basicInfo, userIn)) { lblWarn.Visible = true; lblWarn.Text = "Your new basic information have been succesfully requested. Please wait for the approval. Thank you"; } else { lblWarn.Visible = true; lblWarn.Text = "There are some error occured during the request. Please try again."; } } } }

• ContactInfo.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.AppFacade; using Business.Entities.Data; using CrossCutting.Security; using CrossCutting.OptMgmt; namespace BinusianProfile.Information { public partial class ContactInfo :SecurePage// System.Web.UI.Page { private static string binusianId = ""; private static int noResidence,noEmail,noWebsite; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { noResidence = 0; noEmail = 0; noWebsite = 0; if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId;

L67

} #region Residence Info List<ResidenceData> residenceList = new ResidenceSystem().GetContactResidenceListofBinusian(binusianId,0); if (residenceList.Count == 0) { rptResidence.Visible = false; lblNoResidence.Text = "We don't have any information about your residence"; lblNoResidence.Visible = true; } else { rptResidence.Visible = true; rptResidence.DataSource = residenceList; rptResidence.DataBind(); } #endregion #region Phone Info List<ContactData> phoneList = new ContactSystem().GetAllPhoneInfo(binusianId); if (phoneList.Count == 0) { rptPhone.Visible = false; lblNotePhone.Text = "We don't have any information about your phone"; lblNotePhone.Visible = true; } else { rptPhone.Visible = true; rptPhone.DataSource = phoneList; rptPhone.DataBind(); } #endregion #region Email Info List<EmailData> emailList = new EmailSystem().GetEmailListFromBinusianId(binusianId, ""); if (emailList.Count == 0) { rptEmail.Visible = false; lblNoEmail.Text = "We don't have any information about your email"; lblNoEmail.Visible = true; } else { rptEmail.Visible = true; rptEmail.DataSource = emailList; rptEmail.DataBind(); } #endregion #region Social Network Info List<ContactData> socNetList = new ContactSystem().GetAllSocialNetworkInfo(binusianId); if (socNetList.Count == 0) { rptSocialNetwork.Visible = false;

L68

lblNoteSocialNetwork.Visible = true; lblNoteSocialNetwork.Text = "We don't have any information about your social network account"; } else { rptSocialNetwork.Visible = true; rptSocialNetwork.DataSource = socNetList; rptSocialNetwork.DataBind(); } #endregion #region Website List<WebsiteData> websiteList = new WebsiteSystem().GetWebsiteListFromBinusianId(binusianId, 0); if (websiteList.Count == 0) { rptWebsite.Visible = false; lblNoWebsiteData.Text = "We don't have any information about your website"; lblNoWebsiteData.Visible = true; } else { rptWebsite.Visible = true; rptWebsite.DataSource = websiteList; rptWebsite.DataBind(); } #endregion } } #region Add Button Click protected void lbAddNewResidence_Click(object sender, EventArgs e) { Response.Redirect("EditResidenceInfo.aspx"); } protected void lbAddNewPhone_Click(object sender, EventArgs e) { Response.Redirect("EditPhoneInfo.aspx"); } protected void lbAddNewFax_Click(object sender, EventArgs e) { Response.Redirect("EditFaxInfo.aspx"); } protected void lbAddNewEmail_Click(object sender, EventArgs e) { Response.Redirect("EditEmailInfo.aspx"); } protected void lbAddNewWebsite_Click(object sender, EventArgs e) { Response.Redirect("EditWebsiteInfo.aspx"); } protected void lbAddNewSocialNetwork_Click(object sender, EventArgs e) { Response.Redirect("EditSocialNetworkInfo.aspx"); } #endregion #region repeater Phone protected void rptPhone_itemDataBound(object sender, RepeaterItemEventArgs e)

L69

{ if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { ContactData phoneData = (ContactData)e.Item.DataItem; Literal ltPhoneCount = (Literal)e.Item.FindControl("ltPhoneCount"); Literal ltPhoneNumber = (Literal)e.Item.FindControl("ltPhoneNumber"); Literal ltPhoneExt = (Literal)e.Item.FindControl("ltPhoneExt"); Literal ltPhoneType = (Literal)e.Item.FindControl("ltPhoneType"); HiddenField hdnPhoneId = (HiddenField)e.Item.FindControl("hdnPhoneId"); LinkButton lbEditPhone = (LinkButton)e.Item.FindControl("lbEditPhone"); LinkButton lbRemovePhone = (LinkButton)e.Item.FindControl("lbRemovePhone"); Label lblSeparatorPhone = (Label)e.Item.FindControl("lblSeparatorPhone"); hdnPhoneId.Value = phoneData.TeleponId; ltPhoneCount.Text = (e.Item.ItemIndex + 1).ToString(); if (phoneData.Utama != 1) { ltPhoneNumber.Text = phoneData.NomorTelp; } else if (phoneData.Utama == 1) { ltPhoneNumber.Text = "<strong>" + phoneData.NomorTelp + " [Primary]</strong>"; lbRemovePhone.Visible = false; lblSeparatorPhone.Visible = false; //if (phoneData.JenisTelepon == "Binusian XL") //{ // lbEditPhone.Visible = false; //} } if (phoneData.IsFixed == 1) { lblSeparatorPhone.Visible = false; lbRemovePhone.Visible = false; //lbEditEmail.Visible = false; } if (phoneData.Ekstensi == null || phoneData.Ekstensi == "") { ltPhoneExt.Text = "-"; } else { ltPhoneExt.Text = phoneData.Ekstensi; } ltPhoneType.Text = phoneData.JenisTelepon; lbRemovePhone.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this record of data?')"); lbEditPhone.CommandName = "EditPhone"; lbRemovePhone.CommandName = "RemovePhone"; } } protected void rptPhone_itemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName.ToString().Trim() == "EditPhone") { HiddenField hdnPhoneId = (HiddenField)e.Item.FindControl("hdnPhoneId"); Response.Redirect("EditPhoneInfo.aspx?e=1&id=" + HttpUtility.UrlEncode(Encryption64.Encrypt(hdnPhoneId.Value, SystemConfiguration.EncryptionKey))); } else if (e.CommandName.ToString().Trim() == "RemovePhone") { HiddenField hdnPhoneId = (HiddenField)e.Item.FindControl("hdnPhoneId"); string userIn = binusianId; if (new ContactSystem().DeletePhoneDetail(binusianId, hdnPhoneId.Value, userIn))

L70

{ Response.Redirect("ContactInfo.aspx"); } } } #endregion #region repeater Residence protected void rptResidence_itemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { ResidenceData _residenceData = (ResidenceData)e.Item.DataItem; Literal litResidenceNumber = (Literal)e.Item.FindControl("litResidenceNumber"); LinkButton lbEditResidence = (LinkButton)e.Item.FindControl("lbEditResidence"); LinkButton lbRemoveResidence = (LinkButton)e.Item.FindControl("lbRemoveResidence"); Literal ltAddress = (Literal)e.Item.FindControl("ltAddress"); Literal ltCountry = (Literal)e.Item.FindControl("ltCountry"); Literal ltProvince = (Literal)e.Item.FindControl("ltProvince"); Literal ltDistrict = (Literal)e.Item.FindControl("ltDistrict"); Literal ltSubDistrict = (Literal)e.Item.FindControl("ltSubDistrict"); Literal ltPostCode = (Literal)e.Item.FindControl("ltPostCode"); Literal ltStatusResidence = (Literal)e.Item.FindControl("ltStatusResidence"); noResidence++; litResidenceNumber.Text += noResidence.ToString(); if (_residenceData.Utama != 0) { litResidenceNumber.Text += " <b>[Primary]</b>"; lbRemoveResidence.Visible = false; } ltAddress.Text = _residenceData.Address; ltCountry.Text = _residenceData.NamaNegaraIng; if (ltCountry.Text.ToLower().Trim() == "indonesia") { ltProvince.Text = _residenceData.NamaPropinsi; ltDistrict.Text = _residenceData.NamaDistrict; } else { ltProvince.Text = _residenceData.PropinsiLuar; ltDistrict.Text = _residenceData.DistrictLuar; } ltSubDistrict.Text = _residenceData.SubDistrict; ltPostCode.Text = _residenceData.PostalCode; ltStatusResidence.Text = _residenceData.StatusResidence; lbEditResidence.CommandName = "EditResidence"; lbEditResidence.CommandArgument = _residenceData.KdAlamat.ToString(); lbRemoveResidence.CommandName = "RemoveResidence"; lbRemoveResidence.CommandArgument = _residenceData.KdAlamat.ToString(); lbRemoveResidence.Attributes.Add("onclick", "return confirm('Are you sure want to delete this record of residence data?');"); } } protected void rptResidence_itemCommand(object source, RepeaterCommandEventArgs e)

L71

{ if (e.CommandName == "EditResidence") { Response.Redirect("~/Information/EditResidenceInfo.aspx?edit=1&id="+HttpUtility.HtmlEncode(Rijndael.Encrypt(e.CommandArgument.ToString()))); } if (e.CommandName == "RemoveResidence") { bool delete = new ResidenceSystem().DeleteResidence(binusianId,Convert.ToInt32(e.CommandArgument)); if (delete) { Response.Redirect("~/Information/ContactInfo.aspx"); } } } #endregion #region repeater Email protected void rptEmail_itemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { EmailData _emailData = (EmailData)e.Item.DataItem; Literal ltEmailCount = (Literal)e.Item.FindControl("ltEmailCount"); Literal ltEmailAddress = (Literal)e.Item.FindControl("ltEmailAddress"); LinkButton lbEditEmail = (LinkButton)e.Item.FindControl("lbEditEmail"); LinkButton lbRemoveEmail = (LinkButton)e.Item.FindControl("lbRemoveEmail"); Label lblSeparatorEmail = (Label)e.Item.FindControl("lblSeparatorEmail"); noEmail++; ltEmailCount.Text = noEmail.ToString(); ltEmailAddress.Text = _emailData.AlamatEmail.ToString().Trim(); if (_emailData.Utama == 1) { ltEmailAddress.Text = "<b>" + _emailData.AlamatEmail + " [Primary] </b>"; lbRemoveEmail.Visible = false; lblSeparatorEmail.Visible = false; } //string email = _emailData.AlamatEmail.Trim(); //string[] split = email.Split(new Char[] { '@' }); //split = split[1].Split(new Char[] { '.' }); //string domain = split[0]; //if (domain.Trim().ToLower() == "binus") //{ // lblSeparatorEmail.Visible = false; // lbRemoveEmail.Visible = false; // lbEditEmail.Visible = false; //} if (_emailData.IsFixed == 1) { lblSeparatorEmail.Visible = false; lbRemoveEmail.Visible = false; // lbEditEmail.Visible = false; } lbEditEmail.CommandName = "EditEmail"; lbEditEmail.CommandArgument = _emailData.AlamatEmail.ToString().Trim(); lbRemoveEmail.CommandName = "RemoveEmail"; lbRemoveEmail.CommandArgument = _emailData.AlamatEmail.ToString().Trim();

L72

lbRemoveEmail.Attributes.Add("onclick", "return confirm('Are you sure want to delete this record of email data?');"); } } protected void rptEmail_itemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "EditEmail") { Response.Redirect("~/Information/EditEmailInfo.aspx?edit=1&id=" + HttpUtility.HtmlEncode(Rijndael.Encrypt(e.CommandArgument.ToString()))); } if (e.CommandName == "RemoveEmail") { bool delete = new EmailSystem().DeleteEmail(binusianId, e.CommandArgument.ToString().Trim()); if (delete) { Response.Redirect("~/Information/ContactInfo.aspx"); } } } #endregion #region repeater Website protected void rptWebsite_itemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { WebsiteData _websiteData = (WebsiteData)e.Item.DataItem; Literal ltWebsiteCount = (Literal)e.Item.FindControl("ltWebsiteCount"); Literal ltWebsiteURL = (Literal)e.Item.FindControl("ltWebsiteURL"); LinkButton lbEditWebsite = (LinkButton)e.Item.FindControl("lbEditWebsite"); LinkButton lbRemoveWebsite = (LinkButton)e.Item.FindControl("lbRemoveWebsite"); noWebsite++; ltWebsiteCount.Text = noWebsite.ToString(); ltWebsiteURL.Text = _websiteData.URL.ToString().Trim(); lbEditWebsite.CommandName = "EditWebsite"; lbEditWebsite.CommandArgument = _websiteData.KdWebsite.ToString().Trim(); lbRemoveWebsite.CommandName = "RemoveWebsite"; lbRemoveWebsite.CommandArgument = _websiteData.KdWebsite.ToString().Trim(); lbRemoveWebsite.Attributes.Add("onclick", "return confirm('Are you sure want to delete this record of email data?');"); } } protected void rptWebsite_itemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "EditWebsite") { Response.Redirect("~/Information/EditWebsiteInfo.aspx?edit=1&id=" + HttpUtility.HtmlEncode(Rijndael.Encrypt(e.CommandArgument.ToString()))); } if (e.CommandName == "RemoveWebsite") {

L73

bool delete = new WebsiteSystem().DeleteWebsite(binusianId, Convert.ToInt32(e.CommandArgument)); if (delete) { Response.Redirect("~/Information/ContactInfo.aspx"); } } } #endregion protected void rptSocialNetwork_itemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { ContactData socialNetworkData = (ContactData)e.Item.DataItem; Literal ltSocialNetworkCount = (Literal)e.Item.FindControl("ltSocialNetworkCount"); Literal ltSocialNetworkType = (Literal)e.Item.FindControl("ltSocialNetworkType"); Literal ltSocialNetworkAccount = (Literal)e.Item.FindControl("ltSocialNetworkAcc"); HiddenField hdnSocialNetworkId = (HiddenField)e.Item.FindControl("hdnSocialNetworkId"); LinkButton lbEditSocialNetwork = (LinkButton)e.Item.FindControl("lbEditSocialNetwork"); LinkButton lbRemoveSocialNetwork = (LinkButton)e.Item.FindControl("lbRemoveSocialNetwork"); hdnSocialNetworkId.Value = socialNetworkData.SocialNetworkId; ltSocialNetworkCount.Text = (e.Item.ItemIndex + 1).ToString(); ltSocialNetworkType.Text = socialNetworkData.SocialNetworkType; ltSocialNetworkAccount.Text = socialNetworkData.SocialNetworkAccount; lbRemoveSocialNetwork.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this record of data?')"); lbEditSocialNetwork.CommandName = "EditSocialNetwork"; lbRemoveSocialNetwork.CommandName = "RemoveSocialNetwork"; } } protected void rptSocialNetwork_itemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName.ToString().Trim() == "EditSocialNetwork") { HiddenField hdnSocialNetworkId = (HiddenField)e.Item.FindControl("hdnSocialNetworkId"); Response.Redirect("EditSocialNetworkInfo.aspx?e=1&id=" + HttpUtility.UrlEncode(Encryption64.Encrypt(hdnSocialNetworkId.Value, SystemConfiguration.EncryptionKey))); } else if (e.CommandName.ToString().Trim() == "RemoveSocialNetwork") { HiddenField hdnSocialNetworkId = (HiddenField)e.Item.FindControl("hdnSocialNetworkId"); string userIn = binusianId; if (new ContactSystem().DeleteSocialNetworkInfo(binusianId, hdnSocialNetworkId.Value, userIn)) { Response.Redirect("ContactInfo.aspx"); } } } } }

L74

• EditResidenceInfo.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using CrossCutting.OptMgmt; using CrossCutting.Security; namespace BinusianProfile.Information { public partial class EditResidenceInfo : SecurePage// System.Web.UI.Page { private static string binusianid; protected int isEdit { get { return Convert.ToInt32(ViewState["isEdit"]); } set { ViewState["isEdit"] = value; } } protected int ID { get { return Convert.ToInt32(ViewState["id"]); } set { ViewState["id"] = value; } } private void SaveViewStates() { if (Request.QueryString["id"] != null) { string temp = Request.QueryString["id"].ToString().Trim(); temp = temp.Replace(" ", "+"); ID = Convert.ToInt32(Rijndael.Decrypt(temp)); } if (Request.QueryString["edit"] != null) { isEdit = Convert.ToInt32(Request.QueryString["edit"]); } } protected static int success; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { binusianid = ((BinusianData) Session["UserData"]).BinusianId.ToString(); SaveViewStates();

L75

txtProvince.Visible = false; ddlProvince.Visible = true; litError.Text = ""; ddlCountry.DataSource = new ResidenceSystem().GetContactCountryForDDL(); ddlCountry.DataTextField = "NamaNegaraIng"; ddlCountry.DataValueField = "KodeNegara"; ddlCountry.DataBind(); ddlProvince.Items.Add(new ListItem(" - Choose Province - ","-1")); ddlDistrict.Items.Add(new ListItem(" - Choose District - ", "-1")); txtDistrict.Visible = false; ddlStatusResidence.DataSource = new ResidenceSystem().GetContactStatusAlamatForDDL(); ddlStatusResidence.DataTextField = "StatusResidence"; ddlStatusResidence.DataValueField = "KdStatusResidence"; ddlStatusResidence.DataBind(); ltTitleResidence.Text = "Add New Residence Information"; if (isEdit == 1) { ltTitleResidence.Text = "Edit Residence Information"; ResidenceData _dataEdit = (new ResidenceSystem().GetContactResidenceListofBinusian(binusianid, ID))[0]; if (_dataEdit.NamaNegaraIng.Trim().ToLower() != "indonesia") { ddlProvince.Visible = false; ddlDistrict.Visible = false; txtProvince.Visible = true; txtDistrict.Visible = true; txtProvince.Text = _dataEdit.PropinsiLuar; txtDistrict.Text = _dataEdit.DistrictLuar; } else { ddlDistrict.Visible = true; txtDistrict.Visible = false; ddlProvince.Items.Clear(); ddlProvince.DataSource = new ResidenceSystem().GetContactProvinceForDDL(); ddlProvince.DataTextField = "NamaPropinsi"; ddlProvince.DataValueField = "KodePropinsi"; ddlProvince.DataBind(); ddlProvince.Items.RemoveAt(0); ddlProvince.SelectedValue = _dataEdit.KodePropinsi.ToString().Trim(); ddlDistrict.Items.Clear(); ddlDistrict.DataSource = new ResidenceSystem().GetContactDistrictForDDL(Convert.ToInt32(ddlProvince.SelectedItem.Value)); ddlDistrict.DataTextField = "NamaDistrict"; ddlDistrict.DataValueField = "KdDistrict"; ddlDistrict.DataBind(); ddlDistrict.Items.RemoveAt(0); ddlDistrict.SelectedValue = _dataEdit.KdDistrict.ToString().Trim(); } if (_dataEdit.Utama == 0) {

L76

rdPrimaryResidence2.Checked = true; } else { rdPrimaryResidence1.Checked = true; } txtAddress.Text = _dataEdit.Address.Trim(); ddlCountry.SelectedValue = _dataEdit.KodeNegara.ToString().Trim(); txtSubDistrict.Text = _dataEdit.SubDistrict.Trim(); txtPostalCode.Text = _dataEdit.PostalCode.Trim(); ddlStatusResidence.SelectedValue = _dataEdit.KdStatusResidence.ToString().Trim(); ddlCountry.Items.RemoveAt(0); ddlStatusResidence.Items.RemoveAt(0); if (_dataEdit.Utama != 0) { rdPrimaryResidence1.Enabled = false; rdPrimaryResidence2.Enabled = false; } } else { pnlInsertResidence.Visible = true; litError.Visible = false; litError.Text = ""; List<ResidenceData> residenceList = new ResidenceSystem().GetContactResidenceListofBinusian(binusianid, 0); if (residenceList.Count >= 3) { litError.Visible = true; pnlInsertResidence.Visible = false; litError.Text = "You Have Reached Maximum Residence Info Data"; } } } } protected void lbBackToContactInfo_Click(object sender, EventArgs e) { Response.Redirect("ContactInfo.aspx"); } protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e) { if(ddlCountry.SelectedItem.Value != "-1") { if (ddlCountry.Items[0].Value == "-1") { ddlCountry.Items.RemoveAt(0); } } if (ddlCountry.SelectedItem.Value == "1") { txtProvince.Visible = false; ddlProvince.Visible = true; ddlProvince.Items.Clear(); ddlProvince.DataSource = new ResidenceSystem().GetContactProvinceForDDL(); ddlProvince.DataTextField = "NamaPropinsi"; ddlProvince.DataValueField = "KodePropinsi";

L77

ddlProvince.DataBind(); txtDistrict.Visible = false; ddlDistrict.Visible = true; } else { txtDistrict.Visible = true; ddlDistrict.Visible = false; txtProvince.Visible = true; ddlProvince.Visible = false; } } protected void ddlProvince_SelectedIndexChanged(object sender, EventArgs e) { if (ddlProvince.SelectedItem.Value != "-1") { if (ddlProvince.Items[0].Value == "-1") { ddlProvince.Items.RemoveAt(0); } txtDistrict.Visible = false; ddlDistrict.Visible = true; ddlDistrict.Items.Clear(); ddlDistrict.DataSource = new ResidenceSystem().GetContactDistrictForDDL(Convert.ToInt32(ddlProvince.SelectedItem.Value)); ddlDistrict.DataTextField = "NamaDistrict"; ddlDistrict.DataValueField = "KdDistrict"; ddlDistrict.DataBind(); } } protected void ddlDistrict_SelectedIndexChanged(object sender, EventArgs e) { if (ddlDistrict.SelectedItem.Value != "-1") { if (ddlDistrict.Items[0].Value == "-1") { ddlDistrict.Items.RemoveAt(0); } } } protected void okButton_Click(object sender, EventArgs e) { if (success == 0) { successModalPopup.Hide(); } else if(success==1) { Response.Redirect("~/Information/ContactInfo.aspx"); } }

L78

protected void ddlStatusResidence_SelectedIndexChanged(object sender, EventArgs e) { if (ddlStatusResidence.SelectedItem.Value != "-1") { if (ddlStatusResidence.Items[0].Value == "-1") { ddlStatusResidence.Items.RemoveAt(0); } } } protected void btnSubmitResidence_Click(object sender, EventArgs e) { string binusianid = ((BinusianData) Session["UserData"]).BinusianId; int error = 0; #region error message litError.Visible = true; litError.Text = "<ul>"; if (rdPrimaryResidence1.Checked == false && rdPrimaryResidence2.Checked == false) { litError.Text += "<li>Primary Residence Must Be Choosen</li>"; error++; } if (txtAddress.Text.Trim() == "") { litError.Text += "<li>Address Must Be Filled</li>"; error++; } if (ddlCountry.SelectedItem.Value == "-1") { litError.Text += "<li>Country Must Be Choosen</li>"; error++; } if (ddlCountry.SelectedItem.Value == "1" && ddlProvince.SelectedItem.Value == "-1") { litError.Text += "<li>Province Must Be Choosen</li>"; error++; } if (ddlCountry.SelectedItem.Value != "1" && txtProvince.Text.Trim() =="") { litError.Text += "<li>Province Must Be Filled</li>"; error++; } if (ddlCountry.SelectedItem.Value == "1" && ddlDistrict.SelectedItem.Value == "-1") { litError.Text += "<li>District Must Be Choosen</li>"; error++; } if (ddlCountry.SelectedItem.Value != "1" && txtDistrict.Text.Trim() == "") { litError.Text += "<li>District Must Be Filled</li>"; error++; } if (txtSubDistrict.Text.Trim() == "") { litError.Text += "<li>Sub District Must Be Filled</li>"; error++; } if (txtPostalCode.Text.Trim() == "")

L79

{ litError.Text += "<li>Postal Code Must Be Filled</li>"; error++; } if (ddlStatusResidence.SelectedItem.Value == "-1") { litError.Text += "<li>Status Residence Must Be Choosen</li>"; error++; } litError.Text += "</ul>"; #endregion if (error == 0) { ResidenceData _residenceData = new ResidenceData(); if (Request.QueryString["id"] != null) { _residenceData.KdAlamat = ID; } else { _residenceData.KdAlamat = 0; } _residenceData.Address = txtAddress.Text.Trim(); _residenceData.KodeNegara = Convert.ToInt32(ddlCountry.SelectedItem.Value); if (ddlCountry.SelectedItem.Text == "INDONESIA") { _residenceData.KodePropinsi = Convert.ToInt32(ddlProvince.SelectedItem.Value); _residenceData.KdDistrict = Convert.ToInt32(ddlDistrict.SelectedItem.Value); } else { _residenceData.KodePropinsi = 50; _residenceData.KdDistrict = 50; } _residenceData.NamaPropinsi = txtProvince.Text.Trim(); _residenceData.DistrictLuar = txtDistrict.Text.Trim(); _residenceData.SubDistrict = txtSubDistrict.Text.Trim(); _residenceData.PostalCode = txtPostalCode.Text.Trim(); _residenceData.KdStatusResidence = Convert.ToInt32(ddlStatusResidence.SelectedItem.Value); if (rdPrimaryResidence1.Checked == true) { _residenceData.Utama = 1; } else { _residenceData.Utama = 0; } success = new ResidenceSystem().InsertUpdateContactResidence(binusianid, _residenceData, binusianid);

L80

if (success == 0) { ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/close.png'/>" + "<label class=\"textred\"> The record saved unsuccessfully.</label>"; successModalPopup.Show(); } else if(success ==1) { ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/ActionDBAdd.png'/>" + "<label class=\"textwhite\">The record saved successfully.</label>"; successModalPopup.Show(); } else if (success == 2) { litError.Text = "You Haven't Registered any Primary Address, Please Choose Primary Address"; } } } } }

• EditPhoneInfo.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.AppFacade; using Business.Entities.Data; using CrossCutting.OptMgmt; namespace BinusianProfile.Information { public partial class EditPhoneInfo : SecurePage//System.Web.UI.Page { public static string binusianId = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; } ltTitlePhone.Text = "Add New Phone Information"; ddlPhoneType.DataSource = new ContactSystem().GetPhoneTypeForDDL(); ddlPhoneType.DataValueField = "JenisTeleponId"; ddlPhoneType.DataTextField = "JenisTelepon"; ddlPhoneType.DataBind(); ddlPhoneType.Items.RemoveAt(0);

L81

if (Request.QueryString["e"] != null && Request.QueryString["id"] != null) { ltTitlePhone.Text = "Edit Phone Information"; string tempId = Request.QueryString["id"].ToString().Trim(); try { string teleponId = HttpUtility.UrlDecode(Encryption64.Decrypt(tempId, SystemConfiguration.EncryptionKey)).ToString().Trim(); ContactData phoneDetail = new ContactSystem().GetPhoneDetailInfo(binusianId, teleponId); ddlPhoneType.SelectedValue = phoneDetail.JenisTeleponId; if (phoneDetail.Utama == 1) { rdPrimaryPhone1.Checked = true; rdPrimaryPhone2.Checked = false; rdPrimaryPhone1.Enabled = false; rdPrimaryPhone2.Enabled = false; } else { rdPrimaryPhone1.Checked = false; rdPrimaryPhone2.Checked = true; } txtPhoneNumber.Text = phoneDetail.NomorTelp; if (phoneDetail.Ekstensi == null || phoneDetail.Ekstensi == "") { } else { txtPhoneExt.Text = phoneDetail.Ekstensi; } if (phoneDetail.IsFixed == 1) { ddlPhoneType.Enabled = false; txtPhoneNumber.Enabled = false; txtPhoneExt.Enabled = false; // Response.Redirect("~/Information/ContactInfo.aspx"); } } catch (Exception ex) { Response.Redirect("ContactInfo.aspx"); } } else if ((Request.QueryString["e"] != null && Request.QueryString["id"] == null) || (Request.QueryString["e"] == null && Request.QueryString["id"] != null)) { Response.Redirect("ContactInfo.aspx"); } else { int count = 0; List<ContactData> phoneList = new ContactSystem().GetAllPhoneInfo(binusianId); foreach (ContactData _data in phoneList) { if (_data.IsFixed != 1) { count++; } } if (count >= 5) {

L82

ddlPhoneType.Enabled = false; rdPrimaryPhone1.Enabled = false; rdPrimaryPhone2.Enabled = false; txtPhoneNumber.Enabled = false; txtPhoneExt.Enabled = false; btnSubmitPhone.Enabled = false; lblWarnPhone.Visible = true; lblWarnPhone.Text = "You have reached maximum phone information"; } } } } protected void lbBackToContactInfo_Click(object sender, EventArgs e) { Response.Redirect("ContactInfo.aspx"); } protected void btnSubmitPhone_Click(object sender, EventArgs e) { if (!rdPrimaryPhone1.Checked && !rdPrimaryPhone2.Checked) { lblWarnPhone.Visible = true; lblWarnPhone.Text = "Please choose whether the phone is primary or not"; return; } else if (txtPhoneNumber.Text == null || txtPhoneNumber.Text == "") { lblWarnPhone.Visible = true; lblWarnPhone.Text = "Please input your phone number"; return; } ContactData contactData = new ContactData(); if (Request.QueryString["e"] != null && Request.QueryString["id"] != null) { string tempId = Request.QueryString["id"].ToString().Trim(); contactData.TeleponId = HttpUtility.UrlDecode(Encryption64.Decrypt(tempId, SystemConfiguration.EncryptionKey)); } else if ((Request.QueryString["e"] != null && Request.QueryString["id"] == null) || (Request.QueryString["e"] == null && Request.QueryString["id"] != null)) { Response.Redirect("ContactInfo.aspx"); } else { contactData.TeleponId = "0"; } contactData.JenisTeleponId = ddlPhoneType.SelectedValue; if (rdPrimaryPhone1.Checked) { contactData.Utama = 1; } else if (rdPrimaryPhone2.Checked) { contactData.Utama = 0; } contactData.NomorTelp = txtPhoneNumber.Text; contactData.Ekstensi = txtPhoneExt.Text; string userIn = binusianId; if (new ContactSystem().InsertUpdatePhoneDetail(binusianId, contactData, userIn)) { Response.Redirect("ContactInfo.aspx");

L83

} else { lblWarnPhone.Visible = true; lblWarnPhone.Text = "Sorry some error have occured, please try again"; return; } } } }

• EditEmailInfo.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using CrossCutting.OptMgmt; using CrossCutting.Security; namespace BinusianProfile.Information { public partial class EditEmailInfo : SecurePage//System.Web.UI.Page { public static string binusianid; protected int isEdit { get { return Convert.ToInt32(ViewState["isEdit"]); } set { ViewState["isEdit"] = value; } } protected string ID { get { return Convert.ToString(ViewState["id"]); } set { ViewState["id"] = value; } } private void SaveViewStates() { if (Request.QueryString["id"] != null) { string tempId = Request.QueryString["id"].ToString().Trim(); tempId = tempId.Replace(" ", "+"); ID = Convert.ToString(Rijndael.Decrypt(tempId)); } if (Request.QueryString["edit"] != null) { isEdit = Convert.ToInt32(Request.QueryString["edit"]); }

L84

} protected static bool success; protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) { binusianid = ((BinusianData)Session["UserData"]).BinusianId.ToString(); SaveViewStates(); ltTitleEmail.Text = "Add New Email Information"; if (isEdit == 1) { ltTitleEmail.Text = "Edit Email Information"; EmailData _dataEdit = (new EmailSystem().GetEmailListFromBinusianId(binusianid, ID))[0]; if (_dataEdit.IsFixed == 1) { txtEmail.Enabled = false; // Response.Redirect("~/Information/ContactInfo.aspx"); } if (_dataEdit.Utama == 0) { rdPrimaryEmailNo.Checked = true; } else if (_dataEdit.Utama == 1) { rdPrimaryEmailYes.Checked = true; rdPrimaryEmailYes.Enabled = false; rdPrimaryEmailNo.Enabled = false; } txtEmail.Text = _dataEdit.AlamatEmail.ToString().Trim(); } else { int count = 0; pnlInsertEmail.Visible = true; litError.Visible = false; litError.Text = ""; List<EmailData> emailList = new EmailSystem().GetEmailListFromBinusianId(binusianid, ""); foreach (EmailData _data in emailList) { if (_data.IsFixed != 1) { count++; } } if (Convert.ToInt32(count) >= 3) { litError.Visible = true; pnlInsertEmail.Visible = false; litError.Text = "You Have Reached Maximum Email Info Data"; } } } } protected void okButton_Click(object sender, EventArgs e) { if (success == false) {

L85

successModalPopup.Hide(); } else if (success == true) { Response.Redirect("~/Information/ContactInfo.aspx"); } } protected void lbBackToContactInfo_Click(object sender, EventArgs e) { Response.Redirect("ContactInfo.aspx"); } protected void btnSubmitEmail_Click(object sender, EventArgs e) { int error = 0; litError.Visible = true; #region error message litError.Text = "<ul>"; if (rdPrimaryEmailNo.Checked == false && rdPrimaryEmailYes.Checked == false) { litError.Text += "<li>Primary Email Must Be Choosen</li>"; error++; } if (txtEmail.Text.Trim() == "") { litError.Text += "<li>Email Address Must Be Filled</li>"; error++; } litError.Text += "</ul>"; #endregion if (error == 0) { if(new EmailSystem().CheckIfEmailHasBeenUsed(binusianid,txtEmail.Text.Trim())) { litError.Text = "Email Already Used By Another Binusian, Please Choose Another Email"; } else { string email = txtEmail.Text.Trim(); string[] split = email.Split(new Char[] { '@' }); split = split[1].Split(new Char[] { '.' }); string domain = split[0]; int utama = 0; if (rdPrimaryEmailYes.Checked == true) { utama = 1; } success = new EmailSystem().InsertUpdateEmail(binusianid,ID,email,domain,utama); if (success == false) { ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/close.png'/>" + "<label class=\"textred\"> The record saved unsuccessfully.</label>"; successModalPopup.Show(); }

L86

else if (success == true) { ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/ActionDBAdd.png'/>" + "<label class=\"textwhite\">The record saved successfully.</label>"; successModalPopup.Show(); } } } } } }

• EditSocialNetworkInfo.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.AppFacade; using Business.Entities.Data; using CrossCutting.OptMgmt; namespace BinusianProfile.Information { public partial class EditSocialNetworkInfo : SecurePage//System.Web.UI.Page { private static string binusianId = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; } ltTitleSocialNetwork.Text = "Add New Social Network Information"; ddlSocialNetworkType.DataSource = new ContactSystem().GetSocialNetworkTypeForDDL(); ddlSocialNetworkType.DataTextField = "SocialNetworkType"; ddlSocialNetworkType.DataValueField = "SocialNetworkTypeId"; ddlSocialNetworkType.DataBind(); if (Request.QueryString["e"] != null && Request.QueryString["id"] != null) { ltTitleSocialNetwork.Text = "Edit Social Network Information"; string tempId = Request.QueryString["id"].ToString().Trim(); try { string socNetId = HttpUtility.UrlDecode(Encryption64.Decrypt(tempId, SystemConfiguration.EncryptionKey)).ToString().Trim(); ContactData socNetDetail = new ContactSystem().GetSocialNetworkDetail(binusianId, socNetId); ddlSocialNetworkType.SelectedValue = socNetDetail.SocialNetworkTypeId; txtSocialNetworkAccount.Text = socNetDetail.SocialNetworkAccount; }

L87

catch (Exception ex) { Response.Redirect("ContactInfo.aspx"); } } else if ((Request.QueryString["e"] != null && Request.QueryString["id"] == null) || (Request.QueryString["e"] == null && Request.QueryString["id"] != null)) { Response.Redirect("ContactInfo.aspx"); } else { List<ContactData> socNetList = new ContactSystem().GetAllSocialNetworkInfo(binusianId); if (socNetList.Count >= 5) { ddlSocialNetworkType.Enabled = false; txtSocialNetworkAccount.Enabled = false; btnSubmitSocialNetwork.Enabled = false; lblWarnSocialNetwork.Visible = true; lblWarnSocialNetwork.Text = "You have reached maximum social network account information"; } } } } protected void lbBackToContactInfo_Click(object sender, EventArgs e) { Response.Redirect("ContactInfo.aspx"); } protected void btnSubmitSocialNetwork_Click(object sender, EventArgs e) { if (txtSocialNetworkAccount.Text == null || txtSocialNetworkAccount.Text == "") { lblWarnSocialNetwork.Visible = true; lblWarnSocialNetwork.Text = "Please input your social network account"; return; } ContactData socialNetworkData = new ContactData(); if (Request.QueryString["e"] != null && Request.QueryString["id"] != null) { string tempId = Request.QueryString["id"].ToString().Trim(); socialNetworkData.SocialNetworkId = HttpUtility.UrlDecode(Encryption64.Decrypt(tempId, SystemConfiguration.EncryptionKey)); } else if ((Request.QueryString["e"] != null && Request.QueryString["id"] == null) || (Request.QueryString["e"] == null && Request.QueryString["id"] != null)) { Response.Redirect("ContactInfo.aspx"); } else { socialNetworkData.SocialNetworkId = "0"; } socialNetworkData.SocialNetworkTypeId = ddlSocialNetworkType.SelectedValue; if (ddlSocialNetworkType.SelectedValue != "3") { socialNetworkData.SocialNetworkAccount = txtSocialNetworkAccount.Text; } else { if (txtSocialNetworkAccount.Text.Length != 8)

L88

{ lblWarnSocialNetwork.Visible = true; lblWarnSocialNetwork.Text = "Your Blackberry pin is invalid, please try again"; return; } else { socialNetworkData.SocialNetworkAccount = txtSocialNetworkAccount.Text; } } string userIn = binusianId; if(new ContactSystem().InsertUpdateSocialNetworkInfo(binusianId, socialNetworkData, userIn)) { Response.Redirect("ContactInfo.aspx"); } else { lblWarnSocialNetwork.Visible = true; lblWarnSocialNetwork.Text = "Sorry some error have occured, please try again"; } } } }

• EditWebsiteInfo.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using CrossCutting.OptMgmt; using CrossCutting.Security; namespace BinusianProfile.Information { public partial class EditWebsiteInfo : SecurePage { public static string binusianid; protected int isEdit { get { return Convert.ToInt32(ViewState["isEdit"]); } set { ViewState["isEdit"] = value; } } protected int ID { get { return Convert.ToInt32(ViewState["id"]);

L89

} set { ViewState["id"] = value; } } private void SaveViewStates() { if (Request.QueryString["id"] != null) { string tempId = Request.QueryString["id"].ToString().Trim(); tempId = tempId.Replace(" ", "+"); ID = Convert.ToInt32(Rijndael.Decrypt(tempId)); } if (Request.QueryString["edit"] != null) { isEdit = Convert.ToInt32(Request.QueryString["edit"]); } } protected static bool success; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ltTitleWebsite.Text = "Add New Website Information"; binusianid = ((BinusianData)Session["UserData"]).BinusianId.ToString(); SaveViewStates(); if (isEdit == 1) { ltTitleWebsite.Text = "Edit Website Information"; WebsiteData _dataEdit = (new WebsiteSystem().GetWebsiteListFromBinusianId(binusianid, ID))[0]; txtWebsite.Text = _dataEdit.URL; } else { pnlInsertWebsite.Visible = true; litError.Visible = false; litError.Text = ""; List<WebsiteData> websiteList = new WebsiteSystem().GetWebsiteListFromBinusianId(binusianid, 0); if (websiteList.Count >= 5) { litError.Visible = true; pnlInsertWebsite.Visible = false; litError.Text = "You Have Reached Maximum Website Info Data"; } } } } protected void okButton_Click(object sender, EventArgs e) { if (success == false) { successModalPopup.Hide(); } else if (success == true) { Response.Redirect("~/Information/ContactInfo.aspx"); } } protected void lbBackToContactInfo_Click(object sender, EventArgs e) {

L90

Response.Redirect("ContactInfo.aspx"); } protected void btnSubmitWebsite_Click(object sender, EventArgs e) { WebsiteData _data = new WebsiteData(); if (txtWebsite.Text.StartsWith("http://")) { _data.URL = txtWebsite.Text.Trim(); } else { _data.URL = "http://" + txtWebsite.Text.Trim(); } if (isEdit == 1) { _data.KdWebsite = ID; } else { _data.KdWebsite = 0; } success = new WebsiteSystem().InsertUpdateEmail(binusianid, _data); if (success == false) { ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/close.png'/>" + "<label class=\"textred\"> The record saved unsuccessfully.</label>"; successModalPopup.Show(); } else if (success == true) { ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/ActionDBAdd.png'/>" + "<label class=\"textwhite\">The record saved successfully.</label>"; successModalPopup.Show(); } } } }

• NPWPInfo.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; namespace BinusianProfile.Information { public partial class NPWPInfo : System.Web.UI.Page { private static string binusianId = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; }

L91

NPWPData npwpData = new NPWPSystem().GetNpwpDetailByBinusianId(binusianId); if (npwpData.NPWPNumbers == null || npwpData.NPWPNumbers == null) { pnlNPWPInfo.Visible = false; pnlWarn.Visible = true; lblWarn.Visible = true; lblWarn.Text = "Sorry, we don't have any information about your Tax Identification Number"; lbEditNPWP.Text = "Add New"; } else { pnlNPWPInfo.Visible = true; pnlWarn.Visible = false; lblWarn.Visible = false; ltNPWPNumber.Text = npwpData.NPWPNumbers; ltNPWPName.Text = npwpData.NPWPName; ltNPWPAddress.Text = npwpData.NPWPAddress; ltNPWPOwner.Text = npwpData.NPWPOwner; ltNPWPRegisterDate.Text = npwpData.NPWPRegisterDate.ToString("d MMMM yyyy"); ltNPWPBranchOffice.Text = npwpData.NPWPBranchOffice; } } } protected void lbEditNPWP_Click(object sender, EventArgs e) { Response.Redirect("EditNPWPInfo.aspx"); } } }

• EditNPWPInfo.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.AppFacade; using Business.Entities.Data; namespace BinusianProfile.Information { public partial class EditNPWPInfo : System.Web.UI.Page { private static string binusianId = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; } NPWPData npwpData = new NPWPSystem().GetNpwpDetailByBinusianId(binusianId); if (npwpData.NPWPNumbers == null || npwpData.NPWPNumbers == "") { ltTitleNPWP.Text = "Add New NPWP Information"; } else

L92

{ ltTitleNPWP.Text = "Edit NPWP Information"; txtNPWPNumber.Text = npwpData.NPWPNumbers; txtxNPWPName.Text = npwpData.NPWPName; txtNPWPAddress.Text = npwpData.NPWPAddress; txtNPWPBranchOffice.Text = npwpData.NPWPBranchOffice; ucNPWPRegisterDate.setDate(npwpData.NPWPRegisterDate.ToString()); } } } protected void lbBackToNPWPInfo_Click(object sender, EventArgs e) { Response.Redirect("NPWPInfo.aspx"); } protected void btnSubmitNPWP_Click(object sender, EventArgs e) { if (txtNPWPNumber.Text == null || txtNPWPNumber.Text == "") { lblWarnNPWP.Visible = true; lblWarnNPWP.Text = "Please input the NPWP numbers"; return; } else if (txtxNPWPName.Text == null || txtxNPWPName.Text == "") { lblWarnNPWP.Visible = true; lblWarnNPWP.Text = "Please input the name on NPWP"; return; } else if (txtNPWPAddress.Text == null || txtNPWPAddress.Text == "") { lblWarnNPWP.Visible = true; lblWarnNPWP.Text = "Please input the address on NPWP"; return; } else if (!rdNPWPOwner1.Checked && !rdNPWPOwner2.Checked) { lblWarnNPWP.Visible = true; lblWarnNPWP.Text = "Please choose the owner of NPWP"; return; } else if (txtNPWPBranchOffice.Text == null || txtNPWPBranchOffice.Text == "") { lblWarnNPWP.Visible = true; lblWarnNPWP.Text = "Please input the branch office when registering your NPWP"; return; } else { try { Convert.ToDateTime(ucNPWPRegisterDate.getDate()); } catch (Exception ex) { lblWarnNPWP.Visible = true; lblWarnNPWP.Text = "Please input the date when registering your NPWP"; return; } } NPWPData npwpData = new NPWPData(); npwpData.NPWPNumbers = txtNPWPNumber.Text; npwpData.NPWPName = txtxNPWPName.Text; npwpData.NPWPAddress = txtNPWPAddress.Text; npwpData.NPWPRegisterDate = Convert.ToDateTime(ucNPWPRegisterDate.getDate()); if (rdNPWPOwner1.Checked) {

L93

npwpData.NPWPOwner = "1"; } else { npwpData.NPWPOwner = "2"; } npwpData.NPWPBranchOffice = txtNPWPBranchOffice.Text; if (new NPWPSystem().InsertUpdateNPWP(binusianId, npwpData, binusianId)) { Response.Redirect("NPWPInfo.aspx"); } else { lblWarnNPWP.Visible = true; lblWarnNPWP.Text = "Sorry, some error has occured. Please try again"; return; } } } }

• BankInfo.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.AppFacade; using Business.Entities.Data; using CrossCutting.Security; using CrossCutting.OptMgmt; namespace BinusianProfile.Information { public partial class BankInfo :SecurePage// System.Web.UI.Page { private static string binusianId = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; } if (new BinusianSsytem().CheckIfBinusianIdIsActiveStudent(binusianId)) { lbEditBankInfo.Visible = false; } else { lbEditBankInfo.Visible = true; } BankData _data = new BankSystem().getBankDetailByBinusianId(binusianId,""); if (_data.No_Rek != null) { lbEditBankInfo.Text = "Edit"; lbEditBankInfo.PostBackUrl = "~/Information/EditBankInfo.aspx?rek=" + HttpUtility.UrlEncode(Rijndael.Encrypt(_data.No_Rek.Trim()));

L94

pnlNoData.Visible = false; pnlBankDetail.Visible = true; litAccountNumber.Text = _data.No_Rek.Trim(); litNameAccount.Text = _data.Atas_Nama.Trim(); litBranch.Text = _data.BranchOffice.Trim(); litOpeningDate.Text = Convert.ToDateTime(_data.TglBuka).ToString("dd MMMM yyyy"); } else { lbEditBankInfo.Text = "Add New"; lbEditBankInfo.PostBackUrl = "~/Information/EditBankInfo.aspx"; pnlNoData.Visible = true; pnlBankDetail.Visible = false; } } } } }

• EditBankInfo.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.AppFacade; using Business.Entities.Data; using CrossCutting.Security; using CrossCutting.OptMgmt; namespace BinusianProfile.Information { public partial class EditBankInfo : SecurePage// System.Web.UI.Page { private static string binusianId = ""; protected string NoRek { get { return ViewState["NoRek"].ToString(); } set { ViewState["NoRek"] = value; } } private void SaveViewStates() { if (Request.QueryString["rek"] != null) { string tempId = Request.QueryString["rek"].ToString(); tempId = tempId.Replace(" ", "+"); NoRek = Convert.ToString(Rijndael.Decrypt(tempId)); } else { NoRek = "0"; } }

L95

protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; } else { Response.Redirect("~/Information/BankInfo.aspx"); } SaveViewStates(); if (new BinusianSsytem().CheckIfBinusianIdIsActiveStudent(binusianId)) { Response.Redirect("~/Information/BankInfo.aspx"); } if (NoRek !="0") { BankData _data = new BankSystem().getBankDetailByBinusianId(binusianId, NoRek.Trim()); litTitleBank.Text = "Edit Bank Account"; txtAccountNumber.Text = _data.No_Rek.Trim(); txtNameAccount.Text = _data.Atas_Nama.Trim(); txtBranch.Text = _data.BranchOffice.Trim(); ucOpeningDate.setDate(Convert.ToDateTime(_data.TglBuka).ToString("dd/MM/yyyy")); } else { litTitleBank.Text = "Add Bank Account"; } } } private static bool success; protected void okButton_Click(object sender, EventArgs e) { if (success == false) { successModalPopup.Hide(); } else if (success == true) { Response.Redirect("~/Information/BankInfo.aspx"); } } protected void btnSubmitBank_Click(object sender, EventArgs e) { int error = 0; #region error message litError.Visible = true; litError.Text = "<ul>"; if (txtAccountNumber.Text.Trim() == "") { litError.Text += "<li>Account Number Must Be Filled</li>"; error++; } if (txtNameAccount.Text.Trim() == "") { litError.Text += "<li>Name on the Account Must Be Choosen</li>";

L96

error++; } if (txtBranch.Text.Trim() == "") { litError.Text += "<li>Branch Office Must Be Filled</li>"; error++; } if (ucOpeningDate.getDate() == null || ucOpeningDate.getDate() == "") { litError.Text += "<li>Opening Date Must Be Choosen</li>"; error++; } litError.Text += "</ul>"; #endregion if (error == 0) { BankData _data = new BankData(); _data.Atas_Nama = txtNameAccount.Text.Trim(); _data.BranchOffice = txtBranch.Text.Trim(); _data.Nama_Bank = "BCA"; _data.No_Rek = txtAccountNumber.Text.Trim(); _data.TglBuka = ucOpeningDate.getDate(); success = new BankSystem().InsertUpdateBank(binusianId,_data ,binusianId); if (success == false) { ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/close.png'/>" + "<label class=\"textred\"> The record saved unsuccessfully.</label>"; successModalPopup.Show(); } else if (success == true) { ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/ActionDBAdd.png'/>" + "<label class=\"textwhite\">The record saved successfully.</label>"; successModalPopup.Show(); } } } protected void lbBackToContactInfo_Click(object sender, EventArgs e) { Response.Redirect("ContactInfo.aspx"); } } }

• WorkExperience.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using System.Web.UI.MobileControls; using CrossCutting.Security; namespace BinusianProfile.Portofolio {

L97

public partial class WorkExperience :SecurePage// System.Web.UI.Page { private static string binusianid; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { binusianid = ((BinusianData) Session["UserData"]).BinusianId.ToString(); List<WorkData> _listWork = new WorkSystem().GetListWorkByBinusianId(binusianid); if (_listWork.Count == 0) { pnlNoData.Visible = true; rptWork.Visible = false; } else { pnlNoData.Visible = false; rptWork.Visible = true; rptWork.DataSource = _listWork; rptWork.DataBind(); } } } protected void rptWork_ItemDataBound(object sender,RepeaterItemEventArgs e) { if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { WorkData _data = (WorkData) e.Item.DataItem; Literal litCompanyName = (Literal)e.Item.FindControl("litCompanyName"); Literal litField = (Literal)e.Item.FindControl("litField"); Literal litRole = (Literal)e.Item.FindControl("litRole"); Literal litCountry = (Literal)e.Item.FindControl("litCountry"); Literal litStartDate = (Literal)e.Item.FindControl("litStartDate"); Literal litEndDate = (Literal)e.Item.FindControl("litEndDate"); HiddenField hdnKodeLembaga = (HiddenField)e.Item.FindControl("hdnKodeLembaga"); LinkButton lbEditWork = (LinkButton)e.Item.FindControl("lbEditWork"); LinkButton lbRemoveWork = (LinkButton)e.Item.FindControl("lbRemoveWork"); litCompanyName.Text = _data.CompanyName.Trim(); litField.Text = _data.Category_Name.Trim(); litRole.Text = _data.Position_Name.Trim(); litCountry.Text = _data.NamaNegara.Trim(); litStartDate.Text = DateTime.ParseExact(_data.StartDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMM yyyy"); litEndDate.Text = DateTime.ParseExact(_data.EndDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMM yyyy"); hdnKodeLembaga.Value = _data.KodeLembaga.ToString(); lbRemoveWork.CommandName = "Delete"; lbRemoveWork.CommandArgument = _data.KodeLembaga.ToString(); lbRemoveWork.Attributes.Add("onclick", "return confirm('Are you sure want to delete this record of working data?');"); lbEditWork.CommandName = "Edit"; lbEditWork.CommandArgument = _data.KodeLembaga.ToString(); } } protected void rptWork_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "Delete") { bool success = new WorkSystem().DeleteWorkingExperience(binusianid, Convert.ToInt32(e.CommandArgument)); if (success)

L98

{ Response.Redirect("~/Portofolio/WorkExperience.aspx"); } } if (e.CommandName == "Edit") { Response.Redirect("~/Portofolio/EditWorkExperience.aspx?edit=1&id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.CommandArgument.ToString().Trim()))); } } } }

• EditWorkExperience.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using CrossCutting.OptMgmt; using CrossCutting.Security; namespace BinusianProfile.Portofolio { public partial class EditWorkExperience : SecurePage//System.Web.UI.Page { private static string binusianid; private static int success; protected int isEdit { get { return Convert.ToInt32(ViewState["isEdit"]); } set { ViewState["isEdit"] = value; } } protected int ID { get { return Convert.ToInt32(ViewState["id"]); } set { ViewState["id"] = value; } } private void SaveViewStates() { if (Request.QueryString["id"] != null)

L99

{ string temp = Request.QueryString["id"].ToString().Trim(); temp = temp.Replace(" ", "+"); ID = Convert.ToInt32(Rijndael.Decrypt(temp)); } if (Request.QueryString["edit"] != null) { isEdit = Convert.ToInt32(Request.QueryString["edit"]); } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { binusianid = ((BinusianData)Session["UserData"]).BinusianId.ToString(); SaveViewStates(); btnSubmitWork.Visible = false; ddlCompanySize.DataSource = new WorkSystem().GetAllListCompanySize(); ddlCompanySize.DataTextField = "Organization_Size_Name"; ddlCompanySize.DataValueField = "Organization_Size_Id"; ddlCompanySize.DataBind(); ddlCompanyType.DataSource = new WorkSystem().GetAllListCompanyType(); ddlCompanyType.DataTextField = "Organization_Type_Name"; ddlCompanyType.DataValueField = "Organization_Type_Id"; ddlCompanyType.DataBind(); ddlField.DataSource = new WorkSystem().GetAllListCategoryWork(); ddlField.DataTextField = "Category_Name"; ddlField.DataValueField = "Category_Id"; ddlField.DataBind(); ddlWorkStatus.DataSource = new WorkSystem().GetAllListEmploymentStatus(); ddlWorkStatus.DataTextField = "Employment_Status_Name"; ddlWorkStatus.DataValueField = "Employment_Status_Id"; ddlWorkStatus.DataBind(); rblSalary.DataSource = new WorkSystem().GetAllListSalaryWork(); rblSalary.DataTextField = "RangeSalary"; rblSalary.DataValueField = "SalaryWorkExperienceId"; rblSalary.DataBind(); txtProvince.Visible = false; ddlProvince.Visible = true; litError.Text = ""; ddlCountry.DataSource = new ResidenceSystem().GetContactCountryForDDL(); ddlCountry.DataTextField = "NamaNegaraIng"; ddlCountry.DataValueField = "KodeNegara"; ddlCountry.DataBind(); ddlRole.Items.Add(new ListItem(" - Choose Role - ", "-1")); ddlProvince.Items.Add(new ListItem(" - Choose Province - ", "-1")); ddlDistrict.Items.Add(new ListItem(" - Choose District - ", "-1")); txtDistrict.Visible = false; ddlPhoneType.DataSource = new ContactSystem().GetPhoneTypeForDDL(); ddlPhoneType.DataValueField = "JenisTeleponId"; ddlPhoneType.DataTextField = "JenisTelepon"; ddlPhoneType.DataBind(); ddlPhoneType.Items.RemoveAt(0);

L100

if (isEdit == 1) { AllWorkData _alldata = new WorkSystem().GetDetailWorkExperience(binusianid, ID); txtCompanyName.Text = _alldata.WorkData.CompanyName.Trim(); ddlCompanyType.SelectedValue = _alldata.WorkData.Organization_Type_Id.ToString(); ddlCompanySize.SelectedValue = _alldata.WorkData.Organization_Size_Id.ToString(); ddlCompanySize.Items.RemoveAt(0); ddlField.SelectedValue = _alldata.WorkData.Category_Id.ToString(); ddlField.Items.RemoveAt(0); rblSalary.SelectedValue = _alldata.WorkData.SalaryWorkExperienceId.ToString(); ddlRole.Items.Clear(); ddlRole.DataSource = new WorkSystem().GetAllListPositionWork(Convert.ToInt32(ddlField.SelectedItem.Value)); ddlRole.DataTextField = "Position_Name"; ddlRole.DataValueField = "Position_Id"; ddlRole.DataBind(); ddlRole.SelectedValue = _alldata.WorkData.Position_Id.ToString(); ddlRole.Items.RemoveAt(0); ddlPhoneType.SelectedValue = _alldata.ContactData.JenisTeleponId.ToString(); txtPhoneNumber.Text = _alldata.ContactData.NomorTelp.Trim(); txtPhoneExt.Text = _alldata.ContactData.Ekstensi.Trim(); txtWebsite.Text = _alldata.WebsiteData.URL.Trim(); ddlWorkStatus.SelectedValue = _alldata.WorkData.Employment_Status_Id.ToString(); ddlWorkStatus.Items.RemoveAt(0); if (_alldata.ResidenceData.KodeNegara != 1) { ddlProvince.Visible = false; ddlDistrict.Visible = false; txtProvince.Visible = true; txtDistrict.Visible = true; txtProvince.Text = _alldata.ResidenceData.PropinsiLuar; txtDistrict.Text = _alldata.ResidenceData.DistrictLuar; } else { ddlDistrict.Visible = true; txtDistrict.Visible = false; ddlProvince.Items.Clear(); ddlProvince.DataSource = new ResidenceSystem().GetContactProvinceForDDL(); ddlProvince.DataTextField = "NamaPropinsi"; ddlProvince.DataValueField = "KodePropinsi"; ddlProvince.DataBind(); ddlProvince.Items.RemoveAt(0); ddlProvince.SelectedValue = _alldata.ResidenceData.KodePropinsi.ToString().Trim(); ddlDistrict.Items.Clear(); ddlDistrict.DataSource = new ResidenceSystem().GetContactDistrictForDDL(Convert.ToInt32(ddlProvince.SelectedItem.Value)); ddlDistrict.DataTextField = "NamaDistrict"; ddlDistrict.DataValueField = "KdDistrict"; ddlDistrict.DataBind(); ddlDistrict.Items.RemoveAt(0); ddlDistrict.SelectedValue = _alldata.ResidenceData.KdDistrict.ToString().Trim();

L101

} txtAddress.Text = _alldata.ResidenceData.Address.Trim(); ddlCountry.SelectedValue = _alldata.ResidenceData.KodeNegara.ToString().Trim(); txtSubDistrict.Text = _alldata.ResidenceData.SubDistrict.Trim(); txtPostalCode.Text = _alldata.ResidenceData.PostalCode.Trim(); ddlCountry.Items.RemoveAt(0); ucStartDate.setDate(_alldata.WorkData.StartDate); ucEndDate.setDate(_alldata.WorkData.EndDate); } else { litTitleWork.Text = "Add Work Experience"; //pnlInsertResidence.Visible = true; //litError.Visible = false; //litError.Text = ""; //List<ResidenceData> residenceList = new ResidenceSystem().GetContactResidenceListofBinusian(binusianid, 0); //if (residenceList.Count >= 3) //{ // litError.Visible = true; // pnlInsertResidence.Visible = false; // litError.Text = "You Have Reached Maximum Residence Info Data"; //} } } } protected void lbBackToWorkInfo_Click(object sender, EventArgs e) { Response.Redirect("WorkExperience.aspx"); } protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e) { if (ddlCountry.SelectedItem.Value != "-1") { if (ddlCountry.Items[0].Value == "-1") { ddlCountry.Items.RemoveAt(0); } } if (ddlCountry.SelectedItem.Value == "1") { txtProvince.Visible = false; ddlProvince.Visible = true; ddlProvince.Items.Clear(); ddlProvince.DataSource = new ResidenceSystem().GetContactProvinceForDDL(); ddlProvince.DataTextField = "NamaPropinsi"; ddlProvince.DataValueField = "KodePropinsi"; ddlProvince.DataBind(); txtDistrict.Visible = false; ddlDistrict.Visible = true; } else

L102

{ txtDistrict.Visible = true; ddlDistrict.Visible = false; txtProvince.Visible = true; ddlProvince.Visible = false; } } protected void ddlProvince_SelectedIndexChanged(object sender, EventArgs e) { if (ddlProvince.SelectedItem.Value != "-1") { if (ddlProvince.Items[0].Value == "-1") { ddlProvince.Items.RemoveAt(0); } txtDistrict.Visible = false; ddlDistrict.Visible = true; ddlDistrict.Items.Clear(); ddlDistrict.DataSource = new ResidenceSystem().GetContactDistrictForDDL(Convert.ToInt32(ddlProvince.SelectedItem.Value)); ddlDistrict.DataTextField = "NamaDistrict"; ddlDistrict.DataValueField = "KdDistrict"; ddlDistrict.DataBind(); } } protected void ddlDistrict_SelectedIndexChanged(object sender, EventArgs e) { if (ddlDistrict.SelectedItem.Value != "-1") { if (ddlDistrict.Items[0].Value == "-1") { ddlDistrict.Items.RemoveAt(0); } } } protected void ddlCompanyType_SelectedIndexChanged(object sender, EventArgs e) { if (ddlCompanyType.SelectedItem.Value != "-1") { if (ddlCompanyType.Items[0].Value == "-1") { ddlCompanyType.Items.RemoveAt(0); } } } protected void ddlCompanySize_SelectedIndexChanged(object sender, EventArgs e) { if (ddlCompanySize.SelectedItem.Value != "-1") { if (ddlCompanySize.Items[0].Value == "-1") { ddlCompanySize.Items.RemoveAt(0); } }

L103

} protected void ddlField_SelectedIndexChanged(object sender, EventArgs e) { if (ddlField.SelectedItem.Value != "-1") { if (ddlField.Items[0].Value == "-1") { ddlField.Items.RemoveAt(0); } ddlRole.Items.Clear(); ddlRole.DataSource = new WorkSystem().GetAllListPositionWork(Convert.ToInt32(ddlField.SelectedItem.Value)); ddlRole.DataTextField = "Position_Name"; ddlRole.DataValueField = "Position_Id"; ddlRole.DataBind(); } } protected void ddlRole_SelectedIndexChanged(object sender, EventArgs e) { if (ddlRole.SelectedItem.Value != "-1") { if (ddlRole.Items[0].Value == "-1") { ddlRole.Items.RemoveAt(0); } } } protected void okButton_Click(object sender, EventArgs e) { if (success == 0) { successModalPopup.Hide(); } else if (success == 1) { Response.Redirect("~/Portofolio/WorkExperience.aspx"); } } protected void chkAgree_change(object sender, EventArgs e) { if (chkAgree.Checked == true) { btnSubmitWork.Visible = true; } else { btnSubmitWork.Visible = false; } } protected void ddlWorkStatus_selectedindexchanged(object sender, EventArgs e) { if (ddlWorkStatus.SelectedItem.Value != "-1") { if (ddlWorkStatus.Items[0].Value == "-1") { ddlWorkStatus.Items.RemoveAt(0); } } } protected void btnSubmit_Click(object sender, EventArgs e)

L104

{ int error = 0; #region error message litError.Visible = true; litError.Text = "<ul>"; if (txtCompanyName.Text.Trim() == "") { litError.Text += "<li>Company Name Must Be Filled</li>"; error++; } if (ddlCompanyType.SelectedItem.Value == "-1") { litError.Text += "<li>Company Type Must Be Choosen</li>"; error++; } if (ddlCompanySize.SelectedItem.Value == "-1") { litError.Text += "<li>Company Size Must Be Choosen</li>"; error++; } if (ddlField.SelectedItem.Value == "-1") { litError.Text += "<li>Field Must Be Choosen</li>"; error++; } if (ddlRole.SelectedItem.Value == "-1") { litError.Text += "<li>Role Must Be Choosen</li>"; error++; } if (rblSalary.SelectedIndex == -1) { litError.Text += "<li>Salary Must Be Choosen</li>"; error++; } if (txtAddress.Text.Trim() == "") { litError.Text += "<li>Address Must Be Filled</li>"; error++; } if (txtPostalCode.Text.Trim() == "") { litError.Text += "<li>Postal Code Must Be Filled</li>"; error++; } if (ddlCountry.SelectedItem.Value == "-1") { litError.Text += "<li>Country Must Be Choosen</li>"; error++; } if (ddlCountry.SelectedItem.Value == "1" && ddlProvince.SelectedItem.Value == "-1") { litError.Text += "<li>Province Must Be Choosen</li>"; error++; } if (ddlCountry.SelectedItem.Value != "1" && txtProvince.Text.Trim() == "") { litError.Text += "<li>Province Must Be Filled</li>"; error++; } if (ddlCountry.SelectedItem.Value == "1" && ddlDistrict.SelectedItem.Value == "-1")

L105

{ litError.Text += "<li>District Must Be Choosen</li>"; error++; } if (ddlCountry.SelectedItem.Value != "1" && txtDistrict.Text.Trim() == "") { litError.Text += "<li>District Must Be Filled</li>"; error++; } if (txtSubDistrict.Text.Trim() == "") { litError.Text += "<li>Sub District Must Be Filled</li>"; error++; } if (txtPhoneNumber.Text.Trim() == "") { litError.Text += "<li>Phone Number Must Be Filled</li>"; error++; } if (txtPhoneExt.Text.Trim() == "") { litError.Text += "<li>Extention Must Be Filled</li>"; error++; } if (txtWebsite.Text.Trim() == "") { litError.Text += "<li>Website URL Must Be Filled</li>"; error++; } if (ddlWorkStatus.SelectedItem.Value == "-1") { litError.Text += "<li>Work Status Must Be Choosen</li>"; error++; } if (ucStartDate.getDate() == "") { litError.Text += "<li>Start Date Must Be Choosen</li>"; error++; } if (ucEndDate.getDate() == "") { litError.Text += "<li>End Date Must Be Choosen</li>"; error++; } litError.Text += "</ul>"; #endregion if (error == 0) { WorkData _workData = new WorkData(); ResidenceData _residenceData = new ResidenceData(); if (Request.QueryString["id"] != null) { _workData.KodeLembaga = ID; } else { _workData.KodeLembaga = 0; }

L106

_workData.StartDate = ucStartDate.getDate(); _workData.EndDate = ucEndDate.getDate(); _workData.Position_Id = Convert.ToInt32(ddlRole.SelectedItem.Value); _workData.Category_Id = Convert.ToInt32(ddlField.SelectedItem.Value); _workData.Employment_Status_Id = ddlWorkStatus.SelectedItem.Value; _workData.SalaryWorkExperienceId = Convert.ToInt32(rblSalary.SelectedItem.Value.ToString()); _workData.CompanyName = txtCompanyName.Text.Trim(); _workData.Organization_Size_Id = ddlCompanySize.SelectedItem.Value; _workData.Organization_Type_Id = Convert.ToInt32(ddlCompanyType.SelectedItem.Value); _residenceData.Address = txtAddress.Text.Trim(); _residenceData.KodeNegara = Convert.ToInt32(ddlCountry.SelectedItem.Value); ContactData _contactData = new ContactData(); _contactData.NomorTelp = txtPhoneNumber.Text.Trim(); _contactData.Ekstensi = txtPhoneExt.Text.Trim(); _contactData.JenisTeleponId = ddlPhoneType.SelectedValue; WebsiteData _websiteData = new WebsiteData(); _websiteData.URL = txtWebsite.Text.Trim(); if (ddlCountry.SelectedItem.Text == "INDONESIA") { _residenceData.KodePropinsi = Convert.ToInt32(ddlProvince.SelectedItem.Value); _residenceData.KdDistrict = Convert.ToInt32(ddlDistrict.SelectedItem.Value); } else { _residenceData.KodePropinsi = 50; _residenceData.KdDistrict = 50; } _residenceData.NamaPropinsi = txtProvince.Text.Trim(); _residenceData.DistrictLuar = txtDistrict.Text.Trim(); _residenceData.SubDistrict = txtSubDistrict.Text.Trim(); _residenceData.PostalCode = txtPostalCode.Text.Trim(); success = new WorkSystem().InsertUpdateWork(binusianid, _residenceData,_workData,_websiteData,_contactData, binusianid); if (success == 0) { ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/close.png'/>" + "<label class=\"textred\"> The record saved unsuccessfully.</label>"; successModalPopup.Show(); } else if (success == 1) { ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/ActionDBAdd.png'/>" + "<label class=\"textwhite\">The record saved successfully.</label>"; successModalPopup.Show(); } } }

L107

} }

• StudentActivity.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using CrossCutting.OptMgmt; namespace BinusianProfile.Portofolio { public partial class StudentActivity : SecurePage//System.Web.UI.Page { private static string binusianId = ""; private int tempPointOpt = 0; private int tempPointCore = 0; protected void Page_Load(object sender, EventArgs e) { //else //{ // Response.Redirect("~/NotAuthorizedAccessPage.aspx"); //} if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; // binusianRoleId = new BinusianSsytem().GetBinusianRole(binusianId); //if (binusianRoleId != "01") //{ // Response.Redirect("~/WelcomePage.aspx"); //} if(!new BinusianSsytem().CheckStatusGabungan(binusianId,4)) { Response.Redirect("~/WelcomePage.aspx"); } } List<StudentActivityData> pendingSatData = new StudentActivitySystem().GetPendingStudentActivity(binusianId); if (pendingSatData.Count == 0) { rptPendingActivity.Visible = false; lblNotePending.Text = "You don't have any pending student activity that need approval."; lblNotePending.Visible = true; } else { rptPendingActivity.Visible = true; rptPendingActivity.DataSource = pendingSatData; rptPendingActivity.DataBind(); } List<StudentActivityData> coreSatData = new StudentActivitySystem().GetCoreStudentActivity(binusianId); if (coreSatData.Count == 0) { rptCoreActivity.Visible = false;

L108

lblNoteCore.Text = "You don't have any core activity yet."; lblNoteCore.Visible = true; } else { rptCoreActivity.Visible = true; rptCoreActivity.DataSource = coreSatData; rptCoreActivity.DataBind(); } List<StudentActivityData> optSatData = new StudentActivitySystem().GetOptionalStudentActivity(binusianId); if (optSatData.Count == 0) { rptOptActivity.Visible = false; lblNoteOpt.Text = "You don't have any optional activity yet."; lblNoteOpt.Visible = true; } else { rptOptActivity.Visible = true; rptOptActivity.DataSource = optSatData; rptOptActivity.DataBind(); } ltPointTotal.Text = "<strong>Total activity points: " + (tempPointCore + tempPointOpt).ToString() + "</strong>"; } } protected void lbAddNewActivity_Click(object sender, EventArgs e) { Response.Redirect("EditStudentActivity.aspx"); } protected void rptPendingActivity_itemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { StudentActivityData studentActivityData = (StudentActivityData)e.Item.DataItem; Literal ltPendingActType = (Literal)e.Item.FindControl("ltPendingActType"); Literal ltPendingActDetail = (Literal)e.Item.FindControl("ltPendingActDetail"); Literal ltPendingActRole = (Literal)e.Item.FindControl("ltPendingActRole"); Literal ltPendingActLevel = (Literal)e.Item.FindControl("ltpendingActLevel"); Literal ltPendingActYear = (Literal)e.Item.FindControl("ltPendingActYear"); LinkButton lbEditPendingAct = (LinkButton)e.Item.FindControl("lbEditPendingAct"); LinkButton lbRemovePendingAct = (LinkButton)e.Item.FindControl("lbRemovePendingAct"); HiddenField hdnPendingSATId = (HiddenField)e.Item.FindControl("hdnPendingSATId"); hdnPendingSATId.Value = studentActivityData.StudentActivityId.ToString().Trim(); ltPendingActType.Text = studentActivityData.ActivityCategory; ltPendingActDetail.Text = "<a href='DetailStudentActivity.aspx?id=" + HttpUtility.UrlEncode(Encryption64.Encrypt(hdnPendingSATId.Value,SystemConfiguration.EncryptionKey)) + "'>" + studentActivityData.ActivityDetail + "</a>"; ltPendingActLevel.Text = studentActivityData.ActivityLevel; ltPendingActRole.Text = studentActivityData.ActivityRole; ltPendingActYear.Text = studentActivityData.ActivityYear;

L109

lbRemovePendingAct.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this record of data?')"); lbEditPendingAct.CommandName = "EditDetail"; lbRemovePendingAct.CommandName = "DeleteSAT"; } } protected void rptPendingActivity_itemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName.ToString() == "EditDetail") { HiddenField hdnPendingSATId = (HiddenField)e.Item.FindControl("hdnPendingSATId"); //Response.Redirect("~/WelcomePage.aspx"); Response.Redirect("EditStudentActivity.aspx?e=1&id=" + HttpUtility.UrlEncode(Encryption64.Encrypt(hdnPendingSATId.Value, SystemConfiguration.EncryptionKey))); } else if (e.CommandName.ToString() == "DeleteSAT") { HiddenField hdnPendingSATId = (HiddenField)e.Item.FindControl("hdnPendingSATId"); Literal ltPendingActType = (Literal)e.Item.FindControl("ltPendingActType"); if (ltPendingActType.Text == "Blog Binusian") { if (new StudentActivitySystem().DeletePedingStudentActivityBlog(Convert.ToInt32(hdnPendingSATId.Value), binusianId)) { Response.Redirect("StudentActivity.aspx"); } else { Response.Redirect("~/WelcomePage.aspx?error=1"); } } else if (ltPendingActType.Text == "Publication") { if (new StudentActivitySystem().DeletePedingStudentActivityPublication(Convert.ToInt32(hdnPendingSATId.Value), binusianId)) { Response.Redirect("StudentActivity.aspx"); } else { Response.Redirect("~/WelcomePage.aspx?error=1"); } } else { if (new StudentActivitySystem().DeletePedingStudentActivityOther(Convert.ToInt32(hdnPendingSATId.Value), binusianId)) { Response.Redirect("StudentActivity.aspx"); } else { Response.Redirect("~/WelcomePage.aspx?error=1"); } } } } protected void rptCoreActivity_ItemDataBound(object sender, RepeaterItemEventArgs e) {

L110

if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { StudentActivityData coreSatData = (StudentActivityData)e.Item.DataItem; HiddenField hdnCoreSatId = (HiddenField)e.Item.FindControl("hdnCoreSatId"); Literal ltCoreActType = (Literal)e.Item.FindControl("ltCoreActType"); Literal ltCoreActDetail = (Literal)e.Item.FindControl("ltCoreActDetail"); Literal ltCoreActRole = (Literal)e.Item.FindControl("ltCoreActRole"); Literal ltCoreActLevel = (Literal)e.Item.FindControl("ltCoreActLevel"); Literal ltCoreActYear = (Literal)e.Item.FindControl("ltCoreActYear"); Literal ltCoreActPoints = (Literal)e.Item.FindControl("ltCoreActPoints"); hdnCoreSatId.Value = coreSatData.StudentActivityId.ToString().Trim(); ltCoreActType.Text = coreSatData.ActivityCategory; ltCoreActDetail.Text = "<a href='DetailStudentActivity.aspx?id=" + HttpUtility.UrlEncode(Encryption64.Encrypt(hdnCoreSatId.Value, SystemConfiguration.EncryptionKey)) + "'>" + coreSatData.ActivityDetail + "</a>"; ltCoreActLevel.Text = coreSatData.ActivityLevel; ltCoreActRole.Text = coreSatData.ActivityRole; ltCoreActYear.Text = coreSatData.ActivityYear; ltCoreActPoints.Text = coreSatData.ActivityPoints.ToString().Trim(); tempPointCore = tempPointCore + coreSatData.ActivityPoints; } if (e.Item.ItemType == ListItemType.Footer) { Label lblPointCore = (Label)e.Item.FindControl("lblPointCore"); lblPointCore.Visible = true; lblPointCore.Text = "Total points for core activity: " + tempPointCore.ToString() + "<br />"; } } protected void rptOptActivity_itemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { StudentActivityData optSatData = (StudentActivityData)e.Item.DataItem; HiddenField hdnOptSatId = (HiddenField)e.Item.FindControl("hdnOptSatId"); Literal ltOptActType = (Literal)e.Item.FindControl("ltOptActType"); Literal ltOptActDetail = (Literal)e.Item.FindControl("ltOptActDetail"); Literal ltOptActLevel = (Literal)e.Item.FindControl("ltOptActLevel"); Literal ltOptActRole = (Literal)e.Item.FindControl("ltOptActRole"); Literal ltOptActYear = (Literal)e.Item.FindControl("ltOptActYear"); Literal ltOptActPoints = (Literal)e.Item.FindControl("ltOptActPoints"); hdnOptSatId.Value = optSatData.StudentActivityId.ToString().Trim(); ltOptActType.Text = optSatData.ActivityCategory; ltOptActDetail.Text = "<a href='DetailStudentActivity.aspx?id=" + HttpUtility.UrlEncode(Encryption64.Encrypt(hdnOptSatId.Value, SystemConfiguration.EncryptionKey)) + "'>" + optSatData.ActivityDetail + "</a>"; ltOptActLevel.Text = optSatData.ActivityLevel; ltOptActRole.Text = optSatData.ActivityRole; ltOptActYear.Text = optSatData.ActivityYear; ltOptActPoints.Text = optSatData.ActivityPoints.ToString().Trim(); tempPointOpt = tempPointOpt + optSatData.ActivityPoints; } if (e.Item.ItemType == ListItemType.Footer) { Label lblPointOpt = (Label)e.Item.FindControl("lblPointOpt"); lblPointOpt.Visible = true; lblPointOpt.Text = "Total points for optional activity: " + tempPointOpt.ToString() + "<br />"; } } }

L111

}

• DetailStudentActivity.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.AppFacade; using Business.Entities.Data; using CrossCutting.OptMgmt; namespace BinusianProfile.Portofolio { public partial class DetailStudentActivity : SecurePage//System.Web.UI.Page { private static string binusianId = ""; // private static string binusianRoleId = ""; protected void Page_Load(object sender, EventArgs e) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; // binusianRoleId = new BinusianSsytem().GetBinusianRole(binusianId); if (!new BinusianSsytem().CheckStatusGabungan(binusianId, 4)) { Response.Redirect("~/WelcomePage.aspx"); } //if (binusianRoleId != "01") //{ // Response.Redirect("~/WelcomePage.aspx"); //} } else { } if (Request.QueryString["id"] == null || Request.QueryString["id"].ToString() == "") { Response.Redirect("StudentActivity.aspx"); } else { string tempId = Request.QueryString["id"].ToString().Trim(); try { int satId = Convert.ToInt32(HttpUtility.UrlDecode(Encryption64.Decrypt(tempId, SystemConfiguration.EncryptionKey))); StudentActivityData satData = new StudentActivitySystem().GetSATDetail(satId, binusianId); if (satData.Nimhs == binusianId) { lbRemoveSAT.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this record of data?')"); ltTitleSAT.Text = satData.ActivityDetail; ltSATCategory.Text = satData.ActivityCategory; if (satData.ActivityCategoryId == "2") { pnlBlog.Visible = true; pnlPublication.Visible = false; pnlOther.Visible = false;

L112

ltSATBlogURL.Text = "<a href='" + satData.ActivityDetail + "'>" + satData.ActivityDetail + "</a>"; ltSATBlogDate.Text = DateTime.ParseExact(satData.ActivityStartDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } else if (satData.ActivityCategoryId == "17") { pnlBlog.Visible = false; pnlPublication.Visible = true; pnlOther.Visible = false; ltSATPublicationTitle.Text = satData.ActivityDetail; ltSATPublicationMediaType.Text = satData.MediaType; ltSATPublicationMediaName.Text = satData.MediaName; ltSATPublicationLevel.Text = satData.ActivityLevel; ltSATPublicationRole.Text = satData.ActivityRole; ltSATPublicationDate.Text = DateTime.ParseExact(satData.ActivityStartDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } else { pnlBlog.Visible = false; pnlPublication.Visible = false; pnlOther.Visible = true; ltSATOtherName.Text = satData.ActivityDetail; ltSATOtherPlace.Text = satData.ActivityPlace; ltSATOtherLevel.Text = satData.ActivityLevel; ltSATOtherRole.Text = satData.ActivityRole; ltSATOtherStartDate.Text = DateTime.ParseExact(satData.ActivityStartDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); ltSATOtherEndDate.Text = DateTime.ParseExact(satData.ActivityEndDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } if (satData.ActivityStatusApprove == "1") { pnlApproved.Visible = true; ltSATPoint.Text = satData.ActivityPoints.ToString(); pnlAction.Visible = false; } else if (satData.ActivityStatusApprove == "0") { pnlApproved.Visible = false; pnlAction.Visible = true; } } else { Response.Redirect("StudentActivity.aspx"); } } catch (Exception ex) { Response.Redirect("StudentActivity.aspx"); } } } //protected void lbBackToStudentActivity_Click(object sender, EventArgs e) //{ // Response.Redirect("StudentActivity.aspx"); //} protected void lbEditSAT_Click(object sender, EventArgs e) { Response.Redirect("EditStudentActivity.aspx?e=1&id=" + Request.QueryString["id"].ToString().Trim()); }

L113

protected void lbRemoveSAT_Click(object sender, EventArgs e) { if (ltSATCategory.Text == "Blog Binusian") { if (new StudentActivitySystem().DeletePedingStudentActivityBlog(Convert.ToInt32(HttpUtility.UrlDecode(Encryption64.Decrypt(Request.QueryString["id"].ToString().Trim(), SystemConfiguration.EncryptionKey))), binusianId)) { Response.Redirect("StudentActivity.aspx"); } } else if (ltSATCategory.Text == "Publication") { if (new StudentActivitySystem().DeletePedingStudentActivityPublication(Convert.ToInt32(HttpUtility.UrlDecode(Encryption64.Decrypt(Request.QueryString["id"].ToString().Trim(), SystemConfiguration.EncryptionKey))), binusianId)) { Response.Redirect("StudentActivity.aspx"); } } else { if (new StudentActivitySystem().DeletePedingStudentActivityOther(Convert.ToInt32(HttpUtility.UrlDecode(Encryption64.Decrypt(Request.QueryString["id"].ToString().Trim(), SystemConfiguration.EncryptionKey))), binusianId)) { Response.Redirect("StudentActivity.aspx"); } } } } }

• Education.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.AppFacade; using Business.Entities.Data; using CrossCutting.OptMgmt; namespace BinusianProfile.Portofolio { public partial class Education :SecurePage// System.Web.UI.Page { private static string binusianId = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; } List<EducationData> collegeList = new EducationSystem().GetEducationCollegeList(binusianId); if (collegeList.Count <= 0) { rptCollegeEdu.Visible = false; }

L114

else { rptCollegeEdu.DataSource = collegeList; rptCollegeEdu.DataBind(); rptCollegeEdu.Visible = true; } } } protected void lnkAddNewCollege_Click(object sender, EventArgs e) { Response.Redirect("EditEducationCollege.aspx"); } protected void lnkAddNewSenior_Click(object sender, EventArgs e) { Response.Redirect("EditEducationSchool.aspx?sd=3"); } protected void lnkAddNewJunior_Click(object sender, EventArgs e) { Response.Redirect("EditEducationSchool.aspx?sd=2"); } protected void lnkAddNewElementary_Click(object sender, EventArgs e) { Response.Redirect("EditEducationSchool.aspx?sd=1"); } protected void rptCollegeEdu_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { EducationData eduData = (EducationData)e.Item.DataItem; HiddenField hdnCollegeId = (HiddenField)e.Item.FindControl("hdnCollegeId"); Literal litCollege = (Literal)e.Item.FindControl("litCollege"); LinkButton lbEditCollege = (LinkButton)e.Item.FindControl("lbEditCollege"); LinkButton lbRemoveCollege = (LinkButton)e.Item.FindControl("lbRemoveCollege"); Literal litDegreeCollege = (Literal)e.Item.FindControl("litDegreeCollege"); Literal litStudyProgramCollege = (Literal)e.Item.FindControl("litStudyProgramCollege"); Literal litInstitutionCollege = (Literal)e.Item.FindControl("litInstitutionCollege"); Literal litStudentIdCollege = (Literal)e.Item.FindControl("litStudentIdCollege"); Literal litAddressCollege = (Literal)e.Item.FindControl("litAddressCollege"); Literal litPostCodeCollege = (Literal)e.Item.FindControl("litPostCodeCollege"); Literal litCountryCollege = (Literal)e.Item.FindControl("litCountryCollege"); Literal litProvinceCollege = (Literal)e.Item.FindControl("litProvinceCollege"); Literal litDistrictCollege = (Literal)e.Item.FindControl("litDistrictCollege"); Literal litSubDistrict = (Literal)e.Item.FindControl("litSubDistrict"); Literal litEnrollmentYearCollege = (Literal)e.Item.FindControl("litEnrollmentYearCollege"); Literal litGraduateYearCollege = (Literal)e.Item.FindControl("litGraduateYearCollege"); Literal litGPACollege = (Literal)e.Item.FindControl("litGPACollege"); Literal litMinGPACollege = (Literal)e.Item.FindControl("litMinGPACollege"); Literal litMaxGPACollege = (Literal)e.Item.FindControl("litMaxGPACollege"); hdnCollegeId.Value = eduData.EduCollegeId; litCollege.Text = "<b>" + eduData.EduInstitution + "</b>";

L115

litDegreeCollege.Text = eduData.EduDegree; litStudyProgramCollege.Text = eduData.EduStudyProgram; litInstitutionCollege.Text = eduData.EduInstitution; litStudentIdCollege.Text = eduData.EduStudentId; litAddressCollege.Text = eduData.EduInstitutionAddress; litPostCodeCollege.Text = eduData.EduInstitutionPostalCode; litCountryCollege.Text = eduData.EduInstitutionCountry; litProvinceCollege.Text = eduData.EduInstitutionProvince; litDistrictCollege.Text = eduData.EduInstitutionDistrict; litSubDistrict.Text = eduData.EduInstitutionSubDistrict; litEnrollmentYearCollege.Text = eduData.EduEnrollmentYear; litGraduateYearCollege.Text = eduData.EduGraduateYear; litGPACollege.Text = eduData.EduAvgScore; litMinGPACollege.Text = eduData.EduMinScale; litMaxGPACollege.Text = eduData.EduMaxScale; lbRemoveCollege.Attributes.Add("onclick", "return confirm('Are you sure you want to remove this record of data?');"); lbEditCollege.CommandName = "EditCollege"; lbRemoveCollege.CommandName = "RemoveCollege"; } } protected void rptCollegeEdu_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName.ToString() == "EditCollege") { HiddenField hdnCollegeId = (HiddenField)e.Item.FindControl("hdnCollegeId"); Response.Redirect("EditEducationCollege.aspx?e=1&id=" + HttpUtility.UrlEncode(Encryption64.Encrypt(hdnCollegeId.Value, SystemConfiguration.EncryptionKey))); } else if (e.CommandName.ToString() == "RemoveCollege") { HiddenField hdnCollegeId = (HiddenField)e.Item.FindControl("hdnCollegeId"); bool success = new EducationSystem().DeleteEducation(hdnCollegeid.value); } } } }

• EditEducationCollege.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.AppFacade; using Business.Entities.Data; using CrossCutting.OptMgmt; namespace BinusianProfile.Portofolio { public partial class EditEducationCollege : SecurePage// System.Web.UI.Page { private static string binusianId = ""; protected int ID { get {

L116

return Convert.ToInt32(ViewState["id"]); } set { ViewState["id"] = value; } } private void SaveViewStates() { if (Request.QueryString["id"] != null) { string temp = Request.QueryString["id"].ToString().Trim(); temp = temp.Replace(" ", "+"); ID = Convert.ToInt32(Encryption64.Decrypt(temp,SystemConfiguration.EncryptionKey)); } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; } SaveViewStates(); List<EducationData> degreeList = new EducationSystem().GetDegreeForDDL(); ddlCollegeDegreeEducation.DataSource = degreeList; ddlCollegeDegreeEducation.DataTextField = "EduDegree"; ddlCollegeDegreeEducation.DataValueField = "EduDegreeId"; ddlCollegeDegreeEducation.DataBind(); for (int i = 1; i <= 3; i++) { ddlCollegeDegreeEducation.Items.RemoveAt(0); } List<EducationData> majorList = new EducationSystem().GetMajorForDDL(); ddlCollegeMajorEducation.DataSource = majorList; ddlCollegeMajorEducation.DataTextField = "EduStudyProgram"; ddlCollegeMajorEducation.DataValueField = "EduStudyProgramId"; ddlCollegeMajorEducation.DataBind(); List<EducationData> institutionList = new EducationSystem().GetCollegeInstitutionForDDL(); ddlCollegeInstitutionEducation.DataSource = institutionList; ddlCollegeInstitutionEducation.DataTextField = "EduInstitution"; ddlCollegeInstitutionEducation.DataValueField = "EduInstitutionId"; ddlCollegeInstitutionEducation.DataBind(); ddlCollegeInstitutionEducation.Items.Add("Other"); List<EducationData> countryList = new EducationSystem().GetInstitutionCountryForDDL(); ddlCollegeCountryEducation.DataSource = countryList; ddlCollegeCountryEducation.DataTextField = "EduInstitutionCountry"; ddlCollegeCountryEducation.DataValueField = "EduInstitutionCountryId"; ddlCollegeCountryEducation.DataBind(); List<EducationData> provinceList = new EducationSystem().GetInstitutionProvinceForDDL(); ddlCollegeProvinceEducation.DataSource = provinceList; ddlCollegeProvinceEducation.DataTextField = "EduInstitutionProvince"; ddlCollegeProvinceEducation.DataValueField = "EduInstitutionProvinceId"; ddlCollegeProvinceEducation.DataBind(); List<EducationData> districtList = new EducationSystem().GetInstitutionDistrictForDDL(ddlCollegeProvinceEducation.SelectedValue); ddlCollegeDistrictEducation.DataSource = districtList;

L117

ddlCollegeDistrictEducation.DataTextField = "EduInstitutionDistrict"; ddlCollegeDistrictEducation.DataValueField = "EduInstitutionDistrictId"; ddlCollegeDistrictEducation.DataBind(); if (Request.QueryString["e"] == null && Request.QueryString["id"] == null) { ltTitleEducationCollege.Text = "Add New Education Data"; ddlCollegeCountryEducation.SelectedValue = "1"; ddlCollegeProvinceEducation.SelectedValue = "1"; } else if (Request.QueryString["e"] != null && Request.QueryString["id"] != null) { ltTitleEducationCollege.Text = "Edit Education Data"; string tempId = Request.QueryString["id"].ToString().Trim(); try { string collegeId = HttpUtility.UrlDecode(Encryption64.Decrypt(tempId, SystemConfiguration.EncryptionKey)); EducationData eduData = new EducationSystem().GetEducationDetailCollegeById(binusianId, collegeId); ddlCollegeDegreeEducation.SelectedValue = eduData.EduDegreeId; ddlCollegeMajorEducation.SelectedValue = eduData.EduStudyProgramId; if (eduData.EduInstitutionId != null) { ddlCollegeInstitutionEducation.SelectedValue = eduData.EduInstitutionId; pnlOtherInstitution.Visible = false; } else { ddlCollegeInstitutionEducation.SelectedValue = "Other"; pnlOtherInstitution.Visible = true; txtCollegeInstitutionEducation.Text = eduData.EduInstitution; txtCollegeAddressEducation.Text = eduData.EduInstitutionAddress; ddlCollegeCountryEducation.SelectedValue = eduData.EduInstitutionCountryId; if (eduData.EduInstitutionProvinceId != null) { ddlCollegeProvinceEducation.Visible = true; ddlCollegeDistrictEducation.Visible = true; txtCollegeProvinceEducation.Visible = false; txtCollegeDistrictEducation.Visible = false; ddlCollegeProvinceEducation.SelectedValue = eduData.EduInstitutionProvinceId; List<EducationData> districtListEdit = new EducationSystem().GetInstitutionDistrictForDDL(ddlCollegeProvinceEducation.SelectedValue); ddlCollegeDistrictEducation.DataSource = districtListEdit; ddlCollegeDistrictEducation.DataTextField = "EduInstitutionDistrict"; ddlCollegeDistrictEducation.DataValueField = "EduInstitutionDistrictId"; ddlCollegeDistrictEducation.DataBind(); ddlCollegeDistrictEducation.SelectedValue = eduData.EduInstitutionDistrictId; } else { ddlCollegeProvinceEducation.Visible = false; ddlCollegeDistrictEducation.Visible = false; txtCollegeProvinceEducation.Visible = true; txtCollegeDistrictEducation.Visible = true; txtCollegeProvinceEducation.Text = eduData.EduInstitutionProvince;

L118

txtCollegeDistrictEducation.Text = eduData.EduInstitutionDistrict; } txtCollegeSubDistrictEducation.Text = eduData.EduInstitutionSubDistrict; txtCollegePostalCodeEducation.Text = eduData.EduInstitutionPostalCode; } txtCollegeStudentIdEducation.Text = eduData.EduStudentId; txtCollegeEnrollmentYearEducation.Text = eduData.EduEnrollmentYear; txtCollegeGraduateYearEducation.Text = eduData.EduGraduateYear; txtCollegeGPAEducation.Text = eduData.EduAvgScore; txtCollegeMinGPAEducation.Text = eduData.EduMinScale; txtCollegeMaxGPAEducation.Text = eduData.EduMaxScale; } catch (Exception ex) { Response.Redirect("Education.aspx"); } } else if ((Request.QueryString["e"] != null && Request.QueryString["id"] == null) || (Request.QueryString["e"] == null && Request.QueryString["id"] != null)) { Response.Redirect("Education.aspx"); } } } protected void lbBackToPortofolioEdu_Click(object sender, EventArgs e) { Response.Redirect("Education.aspx"); } protected void ddlCollegeCountryEducation_SelectedIndexChanged(object sender, EventArgs e) { if (ddlCollegeCountryEducation.SelectedValue == "1") { ddlCollegeProvinceEducation.Visible = true; ddlCollegeDistrictEducation.Visible = true; txtCollegeProvinceEducation.Visible = false; txtCollegeDistrictEducation.Visible = false; } else { ddlCollegeProvinceEducation.Visible = false; ddlCollegeDistrictEducation.Visible = false; txtCollegeProvinceEducation.Visible = true; txtCollegeDistrictEducation.Visible = true; } } protected void ddlCollegeProvinceEducation_SelectedIndexChanged(object sender, EventArgs e) { List<EducationData> districtList = new EducationSystem().GetInstitutionDistrictForDDL(ddlCollegeProvinceEducation.SelectedValue); ddlCollegeDistrictEducation.DataSource = districtList; ddlCollegeDistrictEducation.DataTextField = "EduInstitutionDistrict"; ddlCollegeDistrictEducation.DataValueField = "EduInstitutionDistrictId"; ddlCollegeDistrictEducation.DataBind(); } protected void btnSubmitCollegeEducation_Click(object sender, EventArgs e) { if (ddlCollegeInstitutionEducation.SelectedItem.Text == "Other")

L119

{ if (txtCollegeInstitutionEducation.Text == null || txtCollegeInstitutionEducation.Text == "") { lblWarn.Visible = true; lblWarn.Text = "Please input the instituion name where you educated"; return; } if (txtCollegeAddressEducation.Text == null || txtCollegeAddressEducation.Text == "") { lblWarn.Visible = true; lblWarn.Text = "Please input the instituion address where you educated"; return; } if (ddlCollegeProvinceEducation.Visible == false) { if (txtCollegeProvinceEducation.Text == null || txtCollegeProvinceEducation.Text == "") { lblWarn.Visible = true; lblWarn.Text = "Please input the institution province where you educated"; return; } } if (ddlCollegeDistrictEducation.Visible == false) { if (txtCollegeDistrictEducation.Text == null || txtCollegeDistrictEducation.Text == "") { lblWarn.Visible = true; lblWarn.Text = "Please input the institution district where you educated"; return; } } if (txtCollegeSubDistrictEducation.Text == null || txtCollegeSubDistrictEducation.Text == "") { lblWarn.Visible = true; lblWarn.Text = "Please input the institution sub district where you educated"; return; } if (txtCollegePostalCodeEducation.Text == null || txtCollegePostalCodeEducation.Text == "") { lblWarn.Visible = true; lblWarn.Text = "Please input the institution postal code where you educated"; return; } } if(txtCollegeStudentIdEducation.Text == null || txtCollegeStudentIdEducation.Text == "") { lblWarn.Visible = true; lblWarn.Text = "Please input your student ID while you educated in the institution you mentioned"; return; }

L120

if (txtCollegeEnrollmentYearEducation.Text == null || txtCollegeEnrollmentYearEducation.Text == "") { lblWarn.Visible = true; lblWarn.Text = "Please input your enrollment year when you educated in the institution you mentioned"; return; } //if (txtCollegeGraduateYearEducation.Text == null || txtCollegeGraduateYearEducation.Text == "") //{ // lblWarn.Visible = true; // lblWarn.Text = "Please input your graduate year when you educated in the institution you mentioned"; // return; //} if (txtCollegeGPAEducation.Text == null || txtCollegeGPAEducation.Text == "") { lblWarn.Visible = true; lblWarn.Text = "Please input your GPA while you educated in the institution you mentioned"; return; } if (txtCollegeMinGPAEducation.Text == null || txtCollegeMinGPAEducation.Text == "") { lblWarn.Visible = true; lblWarn.Text = "Please input the minimum GPA scale where you educated in the institution you mentioned"; return; } if (txtCollegeMaxGPAEducation.Text == null || txtCollegeMaxGPAEducation.Text == "") { lblWarn.Visible = true; lblWarn.Text = "Please input the maximum GPA scale where you educated in the institution you mentioned"; return; } EducationData collegeEduData = new EducationData(); if (ID == 0) { collegeEduData.EduCollegeId = "0"; } else { collegeEduData.EduCollegeId = ID.ToString(); } collegeEduData.EduDegreeId = ddlCollegeDegreeEducation.SelectedValue; collegeEduData.EduStudyProgramId = ddlCollegeMajorEducation.SelectedValue; collegeEduData.EduStudentId = txtCollegeStudentIdEducation.Text; collegeEduData.EduEnrollmentYear = txtCollegeEnrollmentYearEducation.Text; collegeEduData.EduGraduateYear = txtCollegeGraduateYearEducation.Text; collegeEduData.EduAvgScore = txtCollegeGPAEducation.Text; collegeEduData.EduMinScale = txtCollegeMinGPAEducation.Text; collegeEduData.EduMaxScale = txtCollegeMaxGPAEducation.Text; if (ddlCollegeInstitutionEducation.SelectedItem.Text == "Other") { collegeEduData.EduInstitution = txtCollegeInstitutionEducation.Text; collegeEduData.EduInstitutionAddress = txtCollegeAddressEducation.Text; if (ddlCollegeCountryEducation.SelectedItem.Text == "INDONESIA") { collegeEduData.EduInstitutionCountryId = ddlCollegeCountryEducation.SelectedValue; collegeEduData.EduInstitutionProvinceId = ddlCollegeProvinceEducation.SelectedValue;

L121

collegeEduData.EduInstitutionDistrictId = ddlCollegeDistrictEducation.SelectedValue; } else { collegeEduData.EduInstitutionCountryId = ddlCollegeCountryEducation.SelectedValue; collegeEduData.EduInstitutionProvince = txtCollegeProvinceEducation.Text; collegeEduData.EduInstitutionDistrict = txtCollegeDistrictEducation.Text; } collegeEduData.EduInstitutionSubDistrict = txtCollegeSubDistrictEducation.Text; collegeEduData.EduInstitutionPostalCode = txtCollegePostalCodeEducation.Text; } else { collegeEduData.EduInstitutionId = ddlCollegeInstitutionEducation.SelectedValue; } if(new EducationSystem().InsertUpdateEducationCollege(binusianId, collegeEduData, binusianId)) { success = 1; // Response.Redirect("StudentActivity.aspx"); } else { success = 0; // Response.Redirect("EditStudentActivity.aspx"); } if (success == 1) { ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/ActionDBAdd.png'/>" + "<label class=\"textwhite\">Request sent, waiting for approval.</label>"; successModalPopup.Show(); } else { ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/close.png'/>" + "<label class=\"textred\"> The record saved unsuccessfully.</label>"; successModalPopup.Show(); } } protected void okButton_Click(object sender, EventArgs e) { if (success == 0) { successModalPopup.Hide(); } else if (success == 1) { Response.Redirect("Education.aspx"); } } protected static int success; protected void ddlCollegeInstitutionEducation_SelectedIndexChange(object sender, EventArgs e) { if (ddlCollegeInstitutionEducation.SelectedItem.Text == "Other") { pnlOtherInstitution.Visible = true;

L122

} else { pnlOtherInstitution.Visible = false; } } } }

• FamilyInfo.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using CrossCutting.OptMgmt; using CrossCutting.Security; namespace BinusianProfile.Information { public partial class FamilyInfo : System.Web.UI.Page { private static string binusianId = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; } List<FamilyData> familyList = new FamilySystem().GetFamilyListIdentifier(binusianId); if (familyList.Count > 0) { rptFamilyInfo.DataSource = familyList; rptFamilyInfo.DataBind(); } } } protected void lbAddNewFamily_Click(object sender, EventArgs e) { Response.Redirect("EditFamilyInfo.aspx"); } public static int isbinusian ; public static string kid; protected void rptFamilyInfo_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { FamilyData familyData = (FamilyData)e.Item.DataItem; FamilyData famDetail = new FamilySystem().GetFamilyMemberBasicDetail(binusianId, familyData.IsBinusian, familyData.KodeKeluarga); Literal ltFamilyRelation = (Literal)e.Item.FindControl("ltFamilyRelation"); LinkButton lbRemoveFamily = (LinkButton)e.Item.FindControl("lbRemoveFamily");

L123

LinkButton lbEditFamilyBasicInfo = (LinkButton)e.Item.FindControl("lbEditFamilyBasicInfo"); Literal ltFamilyBasicInfoRelation = (Literal)e.Item.FindControl("ltFamilyBasicInfoRelation"); Literal ltFamilyBasicInfoFullName = (Literal)e.Item.FindControl("ltFamilyBasicInfoFullName"); Literal ltFamilyBasicInfoPoB = (Literal)e.Item.FindControl("ltFamilyBasicInfoPoB"); Literal ltFamilyBasicInfoDoB = (Literal)e.Item.FindControl("ltFamilyBasicInfoDoB"); Literal ltFamilyBasicInfoGender = (Literal)e.Item.FindControl("ltFamilyBasicInfoGender"); Literal ltFamilyBasicInfoAliveStatus = (Literal)e.Item.FindControl("ltFamilyBasicInfoAliveStatus"); Literal ltFamilyBasicInfoTaxStatus = (Literal)e.Item.FindControl("ltFamilyBasicInfoTaxStatus"); Literal ltFamilyBasicInfoEdDegree = (Literal)e.Item.FindControl("ltFamilyBasicInfoEdDegree"); Literal ltFamilyBasicInfoWork = (Literal)e.Item.FindControl("ltFamilyBasicInfoWork"); Repeater rptFamilyResidenceInfo = (Repeater)e.Item.FindControl("rptFamilyResidenceInfo"); Repeater rptFamilyPhoneInfo = (Repeater)e.Item.FindControl("rptFamilyPhoneInfo"); Repeater rptFamilyEmailInfo = (Repeater)e.Item.FindControl("rptFamilyEmailInfo"); Label lblNoEmail = (Label)e.Item.FindControl("lblNoEmail"); Label lblNoResidence = (Label)e.Item.FindControl("lblNoResidence"); Label lblNotePhone = (Label)e.Item.FindControl("lblNotePhone"); LinkButton lbAddFamilyResidence = (LinkButton)e.Item.FindControl("lbAddFamilyResidence"); LinkButton lbAddFamilyPhone = (LinkButton)e.Item.FindControl("lbAddFamilyPhone"); LinkButton lbAddFamilyEmail = (LinkButton)e.Item.FindControl("lbAddFamilyEmail"); lbEditFamilyBasicInfo.PostBackUrl = "~/Information/EditFamilyInfo.aspx?isB=" + HttpUtility.UrlEncode(Rijndael.Encrypt(familyData.IsBinusian.ToString())) + "&bid=" + HttpUtility.UrlEncode(Rijndael.Encrypt(familyData.KodeKeluarga)); lbAddFamilyResidence.PostBackUrl = "~/Information/EditFamilyInfo.aspx?kid=" + HttpUtility.UrlEncode(Rijndael.Encrypt(familyData.KodeKeluarga)) + "&r=" + HttpUtility.UrlEncode(Rijndael.Encrypt("1")); lbAddFamilyPhone.PostBackUrl = "~/Information/EditFamilyInfo.aspx?kid=" + HttpUtility.UrlEncode(Rijndael.Encrypt(familyData.KodeKeluarga)) + "&p=" + HttpUtility.UrlEncode(Rijndael.Encrypt("1")); lbAddFamilyEmail.PostBackUrl = "~/Information/EditFamilyInfo.aspx?kid=" + HttpUtility.UrlEncode(Rijndael.Encrypt(familyData.KodeKeluarga)) + "&e=" + HttpUtility.UrlEncode(Rijndael.Encrypt("1")); kid = HttpUtility.UrlEncode(Rijndael.Encrypt(familyData.KodeKeluarga)); if (familyData.IsBinusian == 1) { lbEditFamilyBasicInfo.Visible = false; lbAddFamilyResidence.Visible = false; lbAddFamilyPhone.Visible = false; lbAddFamilyEmail.Visible = false; isbinusian = 1; } else { lbEditFamilyBasicInfo.Visible = true; lbAddFamilyResidence.Visible = true; lbAddFamilyPhone.Visible = true; lbAddFamilyEmail.Visible = true; isbinusian = 0; } if (isbinusian == 1) {

L124

ltFamilyRelation.Text = " " + familyData.Hubungan + " - " + famDetail.NamaLengkap + " [" + familyData.KodeKeluarga + "]"; } else { ltFamilyRelation.Text = " " + familyData.Hubungan + " - " + famDetail.NamaLengkap; } ltFamilyBasicInfoRelation.Text = familyData.Hubungan; ltFamilyBasicInfoFullName.Text = famDetail.NamaLengkap; ltFamilyBasicInfoPoB.Text = famDetail.TempatLahir; ltFamilyBasicInfoDoB.Text = DateTime.ParseExact(famDetail.TglLahir, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); //ltFamilyBasicInfoDoB.Text = famDetail.TglLahir; ltFamilyBasicInfoGender.Text = famDetail.JenisKelamin; if (famDetail.StatusHidup == null || famDetail.StatusHidup == "") { ltFamilyBasicInfoAliveStatus.Text = "-"; } else { ltFamilyBasicInfoAliveStatus.Text = famDetail.StatusHidup; } if (famDetail.StatusPajak == null || famDetail.StatusPajak == "") { ltFamilyBasicInfoTaxStatus.Text = "-"; } else { ltFamilyBasicInfoTaxStatus.Text = famDetail.StatusPajak; } if (famDetail.NamaJenjangPendidikan == null || famDetail.NamaJenjangPendidikan == "") { ltFamilyBasicInfoEdDegree.Text = "-"; } else { ltFamilyBasicInfoEdDegree.Text = famDetail.NamaJenjangPendidikan; } if (famDetail.Bidang == null || famDetail.Bidang == "") { ltFamilyBasicInfoWork.Text = "-"; } else { ltFamilyBasicInfoWork.Text = famDetail.Bidang; } #region Residence Info List<ResidenceData> residenceList = new List<ResidenceData>(); if(familyData.IsBinusian == 0) { residenceList = new FamilySystem().GetContactResidenceListofKodeKeluarga(familyData.KodeKeluarga, 0); } else { residenceList = new ResidenceSystem().GetContactResidenceListofBinusian(familyData.KodeKeluarga, 0); }

L125

if (residenceList.Count == 0) { rptFamilyResidenceInfo.Visible = false; lblNoResidence.Text = "We don't have any information about the residence"; lblNoResidence.Visible = true; } else { rptFamilyResidenceInfo.Visible = true; rptFamilyResidenceInfo.DataSource = residenceList; rptFamilyResidenceInfo.DataBind(); } #endregion #region Phone Info List<ContactData> phoneList = new List<ContactData>(); if (familyData.IsBinusian == 0) { phoneList = new FamilySystem().GetAllPhoneInfoKeluarga(familyData.KodeKeluarga); } else { phoneList = new ContactSystem().GetAllPhoneInfo(familyData.KodeKeluarga); } if (phoneList.Count == 0) { rptFamilyPhoneInfo.Visible = false; lblNotePhone.Text = "We don't have any information about the phone"; lblNotePhone.Visible = true; } else { rptFamilyPhoneInfo.Visible = true; rptFamilyPhoneInfo.DataSource = phoneList; rptFamilyPhoneInfo.DataBind(); } #endregion #region Email Info List<EmailData> emailList = new List<EmailData>(); if (familyData.IsBinusian == 0) { emailList = new FamilySystem().GetEmailListFromKodeKeluarga(familyData.KodeKeluarga, ""); } else { emailList = new EmailSystem().GetEmailListFromBinusianId(familyData.KodeKeluarga, ""); } if (emailList.Count == 0) { rptFamilyEmailInfo.Visible = false; lblNoEmail.Text = "We don't have any information about the email"; lblNoEmail.Visible = true; } else { rptFamilyEmailInfo.Visible = true; rptFamilyEmailInfo.DataSource = emailList; rptFamilyEmailInfo.DataBind(); }

L126

#endregion } } #region repeater Phone protected void rptPhone_itemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { ContactData phoneData = (ContactData)e.Item.DataItem; Literal ltPhoneCount = (Literal)e.Item.FindControl("ltFamilyPhoneCount"); Literal ltPhoneNumber = (Literal)e.Item.FindControl("ltFamilyPhoneNumber"); Literal ltPhoneExt = (Literal)e.Item.FindControl("ltFamilyPhoneExt"); Literal ltPhoneType = (Literal)e.Item.FindControl("ltFamilyPhoneType"); HiddenField hdnPhoneId = (HiddenField)e.Item.FindControl("hdnPhoneId"); LinkButton lbEditPhone = (LinkButton)e.Item.FindControl("lbEditFamilyPhone"); LinkButton lbRemovePhone = (LinkButton)e.Item.FindControl("lbRemoveFamilyPhone"); Label lblSeparatorPhone = (Label)e.Item.FindControl("lblFamilyPhoneSeparator"); hdnPhoneId.Value = phoneData.TeleponId; ltPhoneCount.Text = (e.Item.ItemIndex + 1).ToString(); if (phoneData.Utama != 1) { ltPhoneNumber.Text = phoneData.NomorTelp; } else if (phoneData.Utama == 1) { ltPhoneNumber.Text = "<strong>" + phoneData.NomorTelp + " [Primary]</strong>"; lbRemovePhone.Visible = false; lblSeparatorPhone.Visible = false; //if (phoneData.JenisTelepon == "Binusian XL") //{ // lbEditPhone.Visible = false; //} } if (phoneData.IsFixed == 1) { lblSeparatorPhone.Visible = false; lbRemovePhone.Visible = false; //lbEditEmail.Visible = false; } if (phoneData.Ekstensi == null || phoneData.Ekstensi == "") { ltPhoneExt.Text = "-"; } else { ltPhoneExt.Text = phoneData.Ekstensi; } if (isbinusian == 1) { lblSeparatorPhone.Visible = false; lbEditPhone.Visible = false; lbRemovePhone.Visible = false; } ltPhoneType.Text = phoneData.JenisTelepon; lbRemovePhone.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this record of data?')");

L127

lbEditPhone.CommandName = "EditPhone"; lbRemovePhone.CommandName = "RemovePhone"; } } protected void rptPhone_itemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName.ToString().Trim() == "EditPhone") { HiddenField hdnPhoneId = (HiddenField)e.Item.FindControl("hdnPhoneId"); Response.Redirect("~/Information/EditFamilyInfo.aspx?kid="+ kid +"&p=" + HttpUtility.UrlEncode(Rijndael.Encrypt("1")) + "&pid=" + HttpUtility.UrlEncode(Rijndael.Encrypt(hdnPhoneId.Value))); } else if (e.CommandName.ToString().Trim() == "RemovePhone") { HiddenField hdnPhoneId = (HiddenField)e.Item.FindControl("hdnPhoneId"); string userIn = binusianId; //if (new ContactSystem().DeletePhoneDetail(binusianId, hdnPhoneId.Value, userIn)) //{ // Response.Redirect("ContactInfo.aspx"); //} } } #endregion #region repeater Residence protected void rptResidence_itemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { ResidenceData _residenceData = (ResidenceData)e.Item.DataItem; Literal litResidenceNumber = (Literal)e.Item.FindControl("ltFamilyResidenceCount"); LinkButton lbEditResidence = (LinkButton)e.Item.FindControl("ltFamilyEditResidence"); LinkButton lbRemoveResidence = (LinkButton)e.Item.FindControl("lbFamilyRemoveResidence"); Literal ltAddress = (Literal)e.Item.FindControl("ltFamilyResidenceAddress"); Literal ltCountry = (Literal)e.Item.FindControl("ltFamilyResidenceCountry"); Literal ltProvince = (Literal)e.Item.FindControl("ltFamilyResidenceProvince"); Literal ltDistrict = (Literal)e.Item.FindControl("ltFamilyResidenceDistrict"); Literal ltSubDistrict = (Literal)e.Item.FindControl("ltFamilyResidenceSubDistrict"); Literal ltPostCode = (Literal)e.Item.FindControl("ltFamilyResidencePostalCode"); Literal ltStatusResidence = (Literal)e.Item.FindControl("ltFamilyResidenceStatus"); litResidenceNumber.Text += (e.Item.ItemIndex + 1).ToString(); if (_residenceData.Utama != 0) { litResidenceNumber.Text += " <b>[Primary]</b>"; lbRemoveResidence.Visible = false; } ltAddress.Text = _residenceData.Address; ltCountry.Text = _residenceData.NamaNegaraIng; if (ltCountry.Text.ToLower().Trim() == "indonesia") { ltProvince.Text = _residenceData.NamaPropinsi;

L128

ltDistrict.Text = _residenceData.NamaDistrict; } else { ltProvince.Text = _residenceData.PropinsiLuar; ltDistrict.Text = _residenceData.DistrictLuar; } ltSubDistrict.Text = _residenceData.SubDistrict; ltPostCode.Text = _residenceData.PostalCode; ltStatusResidence.Text = _residenceData.StatusResidence; if (isbinusian == 1) { lbEditResidence.Visible = false; lbRemoveResidence.Visible = false; } lbEditResidence.CommandName = "EditResidence"; lbEditResidence.CommandArgument = _residenceData.KdAlamat.ToString(); lbRemoveResidence.CommandName = "RemoveResidence"; lbRemoveResidence.CommandArgument = _residenceData.KdAlamat.ToString(); lbRemoveResidence.Attributes.Add("onclick", "return confirm('Are you sure want to delete this record of residence data?');"); } } protected void rptResidence_itemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "EditResidence") { Response.Redirect("~/Information/EditFamilyInfo.aspx?kid=" + kid + "&r=" + HttpUtility.UrlEncode(Rijndael.Encrypt("1")) + "&rid=" + HttpUtility.HtmlEncode(Rijndael.Encrypt(e.CommandArgument.ToString()))); } if (e.CommandName == "RemoveResidence") { // bool delete = new ResidenceSystem().DeleteResidence(binusianId, Convert.ToInt32(e.CommandArgument)); // if (delete) // { // Response.Redirect("~/Information/ContactInfo.aspx"); // } } } #endregion #region repeater Email protected void rptEmail_itemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { EmailData _emailData = (EmailData)e.Item.DataItem; Literal ltEmailCount = (Literal)e.Item.FindControl("ltFamilyEmailCount"); Literal ltEmailAddress = (Literal)e.Item.FindControl("ltFamilyEmailAddress"); LinkButton lbEditEmail = (LinkButton)e.Item.FindControl("lbEditFamilyEmail"); LinkButton lbRemoveEmail = (LinkButton)e.Item.FindControl("lbRemoveFamilyEmail"); Label lblSeparatorEmail = (Label)e.Item.FindControl("lblFamilyEmailSeparator");

L129

ltEmailCount.Text = (e.Item.ItemIndex + 1).ToString(); ltEmailAddress.Text = _emailData.AlamatEmail.ToString().Trim(); if (_emailData.Utama == 1) { ltEmailAddress.Text = "<b>" + _emailData.AlamatEmail + " [Primary] </b>"; lbRemoveEmail.Visible = false; lblSeparatorEmail.Visible = false; } //string email = _emailData.AlamatEmail.Trim(); //string[] split = email.Split(new Char[] { '@' }); //split = split[1].Split(new Char[] { '.' }); //string domain = split[0]; //if (domain.Trim().ToLower() == "binus") //{ // lblSeparatorEmail.Visible = false; // lbRemoveEmail.Visible = false; // lbEditEmail.Visible = false; //} if (_emailData.IsFixed == 1) { lblSeparatorEmail.Visible = false; lbRemoveEmail.Visible = false; // lbEditEmail.Visible = false; } if (isbinusian == 1) { lbEditEmail.Visible = false; lbRemoveEmail.Visible = false; lblSeparatorEmail.Visible = false; } lbEditEmail.CommandName = "EditEmail"; lbEditEmail.CommandArgument = _emailData.AlamatEmail.ToString().Trim(); lbRemoveEmail.CommandName = "RemoveEmail"; lbRemoveEmail.CommandArgument = _emailData.AlamatEmail.ToString().Trim(); lbRemoveEmail.Attributes.Add("onclick", "return confirm('Are you sure want to delete this record of email data?');"); } } protected void rptEmail_itemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "EditEmail") { Response.Redirect("~/Information/EditFamilyInfo.aspx?kid=" + kid + "&e=" + HttpUtility.UrlEncode(Rijndael.Encrypt("1")) + "&eid=" + HttpUtility.HtmlEncode(Rijndael.Encrypt(e.CommandArgument.ToString()))); } if (e.CommandName == "RemoveEmail") { //bool delete = new EmailSystem().DeleteEmail(binusianId, e.CommandArgument.ToString().Trim()); //if (delete) //{ // Response.Redirect("~/Information/ContactInfo.aspx"); //} } } #endregion

L130

} }

• EditFamilyInfo.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using CrossCutting.OptMgmt; using CrossCutting.Security; namespace BinusianProfile.Information { public partial class EditFamilyInfo : SecurePage// System.Web.UI.Page { protected static bool success; private FamilyDetailData FamilyDetailData { get { if (ViewState["FamilyDetailData"] == null) { ViewState["FamilyDetailData"] = new FamilyDetailData(); } return ViewState["FamilyDetailData"] as FamilyDetailData; } set { ViewState["FamilyDetailData"] = value; } } protected string EID { get { return Convert.ToString(ViewState["eid"]); } set { ViewState["eid"] = value; } } protected int RID { get { return Convert.ToInt32(ViewState["rid"]); } set { ViewState["rid"] = value; } } protected int PID { get { return Convert.ToInt32(ViewState["pid"]); } set {

L131

ViewState["pid"] = value; } } protected string KID { get { return Convert.ToString(ViewState["KID"]); } set { ViewState["KID"] = value; } } protected string BID { get { return Convert.ToString(ViewState["bid"]); } set { ViewState["bid"] = value; } } protected int P { get { return Convert.ToInt32(ViewState["p"]); } set { ViewState["p"] = value; } } protected int R { get { return Convert.ToInt32(ViewState["r"]); } set { ViewState["r"] = value; } } protected int ISB { get { return Convert.ToInt32(ViewState["isB"]); } set { ViewState["isB"] = value; } } protected int E { get { return Convert.ToInt32(ViewState["e"]); } set { ViewState["e"] = value; } }

L132

private void SaveViewStates() { if (Request.QueryString["eid"] != null) { string tempId = Request.QueryString["eid"].ToString().Trim(); EID = Convert.ToString(Rijndael.Decrypt(tempId)); } if (Request.QueryString["pid"] != null) { string tempId = Request.QueryString["pid"].ToString().Trim(); PID = Convert.ToInt32(Rijndael.Decrypt(tempId)); } if (Request.QueryString["rid"] != null) { string tempId = Request.QueryString["rid"].ToString().Trim(); RID = Convert.ToInt32(Rijndael.Decrypt(tempId)); } if (Request.QueryString["bid"] != null) { string tempId = Request.QueryString["bid"].ToString().Trim(); BID = Convert.ToString(Rijndael.Decrypt(tempId)); } if (Request.QueryString["kid"] != null) { string tempId = Request.QueryString["kid"].ToString().Trim(); KID = Convert.ToString(Rijndael.Decrypt(tempId)); } if (Request.QueryString["p"] != null) { string tempId = Request.QueryString["p"].ToString().Trim(); P = Convert.ToInt32(Rijndael.Decrypt(tempId)); } if (Request.QueryString["r"] != null) { string tempId = Request.QueryString["r"].ToString().Trim(); R = Convert.ToInt32(Rijndael.Decrypt(tempId)); } if (Request.QueryString["e"] != null) { string tempId = Request.QueryString["e"].ToString().Trim(); E= Convert.ToInt32(Rijndael.Decrypt(tempId)); } if (Request.QueryString["isB"] != null) { string tempId = Request.QueryString["isB"].ToString().Trim(); ISB = Convert.ToInt32(Rijndael.Decrypt(tempId)); } } public static string binusianid = ""; protected void ddlPhoneType_SelectedIndexChanged(object sender, EventArgs e) { if (ddlFamilyPhoneType.SelectedValue == "2") { //txtAreaCode.Text = "+62"; txtFamilyPhoneExt.Enabled = false; } else { //txtAreaCode.Text = ""; txtFamilyPhoneExt.Enabled = true; } } protected void Page_Load(object sender, EventArgs e)

L133

{ if (!IsPostBack) { binusianid = ((BinusianData)Session["UserData"]).BinusianId.ToString(); pnlFamilyBasicInfo.Visible = true; pnlIfBinusian.Visible = false; pnlFamilyResidence.Visible = false; pnlFamilyPhone.Visible = false; pnlFamilyEmail.Visible = false; ltTitleFamily.Text = "Change Family Member"; txtProvince.Visible = false; ddlProvince.Visible = true; lblWarnFamilyResidence.Text = ""; ddlCountry.DataSource = new ResidenceSystem().GetContactCountryForDDL(); ddlCountry.DataTextField = "NamaNegaraIng"; ddlCountry.DataValueField = "KodeNegara"; ddlCountry.DataBind(); ddlProvince.Items.Add(new ListItem(" - Choose Province - ", "-1")); ddlDistrict.Items.Add(new ListItem(" - Choose District - ", "-1")); txtDistrict.Visible = false; ddlStatusResidence.DataSource = new ResidenceSystem().GetContactStatusAlamatForDDL(); ddlStatusResidence.DataTextField = "StatusResidence"; ddlStatusResidence.DataValueField = "KdStatusResidence"; ddlStatusResidence.DataBind(); ddlIsBinusian.Items.Add(new ListItem("No", "0")); ddlIsBinusian.Items.Add(new ListItem("Yes", "1")); ddlRelationship.DataSource = new FamilySystem().GetDLLHubunganKeluarga(); ddlRelationship.DataTextField = "Hubungan"; ddlRelationship.DataValueField = "KodeHubungan"; ddlRelationship.DataBind(); ddlFamilyEducation.DataSource = new EducationSystem().GetDegreeForDDL(); ddlFamilyEducation.DataTextField = "EduDegree"; ddlFamilyEducation.DataValueField = "EduDegreeId"; ddlFamilyEducation.DataBind(); ddlFamilyWork.DataSource = new WorkSystem().GetAllListCategoryWork(); ddlFamilyWork.DataTextField = "Category_Name"; ddlFamilyWork.DataValueField = "Category_Id"; ddlFamilyWork.DataBind(); ddlFamilyTaxStatus.DataSource = new NPWPSystem().GetDLLStatusPajak(); ddlFamilyTaxStatus.DataTextField = "StatusPajak"; ddlFamilyTaxStatus.DataValueField = "KodeStatusPajak"; ddlFamilyTaxStatus.DataBind(); if (ddlFamilyPhoneType.SelectedValue == "2") { //txtAreaCode.Text = "+62"; txtFamilyPhoneExt.Enabled = false; } else { //txtAreaCode.Text = ""; txtFamilyPhoneExt.Enabled = true; } ddlFamilyPhoneType.DataSource = new ContactSystem().GetPhoneTypeForDDL(); ddlFamilyPhoneType.DataValueField = "JenisTeleponId"; ddlFamilyPhoneType.DataTextField = "JenisTelepon";

L134

ddlFamilyPhoneType.DataBind(); ddlFamilyPhoneType.Items.RemoveAt(0); //pnlFamilySocialNetwork.Visible = false; //pnlFamilyWebsite.Visible = false; SaveViewStates(); if (BID != "" && BID != null) { pnlIfBinusian.Visible = false; pnlFamilyBasicInfo.Visible = true; pnlFamilyResidence.Visible = false; pnlFamilyPhone.Visible = false; pnlFamilyEmail.Visible = false; btnSubmitFamilyBasicInfo.Visible = true; btnNextFamilyBasicInfo.Visible = false; ddlIsBinusian.Enabled = false; FamilyData famDetail = new FamilySystem().GetFamilyMemberBasicDetail(binusianid, ISB, BID); if (famDetail.IsBinusian == 1) { // ddlRelationship.Enabled = false; txtFamilyFullName.Enabled = false; txtFamilyPoB.Enabled = false; txtFamilyDoB.Visible = false; rdFamilyGender1.Enabled = false; rdFamilyGender2.Enabled = false; rdFamilyStatus1.Enabled = false; rdFamilyStatus2.Enabled = false; ddlFamilyTaxStatus.Enabled = false; ddlFamilyEducation.Enabled = false; ddlFamilyWork.Enabled = false; } ddlRelationship.SelectedValue = famDetail.Hubungan; txtFamilyFullName.Text = famDetail.NamaLengkap; txtFamilyPoB.Text = famDetail.TempatLahir; txtFamilyDoB.setDate(famDetail.TglLahir); if (famDetail.KodeJenis == 1) { rdFamilyGender1.Checked = true; } else { rdFamilyGender2.Checked = true; } if (famDetail.KodeStatusHidup == 1) { rdFamilyStatus1.Checked = true; } else { rdFamilyStatus2.Checked = true; } ddlFamilyTaxStatus.SelectedValue = famDetail.KodeStatusPajak.ToString(); ddlFamilyEducation.SelectedValue = famDetail.JenjangPendidikan.ToString(); ddlFamilyWork.SelectedValue = famDetail.KodeBidang.ToString(); } else

L135

if (P == 1) { rdFamilyPrimaryPhone1.Enabled = true; rdFamilyPrimaryPhone2.Enabled = true; pnlIfBinusian.Visible = false; pnlFamilyBasicInfo.Visible = false; pnlFamilyResidence.Visible = false; pnlFamilyPhone.Visible = true; pnlFamilyEmail.Visible = false; btnBackFamilyPhone.Visible = false; btnSubmitFamilyPhone.Visible = true; btnAddFamilyMember.Visible = false; if (PID > 0) { try { ContactData phoneDetail = new FamilySystem().GetPhoneDetailInfoKeluarga(KID, PID.ToString()); ddlFamilyPhoneType.SelectedValue = phoneDetail.JenisTeleponId; if (phoneDetail.Utama > 0) { rdFamilyPrimaryPhone1.Checked = true; rdFamilyPrimaryPhone2.Checked = false; rdFamilyPrimaryPhone1.Enabled = false; rdFamilyPrimaryPhone2.Enabled = false; } else { rdFamilyPrimaryPhone1.Checked = false; rdFamilyPrimaryPhone2.Checked = true; } txtFamilyPhoneNumber.Text = phoneDetail.NomorTelp; if (phoneDetail.Ekstensi == null || phoneDetail.Ekstensi == "") { } else { txtFamilyPhoneExt.Text = phoneDetail.Ekstensi; } if (phoneDetail.IsFixed == 1) { ddlFamilyPhoneType.Enabled = false; txtFamilyPhoneNumber.Enabled = false; txtFamilyPhoneExt.Enabled = false; // Response.Redirect("~/Information/ContactInfo.aspx"); } } catch (Exception ex) { Response.Redirect("~/Information/FamilyInfo.aspx"); } } else { int count = 0; List<ContactData> phoneList = new FamilySystem().GetAllPhoneInfoKeluarga(KID); foreach (ContactData _data in phoneList) { if (_data.IsFixed != 1) { count++; } }

L136

if (count >= 5) { ddlFamilyPhoneType.Enabled = false; rdFamilyPrimaryPhone1.Enabled = false; rdFamilyPrimaryPhone2.Enabled = false; txtFamilyPhoneNumber.Enabled = false; txtFamilyPhoneExt.Enabled = false; btnBackFamilyPhone.Enabled = false; lblWarnFamilyPhone.Visible = true; lblWarnFamilyPhone.Text = "You have reached maximum phone information"; } } } else if (R == 1) { rdPrimaryResidence1.Enabled = true; rdPrimaryResidence2.Enabled = true; pnlIfBinusian.Visible = false; pnlFamilyBasicInfo.Visible = false; pnlFamilyResidence.Visible = true; pnlFamilyPhone.Visible = false; pnlFamilyEmail.Visible = false; btnBackFamilyResidence.Visible = false; btnNextFamilyResidence.Visible = false; btnSubmitFamilyResidence.Visible = true; if (RID > 0) { ResidenceData _dataEdit = (new FamilySystem().GetContactResidenceListofKodeKeluarga(KID,RID))[0]; if (_dataEdit.NamaNegaraIng.Trim().ToLower() != "indonesia") { ddlProvince.Visible = false; ddlDistrict.Visible = false; txtProvince.Visible = true; txtDistrict.Visible = true; txtProvince.Text = _dataEdit.PropinsiLuar; txtDistrict.Text = _dataEdit.DistrictLuar; } else { ddlDistrict.Visible = true; txtDistrict.Visible = false; ddlProvince.Items.Clear(); ddlProvince.DataSource = new ResidenceSystem().GetContactProvinceForDDL(); ddlProvince.DataTextField = "NamaPropinsi"; ddlProvince.DataValueField = "KodePropinsi"; ddlProvince.DataBind(); ddlProvince.Items.RemoveAt(0); ddlProvince.SelectedValue = _dataEdit.KodePropinsi.ToString().Trim(); ddlDistrict.Items.Clear(); ddlDistrict.DataSource = new ResidenceSystem().GetContactDistrictForDDL(Convert.ToInt32(ddlProvince.SelectedItem.Value)); ddlDistrict.DataTextField = "NamaDistrict"; ddlDistrict.DataValueField = "KdDistrict"; ddlDistrict.DataBind(); ddlDistrict.Items.RemoveAt(0);

L137

ddlDistrict.SelectedValue = _dataEdit.KdDistrict.ToString().Trim(); } if (_dataEdit.Utama == 0) { rdPrimaryResidence2.Checked = true; } else { rdPrimaryResidence1.Checked = true; } txtAddress.Text = _dataEdit.Address.Trim(); ddlCountry.SelectedValue = _dataEdit.KodeNegara.ToString().Trim(); txtSubDistrict.Text = _dataEdit.SubDistrict.Trim(); txtPostalCode.Text = _dataEdit.PostalCode.Trim(); ddlStatusResidence.SelectedValue = _dataEdit.KdStatusResidence.ToString().Trim(); ddlCountry.Items.RemoveAt(0); ddlStatusResidence.Items.RemoveAt(0); if (_dataEdit.Utama != 0) { rdPrimaryResidence1.Enabled = false; rdPrimaryResidence2.Enabled = false; } } else { pnlInsertResidence.Visible = true; lblWarnFamilyResidence.Visible = false; lblWarnFamilyResidence.Text = ""; List<ResidenceData> residenceList = new FamilySystem().GetContactResidenceListofKodeKeluarga(KID, 0); if (residenceList.Count >= 3) { lblWarnFamilyResidence.Visible = true; pnlInsertResidence.Visible = false; lblWarnFamilyResidence.Text = "You Have Reached Maximum Residence Info Data"; } } } else if (E == 1) { pnlIfBinusian.Visible = false; pnlFamilyBasicInfo.Visible = false; pnlFamilyResidence.Visible = false; pnlFamilyPhone.Visible = false; pnlFamilyEmail.Visible = true; if (EID != "" && EID != null) { EmailData _dataEdit = (new FamilySystem().GetEmailListFromKodeKeluarga(KID, EID))[0]; if (_dataEdit.IsFixed == 1) { txtFamilyEmailAddress.Enabled = false;

L138

// Response.Redirect("~/Information/ContactInfo.aspx"); } if (_dataEdit.Utama == 0) { rdPrimaryEmailNo.Checked = true; } else if (_dataEdit.Utama == 1) { rdPrimaryEmailYes.Checked = true; rdPrimaryEmailYes.Enabled = false; rdPrimaryEmailNo.Enabled = false; } txtFamilyEmailAddress.Text = _dataEdit.AlamatEmail.ToString().Trim(); } else { int count = 0; pnlInsertEmail.Visible = true; litError.Visible = false; litError.Text = ""; List<EmailData> emailList = new FamilySystem().GetEmailListFromKodeKeluarga(KID, ""); foreach (EmailData _data in emailList) { if (_data.IsFixed != 1) { count++; } } if (Convert.ToInt32(count) >= 3) { litError.Visible = true; pnlInsertEmail.Visible = false; litError.Text = "You Have Reached Maximum Email Info Data"; } } } } } protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e) { if (ddlCountry.SelectedItem.Value != "-1") { if (ddlCountry.Items[0].Value == "-1") { ddlCountry.Items.RemoveAt(0); } } if (ddlCountry.SelectedItem.Value == "1") { txtProvince.Visible = false; ddlProvince.Visible = true; ddlProvince.Items.Clear();

L139

ddlProvince.DataSource = new ResidenceSystem().GetContactProvinceForDDL(); ddlProvince.DataTextField = "NamaPropinsi"; ddlProvince.DataValueField = "KodePropinsi"; ddlProvince.DataBind(); txtDistrict.Visible = false; ddlDistrict.Visible = true; } else { txtDistrict.Visible = true; ddlDistrict.Visible = false; txtProvince.Visible = true; ddlProvince.Visible = false; } } protected void okButton_Click(object sender, EventArgs e) { if (success == false) { successModalPopup.Hide(); } else if (success == true) { Response.Redirect("~/Information/FamilyInfo.aspx"); } } protected void btnConfirmFamilyBinusian_Click(object sender, EventArgs e) { lblWarnFamilyIsBinusian.Text = ""; lblWarnFamilyIsBinusian.Visible = true; if (ddlIsBinusian.SelectedItem.Value == "1") { if (txtFamilyBinusianId.Text.Trim() == "") { lblWarnFamilyIsBinusian.Text = "Binusian Id Must Be Filled"; return; } else { FamilyData _data = new FamilyData(); _data.BinusianId = binusianid; _data.KodeKeluarga = txtFamilyBinusianId.Text.Trim(); _data.IsBinusian = Convert.ToInt32(ddlIsBinusian.SelectedItem.Value); _data.KodeHubungan = Convert.ToInt32(ddlRelationship.SelectedItem.Value); string binusianidResult = new FamilySystem().InsertUpdateFamilyApprovalBinusian(binusianid,_data,binusianid); if (binusianidResult != "") { success = true; ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/ActionDBAdd.png'/>" + "<label class=\"textwhite\">The record saved successfully.</label>"; successModalPopup.Show(); } else { success = false; ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/close.png'/>" + "<label class=\"textred\"> The record saved unsuccessfully.</label>";

L140

successModalPopup.Show(); } } } } protected void ddlProvince_SelectedIndexChanged(object sender, EventArgs e) { if (ddlProvince.SelectedItem.Value != "-1") { if (ddlProvince.Items[0].Value == "-1") { ddlProvince.Items.RemoveAt(0); } txtDistrict.Visible = false; ddlDistrict.Visible = true; ddlDistrict.Items.Clear(); ddlDistrict.DataSource = new ResidenceSystem().GetContactDistrictForDDL(Convert.ToInt32(ddlProvince.SelectedItem.Value)); ddlDistrict.DataTextField = "NamaDistrict"; ddlDistrict.DataValueField = "KdDistrict"; ddlDistrict.DataBind(); } } protected void ddlDistrict_SelectedIndexChanged(object sender, EventArgs e) { if (ddlDistrict.SelectedItem.Value != "-1") { if (ddlDistrict.Items[0].Value == "-1") { ddlDistrict.Items.RemoveAt(0); } } } protected void ddlStatusResidence_SelectedIndexChanged(object sender, EventArgs e) { if (ddlStatusResidence.SelectedItem.Value != "-1") { if (ddlStatusResidence.Items[0].Value == "-1") { ddlStatusResidence.Items.RemoveAt(0); } } } protected void lbBackToFamilyInfo_Click(object sender, EventArgs e) { Response.Redirect("FamilyInfo.aspx"); } protected void ddlIsBinusian_SelectedIndexChanged(object sender, EventArgs e) { if (ddlIsBinusian.SelectedItem.Value == "1") { pnlIfBinusian.Visible = true; pnlIfNotBinusian.Visible = false; } else {

L141

pnlIfBinusian.Visible = false; pnlIfNotBinusian.Visible = true; } } protected void btnNextFamilyBasicInfo_Click(object sender, EventArgs e) { int error = 0; lblWarnFamilyBasicInfo.Visible = true; lblWarnFamilyBasicInfo.Text = "<ul>"; //pnlFamilySocialNetwork.Visible = false; // pnlFamilyWebsite.Visible = false; if (txtFamilyFullName.Text.Trim() == "") { lblWarnFamilyBasicInfo.Text += "<li>Full Name Must Be Filled</li>"; error++; } if (txtFamilyPoB.Text.Trim() == "") { lblWarnFamilyBasicInfo.Text += "<li>Place Of Birth Must Be Filled</li>"; error++; } if (txtFamilyDoB.getDate() == null || txtFamilyDoB.getDate() == "") { lblWarnFamilyBasicInfo.Text += "<li>Date Of Birth Must Be Filled</li>"; error++; } if (rdFamilyGender1.Checked == false && rdFamilyGender2.Checked == false) { lblWarnFamilyBasicInfo.Text += "<li>Gender Must Be Chosen</li>"; error++; } if (rdFamilyStatus1.Checked == false && rdFamilyStatus2.Checked == false) { lblWarnFamilyBasicInfo.Text += "<li>Status Must Be Chosen</li>"; error++; } if (ddlFamilyWork.SelectedItem.Value == "-1") { lblWarnFamilyBasicInfo.Text += "<li>Work Field Must Be Chosen</li>"; error++; } lblWarnFamilyBasicInfo.Text += "</ul>"; if (error > 0) { return; } else { pnlIfBinusian.Visible = false; pnlFamilyBasicInfo.Visible = false; pnlFamilyResidence.Visible = true; pnlFamilyPhone.Visible = false; ; pnlFamilyEmail.Visible = false; } } protected void btnBackFamilyResidence_Click(object sender, EventArgs e) { pnlIfBinusian.Visible = false; pnlFamilyBasicInfo.Visible = true; pnlFamilyResidence.Visible = false; pnlFamilyPhone.Visible = false; pnlFamilyEmail.Visible = false; // pnlFamilySocialNetwork.Visible = false;

L142

// pnlFamilyWebsite.Visible = false; } protected void btnNextFamilyResidence_Click(object sender, EventArgs e) { // pnlFamilySocialNetwork.Visible = false; // pnlFamilyWebsite.Visible = false; int error = 0; lblWarnFamilyResidence.Visible = true; lblWarnFamilyResidence.Text = "<ul>"; if (rdPrimaryResidence1.Checked == false && rdPrimaryResidence2.Checked == false) { lblWarnFamilyResidence.Text += "<li>Primary Residence Must Be Choosen</li>"; error++; } if (txtAddress.Text.Trim() == "") { lblWarnFamilyResidence.Text += "<li>Address Must Be Filled</li>"; error++; } if (ddlCountry.SelectedItem.Value == "-1") { lblWarnFamilyResidence.Text += "<li>Country Must Be Choosen</li>"; error++; } if (ddlCountry.SelectedItem.Value == "1" && ddlProvince.SelectedItem.Value == "-1") { lblWarnFamilyResidence.Text += "<li>Province Must Be Choosen</li>"; error++; } if (ddlCountry.SelectedItem.Value != "1" && txtProvince.Text.Trim() == "") { lblWarnFamilyResidence.Text += "<li>Province Must Be Filled</li>"; error++; } if (ddlCountry.SelectedItem.Value == "1" && ddlDistrict.SelectedItem.Value == "-1") { lblWarnFamilyResidence.Text += "<li>District Must Be Choosen</li>"; error++; } if (ddlCountry.SelectedItem.Value != "1" && txtDistrict.Text.Trim() == "") { lblWarnFamilyResidence.Text += "<li>District Must Be Filled</li>"; error++; } if (txtSubDistrict.Text.Trim() == "") { lblWarnFamilyResidence.Text += "<li>Sub District Must Be Filled</li>"; error++; } if (txtPostalCode.Text.Trim() == "") { lblWarnFamilyResidence.Text += "<li>Postal Code Must Be Filled</li>"; error++; } if (ddlStatusResidence.SelectedItem.Value == "-1") {

L143

lblWarnFamilyResidence.Text += "<li>Status Residence Must Be Choosen</li>"; error++; } lblWarnFamilyResidence.Text += "</ul>"; if (error > 0) { return; } else { pnlIfBinusian.Visible = false; pnlFamilyBasicInfo.Visible = false; pnlFamilyResidence.Visible = false; pnlFamilyPhone.Visible = true; pnlFamilyEmail.Visible = false; } } protected void btnBackFamilyPhone_Click(object sender, EventArgs e) { //int error = 0; //lblWarnFamilyPhone.Visible = true; //lblWarnFamilyPhone.Text = "<ul>"; //if (!rdFamilyPrimaryPhone1.Checked && !rdFamilyPrimaryPhone2.Checked) //{ // lblWarnFamilyPhone.Text = "Please choose whether the phone is primary or not"; // error++; //} //else if (txtFamilyPhoneNumber.Text == null || txtFamilyPhoneNumber.Text == "") //{ // lblWarnFamilyPhone.Text = "Please input your phone number"; // error++; //} //lblWarnFamilyPhone.Text = "</ul>"; //if (error > 0) //{ // return; //} //else //{ // pnlIfBinusian.Visible = false; // pnlFamilyBasicInfo.Visible = false; // pnlFamilyResidence.Visible = true; // pnlFamilyPhone.Visible = false; // pnlFamilyEmail.Visible = false; //} pnlIfBinusian.Visible = false; pnlFamilyBasicInfo.Visible = false; pnlFamilyResidence.Visible = true; pnlFamilyPhone.Visible = false; pnlFamilyEmail.Visible = false; // pnlFamilySocialNetwork.Visible = false; // pnlFamilyWebsite.Visible = false; } protected void btnAddFamilyMember_Click(object sender, EventArgs e) { FamilyData _data = new FamilyData(); _data.BinusianId = binusianid;

L144

_data.KodeKeluarga = ""; _data.IsBinusian = Convert.ToInt32(ddlIsBinusian.SelectedItem.Value); _data.KodeHubungan = Convert.ToInt32(ddlRelationship.SelectedItem.Value); _data.NamaLengkap = txtFamilyFullName.Text.Trim(); _data.TempatLahir = txtFamilyPoB.Text.Trim(); _data.TglLahir = Convert.ToString(txtFamilyDoB.getDate()); if (rdFamilyGender1.Checked == true) { _data.KodeJenis = 1; } if (rdFamilyGender2.Checked == true) { _data.KodeJenis = 2; } if (rdFamilyStatus1.Checked == true) { _data.KodeStatusHidup = 1; } if (rdFamilyStatus2.Checked == true) { _data.KodeStatusHidup = 2; } _data.JenjangPendidikan = Convert.ToInt32(ddlFamilyEducation.SelectedItem.Value); _data.KodeBidang = Convert.ToInt32(ddlFamilyWork.SelectedItem.Value); _data.KodeStatusPajak = Convert.ToInt32(ddlFamilyTaxStatus.SelectedItem.Value); ResidenceData _residenceData = new ResidenceData(); _residenceData.KdAlamat = 0; _residenceData.Address = txtAddress.Text.Trim(); _residenceData.KodeNegara = Convert.ToInt32(ddlCountry.SelectedItem.Value); if (ddlCountry.SelectedItem.Text == "INDONESIA") { _residenceData.KodePropinsi = Convert.ToInt32(ddlProvince.SelectedItem.Value); _residenceData.KdDistrict = Convert.ToInt32(ddlDistrict.SelectedItem.Value); } else { _residenceData.KodePropinsi = 50; _residenceData.KdDistrict = 50; } _residenceData.NamaPropinsi = txtProvince.Text.Trim(); _residenceData.DistrictLuar = txtDistrict.Text.Trim(); _residenceData.SubDistrict = txtSubDistrict.Text.Trim(); _residenceData.PostalCode = txtPostalCode.Text.Trim(); _residenceData.KdStatusResidence = Convert.ToInt32(ddlStatusResidence.SelectedItem.Value); if (rdPrimaryResidence1.Checked == true) { _residenceData.Utama = 1; } else { _residenceData.Utama = 0; }

L145

ContactData contactData = new ContactData(); contactData.TeleponId = "0"; contactData.JenisTeleponId = ddlFamilyPhoneType.SelectedValue; if (rdFamilyPrimaryPhone1.Checked) { contactData.Utama = 1; } else if (rdFamilyPrimaryPhone2.Checked) { contactData.Utama = 0; } contactData.NomorTelp = txtFamilyPhoneNumber.Text; contactData.Ekstensi = txtFamilyPhoneExt.Text; string binusianidResult = new FamilySystem().InsertUpdateFamilyApprovalNonBinusian(binusianid, _data, binusianid); int successresidence = new FamilySystem().InsertUpdateContactResidenceFamily(binusianidResult, _residenceData, binusianid); Boolean successcontact = new FamilySystem().InsertUpdatePhoneInfo(binusianidResult, contactData, binusianid); if (successcontact) { success = true; ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/ActionDBAdd.png'/>" + "<label class=\"textwhite\">The record saved successfully.</label>"; successModalPopup.Show(); } else { success = false; ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/close.png'/>" + "<label class=\"textred\"> The record saved unsuccessfully.</label>"; successModalPopup.Show(); } } protected void btnSubmitFamilyBasicInfo_Click(object sender, EventArgs e) { FamilyData _data = new FamilyData(); _data.BinusianId = binusianid; _data.KodeKeluarga = BID; _data.IsBinusian = Convert.ToInt32(ddlIsBinusian.SelectedItem.Value); _data.KodeHubungan = Convert.ToInt32(ddlRelationship.SelectedItem.Value); _data.NamaLengkap = txtFamilyFullName.Text.Trim(); _data.TempatLahir = txtFamilyPoB.Text.Trim(); _data.TglLahir = Convert.ToString(txtFamilyDoB.getDate()); if (rdFamilyGender1.Checked == true) { _data.KodeJenis = 1; } if (rdFamilyGender2.Checked == true) { _data.KodeJenis = 2; }

L146

if (rdFamilyStatus1.Checked == true) { _data.KodeStatusHidup = 1; } if (rdFamilyStatus2.Checked == true) { _data.KodeStatusHidup = 2; } _data.JenjangPendidikan = Convert.ToInt32(ddlFamilyEducation.SelectedItem.Value); _data.KodeBidang = Convert.ToInt32(ddlFamilyWork.SelectedItem.Value); _data.KodeStatusPajak = Convert.ToInt32(ddlFamilyTaxStatus.SelectedItem.Value); string binusianidResult = new FamilySystem().InsertUpdateFamilyApprovalNonBinusian(binusianid, _data, binusianid); if (binusianidResult != "") { success = true; ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/ActionDBAdd.png'/>" + "<label class=\"textwhite\">The record saved successfully.</label>"; successModalPopup.Show(); } else { success = false; ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/close.png'/>" + "<label class=\"textred\"> The record saved unsuccessfully.</label>"; successModalPopup.Show(); } } protected void btnSubmitFamilyResidence_Click(object sender, EventArgs e) { ResidenceData _residenceData = new ResidenceData(); if (RID < 1) { _residenceData.KdAlamat = 0; } else { _residenceData.KdAlamat = RID; } _residenceData.Address = txtAddress.Text.Trim(); _residenceData.KodeNegara = Convert.ToInt32(ddlCountry.SelectedItem.Value); if (ddlCountry.SelectedItem.Text == "INDONESIA") { _residenceData.KodePropinsi = Convert.ToInt32(ddlProvince.SelectedItem.Value); _residenceData.KdDistrict = Convert.ToInt32(ddlDistrict.SelectedItem.Value); } else { _residenceData.KodePropinsi = 50; _residenceData.KdDistrict = 50; } _residenceData.NamaPropinsi = txtProvince.Text.Trim(); _residenceData.DistrictLuar = txtDistrict.Text.Trim(); _residenceData.SubDistrict = txtSubDistrict.Text.Trim(); _residenceData.PostalCode = txtPostalCode.Text.Trim();

L147

_residenceData.KdStatusResidence = Convert.ToInt32(ddlStatusResidence.SelectedItem.Value); if (rdPrimaryResidence1.Checked == true) { _residenceData.Utama = 1; } else { _residenceData.Utama = 0; } int success2 = new FamilySystem().InsertUpdateContactResidenceFamily(KID, _residenceData, binusianid); if (success2 == 0) { success = false; ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/close.png'/>" + "<label class=\"textred\"> The record saved unsuccessfully.</label>"; successModalPopup.Show(); } else if (success2 == 1) { success = true; ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/ActionDBAdd.png'/>" + "<label class=\"textwhite\">The record saved successfully.</label>"; successModalPopup.Show(); } } protected void btnSubmitFamilyPhone_Click(object sender, EventArgs e) { ContactData contactData = new ContactData(); if (PID > 0) { contactData.TeleponId = PID.ToString(); } else { contactData.TeleponId = "0"; } contactData.JenisTeleponId = ddlFamilyPhoneType.SelectedValue; if (rdFamilyPrimaryPhone1.Checked) { contactData.Utama = 1; } else if (rdFamilyPrimaryPhone2.Checked) { contactData.Utama = 0; } contactData.NomorTelp = txtFamilyPhoneNumber.Text; contactData.Ekstensi = txtFamilyPhoneExt.Text; Boolean successcontact = new FamilySystem().InsertUpdatePhoneInfo(KID, contactData, binusianid); if (successcontact) { success = true;

L148

ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/ActionDBAdd.png'/>" + "<label class=\"textwhite\">The record saved successfully.</label>"; successModalPopup.Show(); } else { success = false; ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/close.png'/>" + "<label class=\"textred\"> The record saved unsuccessfully.</label>"; successModalPopup.Show(); } } protected void btnSubmitFamilyEmail_Click(object sender, EventArgs e) { int error = 0; litError.Visible = true; #region error message litError.Text = "<ul>"; if (rdPrimaryEmailNo.Checked == false && rdPrimaryEmailYes.Checked == false) { litError.Text += "<li>Primary Email Must Be Choosen</li>"; error++; } if (txtFamilyEmailAddress.Text.Trim() == "") { litError.Text += "<li>Email Address Must Be Filled</li>"; error++; } litError.Text += "</ul>"; #endregion if (error == 0) { //if (new FamilySystem().CheckIfEmailHasBeenUsed(KID, txtFamilyEmailAddress.Text.Trim())) //{ // litError.Text = "Email Already Used By Another Binusian, Please Choose Another Email"; //} //else //{ string email = txtFamilyEmailAddress.Text.Trim(); string[] split = email.Split(new Char[] { '@' }); split = split[1].Split(new Char[] { '.' }); string domain = split[0]; int utama = 0; if (rdPrimaryEmailYes.Checked == true) { utama = 1; } success = new FamilySystem().InsertUpdateEmail(KID, EID, email, domain, utama); if (success == false) { ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/close.png'/>" + "<label class=\"textred\">Request sent, waiting for approval.</label>";

L149

successModalPopup.Show(); } else if (success == true) { ltlPopup.Text = "<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/ActionDBAdd.png'/>" + "<label class=\"textwhite\">The record saved successfully.</label>"; successModalPopup.Show(); } //} } } } }

• EducationApprovalStudent.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using UserManagement.CrossCutting.OptMgmt; using UserManagement.Bussiness.AppFacade; using UserManagement.Business.Entities; using CrossCutting.Security; using CrossCutting.OptMgmt; namespace BMv3Home_BackEnd.Education { public partial class EducationAppStudent : SecurePage { private static string binusianid; #region privilege private Int32 _moduleId; public Int32 ModuleId { get { return _moduleId; } set { _moduleId = value; } } private string _loginId; public string LoginId { get { return _loginId; } set { _loginId = value; } } private string _viewAccess; public string ViewAccess { get { return _viewAccess; } set { _viewAccess = value; } } private string _addAccess; public string AddAccess { get { return _addAccess; }

L150

set { _addAccess = value; } } private string _editAccess; public string EditAccess { get { return _editAccess; } set { _editAccess = value; } } private string _deleteAccess; public string DeleteAccess { get { return _deleteAccess; } set { _deleteAccess = value; } } private string _printAccess; public string PrintAccess { get { return _printAccess; } set { _printAccess = value; } } private string _sendAccess; public string SendAccess { get { return _sendAccess; } set { _sendAccess = value; } } private string _uploadAccess; public string UploadAccess { get { return _uploadAccess; } set { _uploadAccess = value; } } private string _dowloadAccess; public string DowloadAccess { get { return _dowloadAccess; } set { _dowloadAccess = value; } } #endregion #region loadPrivilegeData public void LoadAccess() { string accessidlogin = new AccessModuleSystem().getAccesIDGrouporUser(1, LoginId); List<ModuleData> moduleNowData = new ModuleSystem().GetDetailModuleAccessData(new WebConfiguration().AreaId, new WebConfiguration().GAId, new WebConfiguration().AppId, ModuleId, accessidlogin); List<PriviledgeData> allAccessAvailable = new AccessModuleSystem().LoadPriviledge(); List<AccessModuleData> userAccessData = new PriviledgeBMv3().LoadAccess(Convert.ToInt32(moduleNowData[0].Priviledge.ToString().Trim()), allAccessAvailable); foreach (AccessModuleData userAccessDataDetail in userAccessData) { if (userAccessDataDetail.AllowPrivilegeName == "View" && userAccessDataDetail.AllowAccess == 0) { ViewAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Add" && userAccessDataDetail.AllowAccess == 0) { AddAccess = "false";

L151

} if (userAccessDataDetail.AllowPrivilegeName == "Edit" && userAccessDataDetail.AllowAccess == 0) { EditAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Delete" && userAccessDataDetail.AllowAccess == 0) { DeleteAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Print" && userAccessDataDetail.AllowAccess == 0) { PrintAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Send" && userAccessDataDetail.AllowAccess == 0) { SendAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Upload" && userAccessDataDetail.AllowAccess == 0) { UploadAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Download" && userAccessDataDetail.AllowAccess == 0) { DowloadAccess = "false"; } } } #endregion #region loadpage public void LoadPage() { #region set privilege ViewAccess = "true"; AddAccess = "true"; EditAccess = "true"; DeleteAccess = "true"; PrintAccess = "true"; SendAccess = "true"; UploadAccess = "true"; DowloadAccess = "true"; #endregion string tmpModuleId = ""; tmpModuleId = HttpUtility.HtmlDecode(Rijndael.Decrypt(Request.QueryString["mid"].ToString().Trim(), WebConfiguration.EncryptionKey)); try { ModuleId = Convert.ToInt32(tmpModuleId); } catch (Exception ex) { ModuleId = 0; } if (Session["uid"] != null) { LoginId = Session["uid"].ToString();

L152

} } #endregion #region ViewState protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } } #endregion protected void ShowData() { List<EducationData> dataSetSource = new List<EducationData>(); dataSetSource = new EducationSystem().getListEducationApp(ddlOrder.SelectedItem.Value.Trim(), ddlOrderType.SelectedItem.Value.Trim(), ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), SystemConfiguration.PagingSumPerPage, CurrPage, 1); if (dataSetSource.Count == 0) { rptPersonalApp.Visible = false; ucPagingControl.Visible = false; litNoData.Visible = true; } else { litNoData.Visible = false; rptPersonalApp.Visible = true; ucPagingControl.Visible = true; rptPersonalApp.DataSource = dataSetSource; rptPersonalApp.DataBind(); } } #region Paging private void FillPaging() { int countPage = new EducationSystem().getListEducationAppCount(ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), 1); litTotalRequest.Text = countPage.ToString().Trim(); int sumPage = 1; if (countPage % SystemConfiguration.PagingSumPerPage == 0)

L153

{ sumPage = countPage / SystemConfiguration.PagingSumPerPage; } else { sumPage = countPage / SystemConfiguration.PagingSumPerPage + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); } #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData _binusianData = (BinusianData)Session["UserData"]; binusianid = _binusianData.BinusianId.Trim(); } LoadPage();

L154

LoadAccess(); ddlOrder.Items.Add(new ListItem("Date", "TrPendidikanTinggiApproval.DateIn")); ddlOrder.Items.Add(new ListItem("Binusian Id", "TrPendidikanTinggiApproval.binusianid")); ddlOrder.Items.Add(new ListItem("Name", "NamaNonGelar")); ddlSearch.Items.Add(new ListItem("Binusian Id", "TrPendidikanTinggiApproval.binusianid")); ddlSearch.Items.Add(new ListItem("Name", "NamaNonGelar")); SaveViewStates(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; FillPaging(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; ShowData(); } else { ucPagingControl.DataBind(); } } protected void rptPersonalApp_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { EducationData eduData = (EducationData)e.Item.DataItem; Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); Literal litName = (Literal)e.Item.FindControl("litName"); Literal litDate = (Literal)e.Item.FindControl("litDate"); Literal ltNewDegree = (Literal)e.Item.FindControl("ltNewDegree"); Literal ltNewMajor = (Literal)e.Item.FindControl("ltNewMajor"); Literal ltNewInstitution = (Literal)e.Item.FindControl("ltNewInstitution"); Literal ltNewStudentID = (Literal)e.Item.FindControl("ltNewStudentID"); Literal ltNewAddress = (Literal)e.Item.FindControl("ltNewAddress"); Literal ltNewCountry = (Literal)e.Item.FindControl("ltNewCountry"); Literal ltNewProvince = (Literal)e.Item.FindControl("ltNewProvince"); Literal ltNewDistrict = (Literal)e.Item.FindControl("ltNewDistrict"); Literal ltNewSubDistrict = (Literal)e.Item.FindControl("ltNewSubDistrict"); Literal ltNewEnrollment = (Literal)e.Item.FindControl("ltNewEnrollment"); Literal ltNewGraduate = (Literal)e.Item.FindControl("ltNewGraduate"); Literal ltNewGPA = (Literal)e.Item.FindControl("ltNewGPA"); Literal ltNewMinGPA = (Literal)e.Item.FindControl("ltNewMinGPA"); Literal ltNewMaxGPA = (Literal)e.Item.FindControl("ltNewMaxGPA"); HiddenField hdfCollegeId = (HiddenField)e.Item.FindControl("hdfCollegeId"); hdfCollegeId.Value = eduData.EduCollegeId; if (eduData.EduDegree == null || eduData.EduDegree == "") { ltNewDegree.Text = "-"; } else { ltNewDegree.Text = eduData.EduDegree; }

L155

if (eduData.EduStudyProgram == null || eduData.EduStudyProgram == "") { ltNewMajor.Text = "-"; } else { ltNewMajor.Text = eduData.EduStudyProgram; } if (eduData.EduInstitution == null || eduData.EduInstitution == "") { ltNewInstitution.Text = "-"; } else { ltNewInstitution.Text = eduData.EduInstitution; } if (eduData.EduStudentId == null || eduData.EduStudentId == "") { ltNewStudentID.Text = "-"; } else { ltNewStudentID.Text = eduData.EduStudentId; } if (eduData.EduInstitutionAddress == null || eduData.EduInstitutionAddress == "") { ltNewAddress.Text = "-"; } else { ltNewAddress.Text = eduData.EduInstitutionAddress; } if (eduData.EduInstitutionCountry == null || eduData.EduInstitutionCountry == "") { ltNewCountry.Text = "-"; } else { ltNewCountry.Text = eduData.EduInstitutionCountry; } if (eduData.EduInstitutionProvince == null || eduData.EduInstitutionProvince == "") { ltNewProvince.Text = "-"; } else { ltNewProvince.Text = eduData.EduInstitutionProvince; } if (eduData.EduInstitutionDistrict == null || eduData.EduInstitutionDistrict == "") { ltNewDistrict.Text = "-"; } else { ltNewDistrict.Text = eduData.EduInstitutionDistrict; } if (eduData.EduInstitutionSubDistrict == null || eduData.EduInstitutionSubDistrict == "") {

L156

ltNewSubDistrict.Text = "-"; } else { ltNewSubDistrict.Text = eduData.EduInstitutionSubDistrict; } if (eduData.EduEnrollmentYear == null || eduData.EduEnrollmentYear == "") { ltNewEnrollment.Text = "-"; } else { ltNewEnrollment.Text = eduData.EduEnrollmentYear; } if (eduData.EduGraduateYear == null || eduData.EduGraduateYear == "") { ltNewGraduate.Text = "-"; } else { ltNewGraduate.Text = eduData.EduGraduateYear; } if (eduData.EduAvgScore == null || eduData.EduAvgScore == "") { ltNewGPA.Text = "-"; } else { ltNewGPA.Text = eduData.EduAvgScore; } if (eduData.EduMinScale == null || eduData.EduMinScale == "") { ltNewMinGPA.Text = "-"; } else { ltNewMinGPA.Text = eduData.EduMinScale; } if (eduData.EduMaxScale == null || eduData.EduMaxScale == "") { ltNewMaxGPA.Text = "-"; } else { ltNewMaxGPA.Text = eduData.EduMaxScale; } Literal ltCurrentDegree = (Literal)e.Item.FindControl("ltCurrentDegree"); Literal ltCurrentMajor = (Literal)e.Item.FindControl("ltCurrentMajor"); Literal ltCurrentInstitution = (Literal)e.Item.FindControl("ltCurrentInstitution"); Literal ltCurrentStudentID = (Literal)e.Item.FindControl("ltCurrentStudentID"); Literal ltCurrentAddress = (Literal)e.Item.FindControl("ltCurrentAddress"); Literal ltCurrentCountry = (Literal)e.Item.FindControl("ltCurrentCountry"); Literal ltCurrentProvince = (Literal)e.Item.FindControl("ltCurrentProvince"); Literal ltCurrentDistrict = (Literal)e.Item.FindControl("ltCurrentDistrict"); Literal ltCurrentSubDistrict = (Literal)e.Item.FindControl("ltCurrentSubDistrict"); Literal ltCurrentEnrollment = (Literal)e.Item.FindControl("ltCurrentEnrollment");

L157

Literal ltCurrentGraduate = (Literal)e.Item.FindControl("ltCurrentGraduate"); Literal ltCurrentGPA = (Literal)e.Item.FindControl("ltCurrentGPA"); Literal ltCurrentMinGPA = (Literal)e.Item.FindControl("ltCurrentMinGPA"); Literal ltCurrentMaxGPA = (Literal)e.Item.FindControl("ltCurrentMaxGPA"); EducationData eduCurrentData = new EducationSystem().GetEducationDetailCollegeById(eduData.BinusianId, Convert.ToInt32(eduData.EduCollegeId)); if (eduCurrentData.EduDegree == null || eduCurrentData.EduDegree == "") { ltCurrentDegree.Text = "-"; } else { ltCurrentDegree.Text = eduCurrentData.EduDegree; } if (eduCurrentData.EduStudyProgram == null || eduCurrentData.EduStudyProgram == "") { ltCurrentMajor.Text = "-"; } else { ltCurrentMajor.Text = eduCurrentData.EduStudyProgram; } if (eduCurrentData.EduInstitution == null || eduCurrentData.EduInstitution == "") { ltCurrentInstitution.Text = "-"; } else { ltCurrentInstitution.Text = eduCurrentData.EduInstitution; } if (eduCurrentData.EduStudentId == null || eduCurrentData.EduStudentId == "") { ltCurrentStudentID.Text = "-"; } else { ltCurrentStudentID.Text = eduCurrentData.EduStudentId; } if (eduCurrentData.EduInstitutionAddress == null || eduCurrentData.EduInstitutionAddress == "") { ltCurrentAddress.Text = "-"; } else { ltCurrentAddress.Text = eduCurrentData.EduInstitutionAddress; } if (eduCurrentData.EduInstitutionCountry == null || eduCurrentData.EduInstitutionCountry == "") { ltCurrentCountry.Text = "-"; } else { ltCurrentCountry.Text = eduCurrentData.EduInstitutionCountry; } if (eduCurrentData.EduInstitutionProvince == null || eduCurrentData.EduInstitutionProvince == "") {

L158

ltCurrentProvince.Text = "-"; } else { ltCurrentProvince.Text = eduCurrentData.EduInstitutionProvince; } if (eduCurrentData.EduInstitutionDistrict == null || eduCurrentData.EduInstitutionDistrict == "") { ltCurrentDistrict.Text = "-"; } else { ltCurrentDistrict.Text = eduCurrentData.EduInstitutionDistrict; } if (eduCurrentData.EduInstitutionSubDistrict == null || eduCurrentData.EduInstitutionSubDistrict == "") { ltCurrentSubDistrict.Text = "-"; } else { ltCurrentSubDistrict.Text = eduCurrentData.EduInstitutionSubDistrict; } if (eduCurrentData.EduEnrollmentYear == null || eduCurrentData.EduEnrollmentYear == "") { ltCurrentEnrollment.Text = "-"; } else { ltCurrentEnrollment.Text = eduCurrentData.EduEnrollmentYear; } if (eduCurrentData.EduGraduateYear == null || eduCurrentData.EduGraduateYear == "") { ltCurrentGraduate.Text = "-"; } else { ltCurrentGraduate.Text = eduCurrentData.EduGraduateYear; } if (eduCurrentData.EduAvgScore == null || eduCurrentData.EduAvgScore == "") { ltCurrentGPA.Text = "-"; } else { ltCurrentGPA.Text = eduCurrentData.EduAvgScore; } if (eduCurrentData.EduMinScale == null || eduCurrentData.EduMinScale == "") { ltCurrentMinGPA.Text = "-"; } else { ltCurrentMinGPA.Text = eduCurrentData.EduMinScale; } if (eduCurrentData.EduMaxScale == null || eduCurrentData.EduMaxScale == "") { ltCurrentMaxGPA.Text = "-";

L159

} else { ltCurrentMaxGPA.Text = eduCurrentData.EduMaxScale; } LinkButton lnkSubmit = (LinkButton)e.Item.FindControl("lnkSubmit"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); pnlError.Visible = false; pnlSuccess.Visible = false; litBinusianId.Text = eduData.BinusianId; litDate.Text = eduData.DateIn.ToString("dd MMMM yyyy").Trim(); litName.Text = eduData.NamaNonGelar; lnkSubmit.CommandName = "Submit"; lnkSubmit.CommandArgument = eduData.BinusianId; lnkSubmit.Attributes.Add("onclick", "return confirm('Are You Sure Want To Submit This Data');"); } } protected void rptPersonalApp_ItemCommand(object sender, RepeaterCommandEventArgs e) { Literal litError = (Literal)e.Item.FindControl("litError"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); HiddenField hdfCollegeId = (HiddenField)e.Item.FindControl("hdfCollegeId"); if (e.CommandName == "Submit") { pnlSuccess.Visible = false; pnlError.Visible = false; RadioButton rdApprove = (RadioButton)e.Item.FindControl("rdApprove"); RadioButton rdDeny = (RadioButton)e.Item.FindControl("rdDeny"); TextBox txtComment = (TextBox)e.Item.FindControl("txtComment"); if (rdDeny.Checked == false && rdApprove.Checked == false) { pnlError.Visible = true; litError.Text = "You Must Choose The Approval Type (Yes / No)."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() == "") { pnlError.Visible = true; litError.Text = "You Must Fill The Comment Field."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() != "") { bool success = new EducationSystem().InsertUpdateApprovalEducation(litBinusianId.Text.Trim(), Convert.ToInt32(hdfCollegeId.Value), 2, binusianid, txtComment.Text.Trim()); if (success) { FillPaging();

L160

ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } if (rdApprove.Checked == true) { bool success = new EducationSystem().InsertUpdateApprovalEducation(litBinusianId.Text.Trim(), Convert.ToInt32(hdfCollegeId.Value), 1, binusianid, ""); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } } } protected void btnSearch_Click(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlSearch_SelectedIndexChanged(object sender, EventArgs e) { } protected void ddlOrder_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlOrderType_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } } }

• EducationApprovalLecturer.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using UserManagement.CrossCutting.OptMgmt; using UserManagement.Bussiness.AppFacade; using UserManagement.Business.Entities; using CrossCutting.Security; using CrossCutting.OptMgmt;

L161

namespace BMv3Home_BackEnd.Education { public partial class EducationAppLecturer : SecurePage { private static string binusianid; #region privilege private Int32 _moduleId; public Int32 ModuleId { get { return _moduleId; } set { _moduleId = value; } } private string _loginId; public string LoginId { get { return _loginId; } set { _loginId = value; } } private string _viewAccess; public string ViewAccess { get { return _viewAccess; } set { _viewAccess = value; } } private string _addAccess; public string AddAccess { get { return _addAccess; } set { _addAccess = value; } } private string _editAccess; public string EditAccess { get { return _editAccess; } set { _editAccess = value; } } private string _deleteAccess; public string DeleteAccess { get { return _deleteAccess; } set { _deleteAccess = value; } } private string _printAccess; public string PrintAccess { get { return _printAccess; } set { _printAccess = value; } } private string _sendAccess; public string SendAccess { get { return _sendAccess; } set { _sendAccess = value; } } private string _uploadAccess; public string UploadAccess { get { return _uploadAccess; } set { _uploadAccess = value; }

L162

} private string _dowloadAccess; public string DowloadAccess { get { return _dowloadAccess; } set { _dowloadAccess = value; } } #endregion #region loadPrivilegeData public void LoadAccess() { string accessidlogin = new AccessModuleSystem().getAccesIDGrouporUser(1, LoginId); List<ModuleData> moduleNowData = new ModuleSystem().GetDetailModuleAccessData(new WebConfiguration().AreaId, new WebConfiguration().GAId, new WebConfiguration().AppId, ModuleId, accessidlogin); List<PriviledgeData> allAccessAvailable = new AccessModuleSystem().LoadPriviledge(); List<AccessModuleData> userAccessData = new PriviledgeBMv3().LoadAccess(Convert.ToInt32(moduleNowData[0].Priviledge.ToString().Trim()), allAccessAvailable); foreach (AccessModuleData userAccessDataDetail in userAccessData) { if (userAccessDataDetail.AllowPrivilegeName == "View" && userAccessDataDetail.AllowAccess == 0) { ViewAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Add" && userAccessDataDetail.AllowAccess == 0) { AddAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Edit" && userAccessDataDetail.AllowAccess == 0) { EditAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Delete" && userAccessDataDetail.AllowAccess == 0) { DeleteAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Print" && userAccessDataDetail.AllowAccess == 0) { PrintAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Send" && userAccessDataDetail.AllowAccess == 0) { SendAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Upload" && userAccessDataDetail.AllowAccess == 0) { UploadAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Download" && userAccessDataDetail.AllowAccess == 0) { DowloadAccess = "false"; } } } #endregion

L163

#region loadpage public void LoadPage() { #region set privilege ViewAccess = "true"; AddAccess = "true"; EditAccess = "true"; DeleteAccess = "true"; PrintAccess = "true"; SendAccess = "true"; UploadAccess = "true"; DowloadAccess = "true"; #endregion string tmpModuleId = ""; tmpModuleId = HttpUtility.HtmlDecode(Rijndael.Decrypt(Request.QueryString["mid"].ToString().Trim(), WebConfiguration.EncryptionKey)); try { ModuleId = Convert.ToInt32(tmpModuleId); } catch (Exception ex) { ModuleId = 0; } if (Session["uid"] != null) { LoginId = Session["uid"].ToString(); } } #endregion #region ViewState protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } } #endregion protected void ShowData() {

L164

List<EducationData> dataSetSource = new List<EducationData>(); dataSetSource = new EducationSystem().getListEducationApp(ddlOrder.SelectedItem.Value.Trim(), ddlOrderType.SelectedItem.Value.Trim(), ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), SystemConfiguration.PagingSumPerPage, CurrPage, 2); if (dataSetSource.Count == 0) { rptPersonalApp.Visible = false; ucPagingControl.Visible = false; litNoData.Visible = true; } else { litNoData.Visible = false; rptPersonalApp.Visible = true; ucPagingControl.Visible = true; rptPersonalApp.DataSource = dataSetSource; rptPersonalApp.DataBind(); } } #region Paging private void FillPaging() { int countPage = new EducationSystem().getListEducationAppCount(ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), 2); litTotalRequest.Text = countPage.ToString().Trim(); int sumPage = 1; if (countPage % SystemConfiguration.PagingSumPerPage == 0) { sumPage = countPage / SystemConfiguration.PagingSumPerPage; } else { sumPage = countPage / SystemConfiguration.PagingSumPerPage + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); } #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; }

L165

else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData _binusianData = (BinusianData)Session["UserData"]; binusianid = _binusianData.BinusianId.Trim(); } LoadPage(); LoadAccess(); ddlOrder.Items.Add(new ListItem("Date", "TrPendidikanTinggiApproval.DateIn")); ddlOrder.Items.Add(new ListItem("Binusian Id", "TrPendidikanTinggiApproval.binusianid")); ddlOrder.Items.Add(new ListItem("Name", "NamaNonGelar")); ddlSearch.Items.Add(new ListItem("Binusian Id", "TrPendidikanTinggiApproval.binusianid")); ddlSearch.Items.Add(new ListItem("Name", "NamaNonGelar")); SaveViewStates(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; FillPaging(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; ShowData(); } else { ucPagingControl.DataBind(); } } protected void rptPersonalApp_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)

L166

{ EducationData eduData = (EducationData)e.Item.DataItem; Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); Literal litName = (Literal)e.Item.FindControl("litName"); Literal litDate = (Literal)e.Item.FindControl("litDate"); Literal ltNewDegree = (Literal)e.Item.FindControl("ltNewDegree"); Literal ltNewMajor = (Literal)e.Item.FindControl("ltNewMajor"); Literal ltNewInstitution = (Literal)e.Item.FindControl("ltNewInstitution"); Literal ltNewStudentID = (Literal)e.Item.FindControl("ltNewStudentID"); Literal ltNewAddress = (Literal)e.Item.FindControl("ltNewAddress"); Literal ltNewCountry = (Literal)e.Item.FindControl("ltNewCountry"); Literal ltNewProvince = (Literal)e.Item.FindControl("ltNewProvince"); Literal ltNewDistrict = (Literal)e.Item.FindControl("ltNewDistrict"); Literal ltNewSubDistrict = (Literal)e.Item.FindControl("ltNewSubDistrict"); Literal ltNewEnrollment = (Literal)e.Item.FindControl("ltNewEnrollment"); Literal ltNewGraduate = (Literal)e.Item.FindControl("ltNewGraduate"); Literal ltNewGPA = (Literal)e.Item.FindControl("ltNewGPA"); Literal ltNewMinGPA = (Literal)e.Item.FindControl("ltNewMinGPA"); Literal ltNewMaxGPA = (Literal)e.Item.FindControl("ltNewMaxGPA"); HiddenField hdfCollegeId = (HiddenField)e.Item.FindControl("hdfCollegeId"); hdfCollegeId.Value = eduData.EduCollegeId; if (eduData.EduDegree == null || eduData.EduDegree == "") { ltNewDegree.Text = "-"; } else { ltNewDegree.Text = eduData.EduDegree; } if (eduData.EduStudyProgram == null || eduData.EduStudyProgram == "") { ltNewMajor.Text = "-"; } else { ltNewMajor.Text = eduData.EduStudyProgram; } if (eduData.EduInstitution == null || eduData.EduInstitution == "") { ltNewInstitution.Text = "-"; } else { ltNewInstitution.Text = eduData.EduInstitution; } if (eduData.EduStudentId == null || eduData.EduStudentId == "") { ltNewStudentID.Text = "-"; } else { ltNewStudentID.Text = eduData.EduStudentId; } if (eduData.EduInstitutionAddress == null || eduData.EduInstitutionAddress == "") { ltNewAddress.Text = "-"; } else { ltNewAddress.Text = eduData.EduInstitutionAddress; }

L167

if (eduData.EduInstitutionCountry == null || eduData.EduInstitutionCountry == "") { ltNewCountry.Text = "-"; } else { ltNewCountry.Text = eduData.EduInstitutionCountry; } if (eduData.EduInstitutionProvince == null || eduData.EduInstitutionProvince == "") { ltNewProvince.Text = "-"; } else { ltNewProvince.Text = eduData.EduInstitutionProvince; } if (eduData.EduInstitutionDistrict == null || eduData.EduInstitutionDistrict == "") { ltNewDistrict.Text = "-"; } else { ltNewDistrict.Text = eduData.EduInstitutionDistrict; } if (eduData.EduInstitutionSubDistrict == null || eduData.EduInstitutionSubDistrict == "") { ltNewSubDistrict.Text = "-"; } else { ltNewSubDistrict.Text = eduData.EduInstitutionSubDistrict; } if (eduData.EduEnrollmentYear == null || eduData.EduEnrollmentYear == "") { ltNewEnrollment.Text = "-"; } else { ltNewEnrollment.Text = eduData.EduEnrollmentYear; } if (eduData.EduGraduateYear == null || eduData.EduGraduateYear == "") { ltNewGraduate.Text = "-"; } else { ltNewGraduate.Text = eduData.EduGraduateYear; } if (eduData.EduAvgScore == null || eduData.EduAvgScore == "") { ltNewGPA.Text = "-"; } else { ltNewGPA.Text = eduData.EduAvgScore; } if (eduData.EduMinScale == null || eduData.EduMinScale == "") { ltNewMinGPA.Text = "-";

L168

} else { ltNewMinGPA.Text = eduData.EduMinScale; } if (eduData.EduMaxScale == null || eduData.EduMaxScale == "") { ltNewMaxGPA.Text = "-"; } else { ltNewMaxGPA.Text = eduData.EduMaxScale; } Literal ltCurrentDegree = (Literal)e.Item.FindControl("ltCurrentDegree"); Literal ltCurrentMajor = (Literal)e.Item.FindControl("ltCurrentMajor"); Literal ltCurrentInstitution = (Literal)e.Item.FindControl("ltCurrentInstitution"); Literal ltCurrentStudentID = (Literal)e.Item.FindControl("ltCurrentStudentID"); Literal ltCurrentAddress = (Literal)e.Item.FindControl("ltCurrentAddress"); Literal ltCurrentCountry = (Literal)e.Item.FindControl("ltCurrentCountry"); Literal ltCurrentProvince = (Literal)e.Item.FindControl("ltCurrentProvince"); Literal ltCurrentDistrict = (Literal)e.Item.FindControl("ltCurrentDistrict"); Literal ltCurrentSubDistrict = (Literal)e.Item.FindControl("ltCurrentSubDistrict"); Literal ltCurrentEnrollment = (Literal)e.Item.FindControl("ltCurrentEnrollment"); Literal ltCurrentGraduate = (Literal)e.Item.FindControl("ltCurrentGraduate"); Literal ltCurrentGPA = (Literal)e.Item.FindControl("ltCurrentGPA"); Literal ltCurrentMinGPA = (Literal)e.Item.FindControl("ltCurrentMinGPA"); Literal ltCurrentMaxGPA = (Literal)e.Item.FindControl("ltCurrentMaxGPA"); EducationData eduCurrentData = new EducationSystem().GetEducationDetailCollegeById(eduData.BinusianId, Convert.ToInt32(eduData.EduCollegeId)); if (eduCurrentData.EduDegree == null || eduCurrentData.EduDegree == "") { ltCurrentDegree.Text = "-"; } else { ltCurrentDegree.Text = eduCurrentData.EduDegree; } if (eduCurrentData.EduStudyProgram == null || eduCurrentData.EduStudyProgram == "") { ltCurrentMajor.Text = "-"; } else { ltCurrentMajor.Text = eduCurrentData.EduStudyProgram; } if (eduCurrentData.EduInstitution == null || eduCurrentData.EduInstitution == "") { ltCurrentInstitution.Text = "-"; } else { ltCurrentInstitution.Text = eduCurrentData.EduInstitution; }

L169

if (eduCurrentData.EduStudentId == null || eduCurrentData.EduStudentId == "") { ltCurrentStudentID.Text = "-"; } else { ltCurrentStudentID.Text = eduCurrentData.EduStudentId; } if (eduCurrentData.EduInstitutionAddress == null || eduCurrentData.EduInstitutionAddress == "") { ltCurrentAddress.Text = "-"; } else { ltCurrentAddress.Text = eduCurrentData.EduInstitutionAddress; } if (eduCurrentData.EduInstitutionCountry == null || eduCurrentData.EduInstitutionCountry == "") { ltCurrentCountry.Text = "-"; } else { ltCurrentCountry.Text = eduCurrentData.EduInstitutionCountry; } if (eduCurrentData.EduInstitutionProvince == null || eduCurrentData.EduInstitutionProvince == "") { ltCurrentProvince.Text = "-"; } else { ltCurrentProvince.Text = eduCurrentData.EduInstitutionProvince; } if (eduCurrentData.EduInstitutionDistrict == null || eduCurrentData.EduInstitutionDistrict == "") { ltCurrentDistrict.Text = "-"; } else { ltCurrentDistrict.Text = eduCurrentData.EduInstitutionDistrict; } if (eduCurrentData.EduInstitutionSubDistrict == null || eduCurrentData.EduInstitutionSubDistrict == "") { ltCurrentSubDistrict.Text = "-"; } else { ltCurrentSubDistrict.Text = eduCurrentData.EduInstitutionSubDistrict; } if (eduCurrentData.EduEnrollmentYear == null || eduCurrentData.EduEnrollmentYear == "") { ltCurrentEnrollment.Text = "-"; } else { ltCurrentEnrollment.Text = eduCurrentData.EduEnrollmentYear; }

L170

if (eduCurrentData.EduGraduateYear == null || eduCurrentData.EduGraduateYear == "") { ltCurrentGraduate.Text = "-"; } else { ltCurrentGraduate.Text = eduCurrentData.EduGraduateYear; } if (eduCurrentData.EduAvgScore == null || eduCurrentData.EduAvgScore == "") { ltCurrentGPA.Text = "-"; } else { ltCurrentGPA.Text = eduCurrentData.EduAvgScore; } if (eduCurrentData.EduMinScale == null || eduCurrentData.EduMinScale == "") { ltCurrentMinGPA.Text = "-"; } else { ltCurrentMinGPA.Text = eduCurrentData.EduMinScale; } if (eduCurrentData.EduMaxScale == null || eduCurrentData.EduMaxScale == "") { ltCurrentMaxGPA.Text = "-"; } else { ltCurrentMaxGPA.Text = eduCurrentData.EduMaxScale; } LinkButton lnkSubmit = (LinkButton)e.Item.FindControl("lnkSubmit"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); pnlError.Visible = false; pnlSuccess.Visible = false; litBinusianId.Text = eduData.BinusianId; litDate.Text = eduData.DateIn.ToString("dd MMMM yyyy").Trim(); litName.Text = eduData.NamaNonGelar; lnkSubmit.CommandName = "Submit"; lnkSubmit.CommandArgument = eduData.BinusianId; lnkSubmit.Attributes.Add("onclick", "return confirm('Are You Sure Want To Submit This Data');"); } } protected void rptPersonalApp_ItemCommand(object sender, RepeaterCommandEventArgs e) { Literal litError = (Literal)e.Item.FindControl("litError"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); HiddenField hdfCollegeId = (HiddenField)e.Item.FindControl("hdfCollegeId"); if (e.CommandName == "Submit")

L171

{ pnlSuccess.Visible = false; pnlError.Visible = false; RadioButton rdApprove = (RadioButton)e.Item.FindControl("rdApprove"); RadioButton rdDeny = (RadioButton)e.Item.FindControl("rdDeny"); TextBox txtComment = (TextBox)e.Item.FindControl("txtComment"); if (rdDeny.Checked == false && rdApprove.Checked == false) { pnlError.Visible = true; litError.Text = "You Must Choose The Approval Type (Yes / No)."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() == "") { pnlError.Visible = true; litError.Text = "You Must Fill The Comment Field."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() != "") { bool success = new EducationSystem().InsertUpdateApprovalEducation(litBinusianId.Text.Trim(), Convert.ToInt32(hdfCollegeId.Value), 2, binusianid, txtComment.Text.Trim()); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } if (rdApprove.Checked == true) { bool success = new EducationSystem().InsertUpdateApprovalEducation(litBinusianId.Text.Trim(), Convert.ToInt32(hdfCollegeId.Value), 1, binusianid, ""); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } } } protected void btnSearch_Click(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlSearch_SelectedIndexChanged(object sender, EventArgs e) { } protected void ddlOrder_SelectedIndexChanged(object sender, EventArgs e) { FillPaging();

L172

ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlOrderType_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } } }

• EducationApprovalStaff.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using UserManagement.CrossCutting.OptMgmt; using UserManagement.Bussiness.AppFacade; using UserManagement.Business.Entities; using CrossCutting.Security; using CrossCutting.OptMgmt; namespace BMv3Home_BackEnd.Education { public partial class EducationAppStaff : SecurePage { private static string binusianid; #region privilege private Int32 _moduleId; public Int32 ModuleId { get { return _moduleId; } set { _moduleId = value; } } private string _loginId; public string LoginId { get { return _loginId; } set { _loginId = value; } } private string _viewAccess; public string ViewAccess { get { return _viewAccess; } set { _viewAccess = value; } } private string _addAccess; public string AddAccess { get { return _addAccess; } set { _addAccess = value; } } private string _editAccess;

L173

public string EditAccess { get { return _editAccess; } set { _editAccess = value; } } private string _deleteAccess; public string DeleteAccess { get { return _deleteAccess; } set { _deleteAccess = value; } } private string _printAccess; public string PrintAccess { get { return _printAccess; } set { _printAccess = value; } } private string _sendAccess; public string SendAccess { get { return _sendAccess; } set { _sendAccess = value; } } private string _uploadAccess; public string UploadAccess { get { return _uploadAccess; } set { _uploadAccess = value; } } private string _dowloadAccess; public string DowloadAccess { get { return _dowloadAccess; } set { _dowloadAccess = value; } } #endregion #region loadPrivilegeData public void LoadAccess() { string accessidlogin = new AccessModuleSystem().getAccesIDGrouporUser(1, LoginId); List<ModuleData> moduleNowData = new ModuleSystem().GetDetailModuleAccessData(new WebConfiguration().AreaId, new WebConfiguration().GAId, new WebConfiguration().AppId, ModuleId, accessidlogin); List<PriviledgeData> allAccessAvailable = new AccessModuleSystem().LoadPriviledge(); List<AccessModuleData> userAccessData = new PriviledgeBMv3().LoadAccess(Convert.ToInt32(moduleNowData[0].Priviledge.ToString().Trim()), allAccessAvailable); foreach (AccessModuleData userAccessDataDetail in userAccessData) { if (userAccessDataDetail.AllowPrivilegeName == "View" && userAccessDataDetail.AllowAccess == 0) { ViewAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Add" && userAccessDataDetail.AllowAccess == 0) { AddAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Edit" && userAccessDataDetail.AllowAccess == 0) {

L174

EditAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Delete" && userAccessDataDetail.AllowAccess == 0) { DeleteAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Print" && userAccessDataDetail.AllowAccess == 0) { PrintAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Send" && userAccessDataDetail.AllowAccess == 0) { SendAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Upload" && userAccessDataDetail.AllowAccess == 0) { UploadAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Download" && userAccessDataDetail.AllowAccess == 0) { DowloadAccess = "false"; } } } #endregion #region loadpage public void LoadPage() { #region set privilege ViewAccess = "true"; AddAccess = "true"; EditAccess = "true"; DeleteAccess = "true"; PrintAccess = "true"; SendAccess = "true"; UploadAccess = "true"; DowloadAccess = "true"; #endregion string tmpModuleId = ""; tmpModuleId = HttpUtility.HtmlDecode(Rijndael.Decrypt(Request.QueryString["mid"].ToString().Trim(), WebConfiguration.EncryptionKey)); try { ModuleId = Convert.ToInt32(tmpModuleId); } catch (Exception ex) { ModuleId = 0; } if (Session["uid"] != null) { LoginId = Session["uid"].ToString(); } } #endregion

L175

#region ViewState protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } } #endregion protected void ShowData() { List<EducationData> dataSetSource = new List<EducationData>(); dataSetSource = new EducationSystem().getListEducationApp(ddlOrder.SelectedItem.Value.Trim(), ddlOrderType.SelectedItem.Value.Trim(), ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), SystemConfiguration.PagingSumPerPage, CurrPage, 3); if (dataSetSource.Count == 0) { rptPersonalApp.Visible = false; ucPagingControl.Visible = false; litNoData.Visible = true; } else { litNoData.Visible = false; rptPersonalApp.Visible = true; ucPagingControl.Visible = true; rptPersonalApp.DataSource = dataSetSource; rptPersonalApp.DataBind(); } } #region Paging private void FillPaging() { int countPage = new EducationSystem().getListEducationAppCount(ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), 3); litTotalRequest.Text = countPage.ToString().Trim(); int sumPage = 1; if (countPage % SystemConfiguration.PagingSumPerPage == 0) { sumPage = countPage / SystemConfiguration.PagingSumPerPage; } else

L176

{ sumPage = countPage / SystemConfiguration.PagingSumPerPage + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); } #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData _binusianData = (BinusianData)Session["UserData"]; binusianid = _binusianData.BinusianId.Trim(); } LoadPage(); LoadAccess();

L177

ddlOrder.Items.Add(new ListItem("Date", "TrPendidikanTinggiApproval.DateIn")); ddlOrder.Items.Add(new ListItem("Binusian Id", "TrPendidikanTinggiApproval.binusianid")); ddlOrder.Items.Add(new ListItem("Name", "NamaNonGelar")); ddlSearch.Items.Add(new ListItem("Binusian Id", "TrPendidikanTinggiApproval.binusianid")); ddlSearch.Items.Add(new ListItem("Name", "NamaNonGelar")); SaveViewStates(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; FillPaging(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; ShowData(); } else { ucPagingControl.DataBind(); } } protected void rptPersonalApp_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { EducationData eduData = (EducationData)e.Item.DataItem; Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); Literal litName = (Literal)e.Item.FindControl("litName"); Literal litDate = (Literal)e.Item.FindControl("litDate"); Literal ltNewDegree = (Literal)e.Item.FindControl("ltNewDegree"); Literal ltNewMajor = (Literal)e.Item.FindControl("ltNewMajor"); Literal ltNewInstitution = (Literal)e.Item.FindControl("ltNewInstitution"); Literal ltNewStudentID = (Literal)e.Item.FindControl("ltNewStudentID"); Literal ltNewAddress = (Literal)e.Item.FindControl("ltNewAddress"); Literal ltNewCountry = (Literal)e.Item.FindControl("ltNewCountry"); Literal ltNewProvince = (Literal)e.Item.FindControl("ltNewProvince"); Literal ltNewDistrict = (Literal)e.Item.FindControl("ltNewDistrict"); Literal ltNewSubDistrict = (Literal)e.Item.FindControl("ltNewSubDistrict"); Literal ltNewEnrollment = (Literal)e.Item.FindControl("ltNewEnrollment"); Literal ltNewGraduate = (Literal)e.Item.FindControl("ltNewGraduate"); Literal ltNewGPA = (Literal)e.Item.FindControl("ltNewGPA"); Literal ltNewMinGPA = (Literal)e.Item.FindControl("ltNewMinGPA"); Literal ltNewMaxGPA = (Literal)e.Item.FindControl("ltNewMaxGPA"); HiddenField hdfCollegeId = (HiddenField)e.Item.FindControl("hdfCollegeId"); hdfCollegeId.Value = eduData.EduCollegeId; if (eduData.EduDegree == null || eduData.EduDegree == "") { ltNewDegree.Text = "-"; } else { ltNewDegree.Text = eduData.EduDegree; } if (eduData.EduStudyProgram == null || eduData.EduStudyProgram == "") {

L178

ltNewMajor.Text = "-"; } else { ltNewMajor.Text = eduData.EduStudyProgram; } if (eduData.EduInstitution == null || eduData.EduInstitution == "") { ltNewInstitution.Text = "-"; } else { ltNewInstitution.Text = eduData.EduInstitution; } if (eduData.EduStudentId == null || eduData.EduStudentId == "") { ltNewStudentID.Text = "-"; } else { ltNewStudentID.Text = eduData.EduStudentId; } if (eduData.EduInstitutionAddress == null || eduData.EduInstitutionAddress == "") { ltNewAddress.Text = "-"; } else { ltNewAddress.Text = eduData.EduInstitutionAddress; } if (eduData.EduInstitutionCountry == null || eduData.EduInstitutionCountry == "") { ltNewCountry.Text = "-"; } else { ltNewCountry.Text = eduData.EduInstitutionCountry; } if (eduData.EduInstitutionProvince == null || eduData.EduInstitutionProvince == "") { ltNewProvince.Text = "-"; } else { ltNewProvince.Text = eduData.EduInstitutionProvince; } if (eduData.EduInstitutionDistrict == null || eduData.EduInstitutionDistrict == "") { ltNewDistrict.Text = "-"; } else { ltNewDistrict.Text = eduData.EduInstitutionDistrict; } if (eduData.EduInstitutionSubDistrict == null || eduData.EduInstitutionSubDistrict == "") { ltNewSubDistrict.Text = "-"; } else

L179

{ ltNewSubDistrict.Text = eduData.EduInstitutionSubDistrict; } if (eduData.EduEnrollmentYear == null || eduData.EduEnrollmentYear == "") { ltNewEnrollment.Text = "-"; } else { ltNewEnrollment.Text = eduData.EduEnrollmentYear; } if (eduData.EduGraduateYear == null || eduData.EduGraduateYear == "") { ltNewGraduate.Text = "-"; } else { ltNewGraduate.Text = eduData.EduGraduateYear; } if (eduData.EduAvgScore == null || eduData.EduAvgScore == "") { ltNewGPA.Text = "-"; } else { ltNewGPA.Text = eduData.EduAvgScore; } if (eduData.EduMinScale == null || eduData.EduMinScale == "") { ltNewMinGPA.Text = "-"; } else { ltNewMinGPA.Text = eduData.EduMinScale; } if (eduData.EduMaxScale == null || eduData.EduMaxScale == "") { ltNewMaxGPA.Text = "-"; } else { ltNewMaxGPA.Text = eduData.EduMaxScale; } Literal ltCurrentDegree = (Literal)e.Item.FindControl("ltCurrentDegree"); Literal ltCurrentMajor = (Literal)e.Item.FindControl("ltCurrentMajor"); Literal ltCurrentInstitution = (Literal)e.Item.FindControl("ltCurrentInstitution"); Literal ltCurrentStudentID = (Literal)e.Item.FindControl("ltCurrentStudentID"); Literal ltCurrentAddress = (Literal)e.Item.FindControl("ltCurrentAddress"); Literal ltCurrentCountry = (Literal)e.Item.FindControl("ltCurrentCountry"); Literal ltCurrentProvince = (Literal)e.Item.FindControl("ltCurrentProvince"); Literal ltCurrentDistrict = (Literal)e.Item.FindControl("ltCurrentDistrict"); Literal ltCurrentSubDistrict = (Literal)e.Item.FindControl("ltCurrentSubDistrict"); Literal ltCurrentEnrollment = (Literal)e.Item.FindControl("ltCurrentEnrollment"); Literal ltCurrentGraduate = (Literal)e.Item.FindControl("ltCurrentGraduate"); Literal ltCurrentGPA = (Literal)e.Item.FindControl("ltCurrentGPA"); Literal ltCurrentMinGPA = (Literal)e.Item.FindControl("ltCurrentMinGPA");

L180

Literal ltCurrentMaxGPA = (Literal)e.Item.FindControl("ltCurrentMaxGPA"); EducationData eduCurrentData = new EducationSystem().GetEducationDetailCollegeById(eduData.BinusianId, Convert.ToInt32(eduData.EduCollegeId)); if (eduCurrentData.EduDegree == null || eduCurrentData.EduDegree == "") { ltCurrentDegree.Text = "-"; } else { ltCurrentDegree.Text = eduCurrentData.EduDegree; } if (eduCurrentData.EduStudyProgram == null || eduCurrentData.EduStudyProgram == "") { ltCurrentMajor.Text = "-"; } else { ltCurrentMajor.Text = eduCurrentData.EduStudyProgram; } if (eduCurrentData.EduInstitution == null || eduCurrentData.EduInstitution == "") { ltCurrentInstitution.Text = "-"; } else { ltCurrentInstitution.Text = eduCurrentData.EduInstitution; } if (eduCurrentData.EduStudentId == null || eduCurrentData.EduStudentId == "") { ltCurrentStudentID.Text = "-"; } else { ltCurrentStudentID.Text = eduCurrentData.EduStudentId; } if (eduCurrentData.EduInstitutionAddress == null || eduCurrentData.EduInstitutionAddress == "") { ltCurrentAddress.Text = "-"; } else { ltCurrentAddress.Text = eduCurrentData.EduInstitutionAddress; } if (eduCurrentData.EduInstitutionCountry == null || eduCurrentData.EduInstitutionCountry == "") { ltCurrentCountry.Text = "-"; } else { ltCurrentCountry.Text = eduCurrentData.EduInstitutionCountry; } if (eduCurrentData.EduInstitutionProvince == null || eduCurrentData.EduInstitutionProvince == "") { ltCurrentProvince.Text = "-"; } else {

L181

ltCurrentProvince.Text = eduCurrentData.EduInstitutionProvince; } if (eduCurrentData.EduInstitutionDistrict == null || eduCurrentData.EduInstitutionDistrict == "") { ltCurrentDistrict.Text = "-"; } else { ltCurrentDistrict.Text = eduCurrentData.EduInstitutionDistrict; } if (eduCurrentData.EduInstitutionSubDistrict == null || eduCurrentData.EduInstitutionSubDistrict == "") { ltCurrentSubDistrict.Text = "-"; } else { ltCurrentSubDistrict.Text = eduCurrentData.EduInstitutionSubDistrict; } if (eduCurrentData.EduEnrollmentYear == null || eduCurrentData.EduEnrollmentYear == "") { ltCurrentEnrollment.Text = "-"; } else { ltCurrentEnrollment.Text = eduCurrentData.EduEnrollmentYear; } if (eduCurrentData.EduGraduateYear == null || eduCurrentData.EduGraduateYear == "") { ltCurrentGraduate.Text = "-"; } else { ltCurrentGraduate.Text = eduCurrentData.EduGraduateYear; } if (eduCurrentData.EduAvgScore == null || eduCurrentData.EduAvgScore == "") { ltCurrentGPA.Text = "-"; } else { ltCurrentGPA.Text = eduCurrentData.EduAvgScore; } if (eduCurrentData.EduMinScale == null || eduCurrentData.EduMinScale == "") { ltCurrentMinGPA.Text = "-"; } else { ltCurrentMinGPA.Text = eduCurrentData.EduMinScale; } if (eduCurrentData.EduMaxScale == null || eduCurrentData.EduMaxScale == "") { ltCurrentMaxGPA.Text = "-"; } else { ltCurrentMaxGPA.Text = eduCurrentData.EduMaxScale;

L182

} LinkButton lnkSubmit = (LinkButton)e.Item.FindControl("lnkSubmit"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); pnlError.Visible = false; pnlSuccess.Visible = false; litBinusianId.Text = eduData.BinusianId; litDate.Text = eduData.DateIn.ToString("dd MMMM yyyy").Trim(); litName.Text = eduData.NamaNonGelar; lnkSubmit.CommandName = "Submit"; lnkSubmit.CommandArgument = eduData.BinusianId; lnkSubmit.Attributes.Add("onclick", "return confirm('Are You Sure Want To Submit This Data');"); } } protected void rptPersonalApp_ItemCommand(object sender, RepeaterCommandEventArgs e) { Literal litError = (Literal)e.Item.FindControl("litError"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); HiddenField hdfCollegeId = (HiddenField)e.Item.FindControl("hdfCollegeId"); if (e.CommandName == "Submit") { pnlSuccess.Visible = false; pnlError.Visible = false; RadioButton rdApprove = (RadioButton)e.Item.FindControl("rdApprove"); RadioButton rdDeny = (RadioButton)e.Item.FindControl("rdDeny"); TextBox txtComment = (TextBox)e.Item.FindControl("txtComment"); if (rdDeny.Checked == false && rdApprove.Checked == false) { pnlError.Visible = true; litError.Text = "You Must Choose The Approval Type (Yes / No)."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() == "") { pnlError.Visible = true; litError.Text = "You Must Fill The Comment Field."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() != "") { bool success = new EducationSystem().InsertUpdateApprovalEducation(litBinusianId.Text.Trim(), Convert.ToInt32(hdfCollegeId.Value), 2, binusianid, txtComment.Text.Trim()); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; }

L183

} if (rdApprove.Checked == true) { bool success = new EducationSystem().InsertUpdateApprovalEducation(litBinusianId.Text.Trim(), Convert.ToInt32(hdfCollegeId.Value), 1, binusianid, ""); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } } } protected void btnSearch_Click(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlSearch_SelectedIndexChanged(object sender, EventArgs e) { } protected void ddlOrder_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlOrderType_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } } }

• ApprovalFamilyStudent.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using UserManagement.CrossCutting.OptMgmt; using UserManagement.Bussiness.AppFacade; using UserManagement.Business.Entities; using CrossCutting.Security; using CrossCutting.OptMgmt; namespace BMv3Home_BackEnd.Family { public partial class FamilyAppStudent : SecurePage//System.Web.UI.Page {

L184

private static string binusianid; #region privilege private Int32 _moduleId; public Int32 ModuleId { get { return _moduleId; } set { _moduleId = value; } } private string _loginId; public string LoginId { get { return _loginId; } set { _loginId = value; } } private string _viewAccess; public string ViewAccess { get { return _viewAccess; } set { _viewAccess = value; } } private string _addAccess; public string AddAccess { get { return _addAccess; } set { _addAccess = value; } } private string _editAccess; public string EditAccess { get { return _editAccess; } set { _editAccess = value; } } private string _deleteAccess; public string DeleteAccess { get { return _deleteAccess; } set { _deleteAccess = value; } } private string _printAccess; public string PrintAccess { get { return _printAccess; } set { _printAccess = value; } } private string _sendAccess; public string SendAccess { get { return _sendAccess; } set { _sendAccess = value; } } private string _uploadAccess; public string UploadAccess { get { return _uploadAccess; } set { _uploadAccess = value; } } private string _dowloadAccess; public string DowloadAccess { get { return _dowloadAccess; }

L185

set { _dowloadAccess = value; } } #endregion #region loadPrivilegeData public void LoadAccess() { string accessidlogin = new AccessModuleSystem().getAccesIDGrouporUser(1, LoginId); List<ModuleData> moduleNowData = new ModuleSystem().GetDetailModuleAccessData(new WebConfiguration().AreaId, new WebConfiguration().GAId, new WebConfiguration().AppId, ModuleId, accessidlogin); List<PriviledgeData> allAccessAvailable = new AccessModuleSystem().LoadPriviledge(); List<AccessModuleData> userAccessData = new PriviledgeBMv3().LoadAccess(Convert.ToInt32(moduleNowData[0].Priviledge.ToString().Trim()), allAccessAvailable); foreach (AccessModuleData userAccessDataDetail in userAccessData) { if (userAccessDataDetail.AllowPrivilegeName == "View" && userAccessDataDetail.AllowAccess == 0) { ViewAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Add" && userAccessDataDetail.AllowAccess == 0) { AddAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Edit" && userAccessDataDetail.AllowAccess == 0) { EditAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Delete" && userAccessDataDetail.AllowAccess == 0) { DeleteAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Print" && userAccessDataDetail.AllowAccess == 0) { PrintAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Send" && userAccessDataDetail.AllowAccess == 0) { SendAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Upload" && userAccessDataDetail.AllowAccess == 0) { UploadAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Download" && userAccessDataDetail.AllowAccess == 0) { DowloadAccess = "false"; } } } #endregion #region loadpage public void LoadPage() { #region set privilege ViewAccess = "true";

L186

AddAccess = "true"; EditAccess = "true"; DeleteAccess = "true"; PrintAccess = "true"; SendAccess = "true"; UploadAccess = "true"; DowloadAccess = "true"; #endregion string tmpModuleId = ""; tmpModuleId = HttpUtility.HtmlDecode(Rijndael.Decrypt(Request.QueryString["mid"].ToString().Trim(), WebConfiguration.EncryptionKey)); try { ModuleId = Convert.ToInt32(tmpModuleId); } catch (Exception ex) { ModuleId = 0; } if (Session["uid"] != null) { LoginId = Session["uid"].ToString(); } } #endregion #region ViewState protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } } #endregion protected void ShowData() { List<FamilyData> dataSetSource = new List<FamilyData>(); dataSetSource = new FamilySystem().getListFamilyApp(ddlOrder.SelectedItem.Value.Trim(), ddlOrderType.SelectedItem.Value.Trim(), ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), SystemConfiguration.PagingSumPerPage, CurrPage, 1);

L187

if (dataSetSource.Count == 0) { rptPersonalApp.Visible = false; ucPagingControl.Visible = false; litNoData.Visible = true; } else { litNoData.Visible = false; rptPersonalApp.Visible = true; ucPagingControl.Visible = true; rptPersonalApp.DataSource = dataSetSource; rptPersonalApp.DataBind(); } } #region Paging private void FillPaging() { int countPage = new FamilySystem().getListFamilyAppCount(ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), 1); litTotalRequest.Text = countPage.ToString().Trim(); int sumPage = 1; if (countPage % SystemConfiguration.PagingSumPerPage == 0) { sumPage = countPage / SystemConfiguration.PagingSumPerPage; } else { sumPage = countPage / SystemConfiguration.PagingSumPerPage + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); } #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); }

L188

else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData _binusianData = (BinusianData)Session["UserData"]; binusianid = _binusianData.BinusianId.Trim(); } LoadPage(); LoadAccess(); ddlOrder.Items.Add(new ListItem("Date", "TrHubunganKeluargaApproval.DateIn")); ddlOrder.Items.Add(new ListItem("Binusian Id", "TrHubunganKeluargaApproval.binusianid")); ddlOrder.Items.Add(new ListItem("Name", "NamaNonGelar")); ddlSearch.Items.Add(new ListItem("Binusian Id", "TrHubunganKeluargaApproval.binusianid")); ddlSearch.Items.Add(new ListItem("Name", "NamaNonGelar")); SaveViewStates(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; FillPaging(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; ShowData(); } else { ucPagingControl.DataBind(); } } protected void rptPersonalApp_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { FamilyData familyData = (FamilyData)e.Item.DataItem; FamilyData famDetail = new FamilySystem().GetFamilyMemberBasicDetailFromApproval(familyData.BinusianId, familyData.IsBinusian, familyData.KodeKeluarga);

L189

FamilyData famDetailCurrent = new FamilySystem().GetFamilyMemberBasicDetail(familyData.BinusianId, familyData.IsBinusian, familyData.KodeKeluarga); Panel pnlFamilyNonBinusian = (Panel)e.Item.FindControl("pnlFamilyNonBinusian"); Literal ltCurrentRelation = (Literal)e.Item.FindControl("ltCurrentRelation"); Literal ltNewRelation = (Literal)e.Item.FindControl("ltNewRelation"); Literal ltCurrentName = (Literal)e.Item.FindControl("ltCurrentName"); Literal ltNewName = (Literal)e.Item.FindControl("ltNewName"); Literal ltCurrentPoB = (Literal)e.Item.FindControl("ltCurrentPoB"); Literal ltNewPoB = (Literal)e.Item.FindControl("ltNewPoB"); Literal ltCurrentDoB = (Literal)e.Item.FindControl("ltCurrentDoB"); Literal ltNewDoB = (Literal)e.Item.FindControl("ltNewDoB"); Literal ltCurrentGender = (Literal)e.Item.FindControl("ltCurrentGender"); Literal ltNewGender = (Literal)e.Item.FindControl("ltNewGender"); Literal ltCurrentStatus = (Literal)e.Item.FindControl("ltCurrentStatus"); Literal ltNewStatus = (Literal)e.Item.FindControl("ltNewStatus"); Literal ltCurrentTaxStatus = (Literal)e.Item.FindControl("ltCurrentTaxStatus"); Literal ltNewTaxStatus = (Literal)e.Item.FindControl("ltNewTaxStatus"); Literal ltCurrentEduDegree = (Literal)e.Item.FindControl("ltCurrentEduDegree"); Literal ltNewEduDegree = (Literal)e.Item.FindControl("ltNewEduDegree"); Literal ltCurrentWorkField = (Literal)e.Item.FindControl("ltCurrentWorkField"); Literal ltNewWorkField = (Literal)e.Item.FindControl("ltNewWorkField"); Panel pnlFamilyBinusian = (Panel)e.Item.FindControl("pnlFamilyBinusian"); Literal ltCurrentRelationBinusian = (Literal)e.Item.FindControl("ltCurrentRelationBinusian"); Literal ltNewRelationBinusian = (Literal)e.Item.FindControl("ltNewRelationBinusian"); if (familyData.IsBinusian == 1) { pnlFamilyNonBinusian.Visible = false; ltNewRelationBinusian.Text = familyData.Hubungan; ltCurrentRelationBinusian.Text = famDetailCurrent.Hubungan; } else { pnlFamilyBinusian.Visible = false; ltNewRelation.Text = familyData.Hubungan; ltNewName.Text = famDetail.NamaLengkap; ltNewPoB.Text = famDetail.TempatLahir; ltNewDoB.Text = DateTime.ParseExact(famDetail.TglLahir, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); //ltFamilyBasicInfoDoB.Text = famDetail.TglLahir; ltNewGender.Text = famDetail.JenisKelamin; if (famDetail.StatusHidup == null || famDetail.StatusHidup == "") { ltNewStatus.Text = "-"; } else { ltNewStatus.Text = famDetail.StatusHidup; } if (famDetail.StatusPajak == null || famDetail.StatusPajak == "") { ltNewTaxStatus.Text = "-"; } else { ltNewTaxStatus.Text = famDetail.StatusPajak; } if (famDetail.NamaJenjangPendidikan == null || famDetail.NamaJenjangPendidikan == "")

L190

{ ltNewEduDegree.Text = "-"; } else { ltNewEduDegree.Text = famDetail.NamaJenjangPendidikan; } if (famDetail.Bidang == null || famDetail.Bidang == "") { ltNewWorkField.Text = "-"; } else { ltNewWorkField.Text = famDetail.Bidang; } ltCurrentRelation.Text = famDetailCurrent.Hubungan; ltCurrentName.Text = famDetailCurrent.NamaLengkap; ltCurrentPoB.Text = famDetailCurrent.TempatLahir; if (famDetailCurrent.TglLahir == null) { ltCurrentDoB.Text = "-"; } else { ltCurrentDoB.Text = DateTime.ParseExact(famDetailCurrent.TglLahir, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } //ltFamilyBasicInfoDoB.Text = famDetailCurrent.TglLahir; ltCurrentGender.Text = famDetailCurrent.JenisKelamin; if (famDetailCurrent.StatusHidup == null || famDetailCurrent.StatusHidup == "") { ltCurrentStatus.Text = "-"; } else { ltCurrentStatus.Text = famDetailCurrent.StatusHidup; } if (famDetailCurrent.StatusPajak == null || famDetailCurrent.StatusPajak == "") { ltCurrentTaxStatus.Text = "-"; } else { ltCurrentTaxStatus.Text = famDetailCurrent.StatusPajak; } if (famDetailCurrent.NamaJenjangPendidikan == null || famDetailCurrent.NamaJenjangPendidikan == "") { ltCurrentEduDegree.Text = "-"; } else { ltCurrentEduDegree.Text = famDetailCurrent.NamaJenjangPendidikan; } if (famDetailCurrent.Bidang == null || famDetailCurrent.Bidang == "") { ltCurrentWorkField.Text = "-"; } else { ltCurrentWorkField.Text = famDetailCurrent.Bidang; } }

L191

LinkButton lnkSubmit = (LinkButton)e.Item.FindControl("lnkSubmit"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); HiddenField hdfKodeluarga = (HiddenField)e.Item.FindControl("hdfKodeluarga"); pnlError.Visible = false; pnlSuccess.Visible = false; Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); Literal litName = (Literal)e.Item.FindControl("litName"); Literal litDate = (Literal)e.Item.FindControl("litDate"); litBinusianId.Text = familyData.BinusianId; litDate.Text = familyData.DateIn.ToString("dd MMMM yyyy").Trim(); litName.Text = familyData.Namanongelar; hdfKodeluarga.Value = familyData.KodeKeluarga; lnkSubmit.CommandName = "Submit"; lnkSubmit.CommandArgument = familyData.BinusianId; lnkSubmit.Attributes.Add("onclick", "return confirm('Are You Sure Want To Submit This Data');"); } } protected void rptPersonalApp_ItemCommand(object sender, RepeaterCommandEventArgs e) { Literal litError = (Literal)e.Item.FindControl("litError"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); HiddenField hdfKodeluarga = (HiddenField)e.Item.FindControl("hdfKodeluarga"); if (e.CommandName == "Submit") { pnlSuccess.Visible = false; pnlError.Visible = false; RadioButton rdApprove = (RadioButton)e.Item.FindControl("rdApprove"); RadioButton rdDeny = (RadioButton)e.Item.FindControl("rdDeny"); TextBox txtComment = (TextBox)e.Item.FindControl("txtComment"); if (rdDeny.Checked == false && rdApprove.Checked == false) { pnlError.Visible = true; litError.Text = "You Must Choose The Approval Type (Yes / No)."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() == "") { pnlError.Visible = true; litError.Text = "You Must Fill The Comment Field."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() != "") { bool success = new FamilySystem().InsertUpdateApprovalFamily(litBinusianId.Text.Trim(), Convert.ToString(hdfKodeluarga.Value), 2, binusianid, txtComment.Text.Trim()); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage;

L192

ShowData(); pnlSuccess.Visible = true; } } if (rdApprove.Checked == true) { bool success = new FamilySystem().InsertUpdateApprovalFamily(litBinusianId.Text.Trim(), Convert.ToString(hdfKodeluarga.Value), 1, binusianid, ""); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } } } protected void btnSearch_Click(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlSearch_SelectedIndexChanged(object sender, EventArgs e) { } protected void ddlOrder_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlOrderType_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } } }

• ApprovalFamilyLecturer.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using UserManagement.CrossCutting.OptMgmt; using UserManagement.Bussiness.AppFacade; using UserManagement.Business.Entities; using CrossCutting.Security; using CrossCutting.OptMgmt; namespace BMv3Home_BackEnd.Family

L193

{ public partial class FamilyAppLecturer :SecurePage// System.Web.UI.Page { private static string binusianid; #region privilege private Int32 _moduleId; public Int32 ModuleId { get { return _moduleId; } set { _moduleId = value; } } private string _loginId; public string LoginId { get { return _loginId; } set { _loginId = value; } } private string _viewAccess; public string ViewAccess { get { return _viewAccess; } set { _viewAccess = value; } } private string _addAccess; public string AddAccess { get { return _addAccess; } set { _addAccess = value; } } private string _editAccess; public string EditAccess { get { return _editAccess; } set { _editAccess = value; } } private string _deleteAccess; public string DeleteAccess { get { return _deleteAccess; } set { _deleteAccess = value; } } private string _printAccess; public string PrintAccess { get { return _printAccess; } set { _printAccess = value; } } private string _sendAccess; public string SendAccess { get { return _sendAccess; } set { _sendAccess = value; } } private string _uploadAccess; public string UploadAccess { get { return _uploadAccess; } set { _uploadAccess = value; } } private string _dowloadAccess;

L194

public string DowloadAccess { get { return _dowloadAccess; } set { _dowloadAccess = value; } } #endregion #region loadPrivilegeData public void LoadAccess() { string accessidlogin = new AccessModuleSystem().getAccesIDGrouporUser(1, LoginId); List<ModuleData> moduleNowData = new ModuleSystem().GetDetailModuleAccessData(new WebConfiguration().AreaId, new WebConfiguration().GAId, new WebConfiguration().AppId, ModuleId, accessidlogin); List<PriviledgeData> allAccessAvailable = new AccessModuleSystem().LoadPriviledge(); List<AccessModuleData> userAccessData = new PriviledgeBMv3().LoadAccess(Convert.ToInt32(moduleNowData[0].Priviledge.ToString().Trim()), allAccessAvailable); foreach (AccessModuleData userAccessDataDetail in userAccessData) { if (userAccessDataDetail.AllowPrivilegeName == "View" && userAccessDataDetail.AllowAccess == 0) { ViewAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Add" && userAccessDataDetail.AllowAccess == 0) { AddAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Edit" && userAccessDataDetail.AllowAccess == 0) { EditAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Delete" && userAccessDataDetail.AllowAccess == 0) { DeleteAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Print" && userAccessDataDetail.AllowAccess == 0) { PrintAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Send" && userAccessDataDetail.AllowAccess == 0) { SendAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Upload" && userAccessDataDetail.AllowAccess == 0) { UploadAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Download" && userAccessDataDetail.AllowAccess == 0) { DowloadAccess = "false"; } } } #endregion #region loadpage public void LoadPage()

L195

{ #region set privilege ViewAccess = "true"; AddAccess = "true"; EditAccess = "true"; DeleteAccess = "true"; PrintAccess = "true"; SendAccess = "true"; UploadAccess = "true"; DowloadAccess = "true"; #endregion string tmpModuleId = ""; tmpModuleId = HttpUtility.HtmlDecode(Rijndael.Decrypt(Request.QueryString["mid"].ToString().Trim(), WebConfiguration.EncryptionKey)); try { ModuleId = Convert.ToInt32(tmpModuleId); } catch (Exception ex) { ModuleId = 0; } if (Session["uid"] != null) { LoginId = Session["uid"].ToString(); } } #endregion #region ViewState protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } } #endregion protected void ShowData() { List<FamilyData> dataSetSource = new List<FamilyData>();

L196

dataSetSource = new FamilySystem().getListFamilyApp(ddlOrder.SelectedItem.Value.Trim(), ddlOrderType.SelectedItem.Value.Trim(), ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), SystemConfiguration.PagingSumPerPage, CurrPage, 2); if (dataSetSource.Count == 0) { rptPersonalApp.Visible = false; ucPagingControl.Visible = false; litNoData.Visible = true; } else { litNoData.Visible = false; rptPersonalApp.Visible = true; ucPagingControl.Visible = true; rptPersonalApp.DataSource = dataSetSource; rptPersonalApp.DataBind(); } } #region Paging private void FillPaging() { int countPage = new FamilySystem().getListFamilyAppCount(ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), 2); litTotalRequest.Text = countPage.ToString().Trim(); int sumPage = 1; if (countPage % SystemConfiguration.PagingSumPerPage == 0) { sumPage = countPage / SystemConfiguration.PagingSumPerPage; } else { sumPage = countPage / SystemConfiguration.PagingSumPerPage + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); } #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) {

L197

// ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData _binusianData = (BinusianData)Session["UserData"]; binusianid = _binusianData.BinusianId.Trim(); } LoadPage(); LoadAccess(); ddlOrder.Items.Add(new ListItem("Date", "TrHubunganKeluargaApproval.DateIn")); ddlOrder.Items.Add(new ListItem("Binusian Id", "TrHubunganKeluargaApproval.binusianid")); ddlOrder.Items.Add(new ListItem("Name", "NamaNonGelar")); ddlSearch.Items.Add(new ListItem("Binusian Id", "TrHubunganKeluargaApproval.binusianid")); ddlSearch.Items.Add(new ListItem("Name", "NamaNonGelar")); SaveViewStates(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; FillPaging(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; ShowData(); } else { ucPagingControl.DataBind(); } } protected void rptPersonalApp_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { FamilyData familyData = (FamilyData)e.Item.DataItem;

L198

FamilyData famDetail = new FamilySystem().GetFamilyMemberBasicDetailFromApproval(familyData.BinusianId, familyData.IsBinusian, familyData.KodeKeluarga); FamilyData famDetailCurrent = new FamilySystem().GetFamilyMemberBasicDetail(familyData.BinusianId, familyData.IsBinusian, familyData.KodeKeluarga); Panel pnlFamilyNonBinusian = (Panel)e.Item.FindControl("pnlFamilyNonBinusian"); Literal ltCurrentRelation = (Literal)e.Item.FindControl("ltCurrentRelation"); Literal ltNewRelation = (Literal)e.Item.FindControl("ltNewRelation"); Literal ltCurrentName = (Literal)e.Item.FindControl("ltCurrentName"); Literal ltNewName = (Literal)e.Item.FindControl("ltNewName"); Literal ltCurrentPoB = (Literal)e.Item.FindControl("ltCurrentPoB"); Literal ltNewPoB = (Literal)e.Item.FindControl("ltNewPoB"); Literal ltCurrentDoB = (Literal)e.Item.FindControl("ltCurrentDoB"); Literal ltNewDoB = (Literal)e.Item.FindControl("ltNewDoB"); Literal ltCurrentGender = (Literal)e.Item.FindControl("ltCurrentGender"); Literal ltNewGender = (Literal)e.Item.FindControl("ltNewGender"); Literal ltCurrentStatus = (Literal)e.Item.FindControl("ltCurrentStatus"); Literal ltNewStatus = (Literal)e.Item.FindControl("ltNewStatus"); Literal ltCurrentTaxStatus = (Literal)e.Item.FindControl("ltCurrentTaxStatus"); Literal ltNewTaxStatus = (Literal)e.Item.FindControl("ltNewTaxStatus"); Literal ltCurrentEduDegree = (Literal)e.Item.FindControl("ltCurrentEduDegree"); Literal ltNewEduDegree = (Literal)e.Item.FindControl("ltNewEduDegree"); Literal ltCurrentWorkField = (Literal)e.Item.FindControl("ltCurrentWorkField"); Literal ltNewWorkField = (Literal)e.Item.FindControl("ltNewWorkField"); Panel pnlFamilyBinusian = (Panel)e.Item.FindControl("pnlFamilyBinusian"); Literal ltCurrentRelationBinusian = (Literal)e.Item.FindControl("ltCurrentRelationBinusian"); Literal ltNewRelationBinusian = (Literal)e.Item.FindControl("ltNewRelationBinusian"); if (familyData.IsBinusian == 1) { pnlFamilyNonBinusian.Visible = false; ltNewRelationBinusian.Text = familyData.Hubungan; ltCurrentRelationBinusian.Text = famDetailCurrent.Hubungan; } else { pnlFamilyBinusian.Visible = false; ltNewRelation.Text = familyData.Hubungan; ltNewName.Text = famDetail.NamaLengkap; ltNewPoB.Text = famDetail.TempatLahir; ltNewDoB.Text = DateTime.ParseExact(famDetail.TglLahir, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); //ltFamilyBasicInfoDoB.Text = famDetail.TglLahir; ltNewGender.Text = famDetail.JenisKelamin; if (famDetail.StatusHidup == null || famDetail.StatusHidup == "") { ltNewStatus.Text = "-"; } else { ltNewStatus.Text = famDetail.StatusHidup; } if (famDetail.StatusPajak == null || famDetail.StatusPajak == "") { ltNewTaxStatus.Text = "-"; } else { ltNewTaxStatus.Text = famDetail.StatusPajak; }

L199

if (famDetail.NamaJenjangPendidikan == null || famDetail.NamaJenjangPendidikan == "") { ltNewEduDegree.Text = "-"; } else { ltNewEduDegree.Text = famDetail.NamaJenjangPendidikan; } if (famDetail.Bidang == null || famDetail.Bidang == "") { ltNewWorkField.Text = "-"; } else { ltNewWorkField.Text = famDetail.Bidang; } ltCurrentRelation.Text = famDetailCurrent.Hubungan; ltCurrentName.Text = famDetailCurrent.NamaLengkap; ltCurrentPoB.Text = famDetailCurrent.TempatLahir; if (famDetailCurrent.TglLahir == null) { ltCurrentDoB.Text = "-"; } else { ltCurrentDoB.Text = DateTime.ParseExact(famDetailCurrent.TglLahir, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } //ltFamilyBasicInfoDoB.Text = famDetailCurrent.TglLahir; ltCurrentGender.Text = famDetailCurrent.JenisKelamin; if (famDetailCurrent.StatusHidup == null || famDetailCurrent.StatusHidup == "") { ltCurrentStatus.Text = "-"; } else { ltCurrentStatus.Text = famDetailCurrent.StatusHidup; } if (famDetailCurrent.StatusPajak == null || famDetailCurrent.StatusPajak == "") { ltCurrentTaxStatus.Text = "-"; } else { ltCurrentTaxStatus.Text = famDetailCurrent.StatusPajak; } if (famDetailCurrent.NamaJenjangPendidikan == null || famDetailCurrent.NamaJenjangPendidikan == "") { ltCurrentEduDegree.Text = "-"; } else { ltCurrentEduDegree.Text = famDetailCurrent.NamaJenjangPendidikan; } if (famDetailCurrent.Bidang == null || famDetailCurrent.Bidang == "") { ltCurrentWorkField.Text = "-";

L200

} else { ltCurrentWorkField.Text = famDetailCurrent.Bidang; } } LinkButton lnkSubmit = (LinkButton)e.Item.FindControl("lnkSubmit"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); HiddenField hdfKodeluarga = (HiddenField)e.Item.FindControl("hdfKodeluarga"); pnlError.Visible = false; pnlSuccess.Visible = false; Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); Literal litName = (Literal)e.Item.FindControl("litName"); Literal litDate = (Literal)e.Item.FindControl("litDate"); litBinusianId.Text = familyData.BinusianId; litDate.Text = familyData.DateIn.ToString("dd MMMM yyyy").Trim(); litName.Text = familyData.Namanongelar; hdfKodeluarga.Value = familyData.KodeKeluarga; lnkSubmit.CommandName = "Submit"; lnkSubmit.CommandArgument = familyData.BinusianId; lnkSubmit.Attributes.Add("onclick", "return confirm('Are You Sure Want To Submit This Data');"); } } protected void rptPersonalApp_ItemCommand(object sender, RepeaterCommandEventArgs e) { Literal litError = (Literal)e.Item.FindControl("litError"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); HiddenField hdfKodeluarga = (HiddenField)e.Item.FindControl("hdfKodeluarga"); if (e.CommandName == "Submit") { pnlSuccess.Visible = false; pnlError.Visible = false; RadioButton rdApprove = (RadioButton)e.Item.FindControl("rdApprove"); RadioButton rdDeny = (RadioButton)e.Item.FindControl("rdDeny"); TextBox txtComment = (TextBox)e.Item.FindControl("txtComment"); if (rdDeny.Checked == false && rdApprove.Checked == false) { pnlError.Visible = true; litError.Text = "You Must Choose The Approval Type (Yes / No)."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() == "") { pnlError.Visible = true; litError.Text = "You Must Fill The Comment Field."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() != "") {

L201

bool success = new FamilySystem().InsertUpdateApprovalFamily(litBinusianId.Text.Trim(), Convert.ToString(hdfKodeluarga.Value), 2, binusianid, txtComment.Text.Trim()); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } if (rdApprove.Checked == true) { bool success = new FamilySystem().InsertUpdateApprovalFamily(litBinusianId.Text.Trim(), Convert.ToString(hdfKodeluarga.Value), 1, binusianid, ""); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } } } protected void btnSearch_Click(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlSearch_SelectedIndexChanged(object sender, EventArgs e) { } protected void ddlOrder_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlOrderType_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } } }

• ApprovalFamilyStaff.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using UserManagement.CrossCutting.OptMgmt;

L202

using UserManagement.Bussiness.AppFacade; using UserManagement.Business.Entities; using CrossCutting.Security; using CrossCutting.OptMgmt; namespace BMv3Home_BackEnd.Family { public partial class FamilyAppStaff : SecurePage//System.Web.UI.Page { private static string binusianid; #region privilege private Int32 _moduleId; public Int32 ModuleId { get { return _moduleId; } set { _moduleId = value; } } private string _loginId; public string LoginId { get { return _loginId; } set { _loginId = value; } } private string _viewAccess; public string ViewAccess { get { return _viewAccess; } set { _viewAccess = value; } } private string _addAccess; public string AddAccess { get { return _addAccess; } set { _addAccess = value; } } private string _editAccess; public string EditAccess { get { return _editAccess; } set { _editAccess = value; } } private string _deleteAccess; public string DeleteAccess { get { return _deleteAccess; } set { _deleteAccess = value; } } private string _printAccess; public string PrintAccess { get { return _printAccess; } set { _printAccess = value; } } private string _sendAccess; public string SendAccess { get { return _sendAccess; } set { _sendAccess = value; } } private string _uploadAccess;

L203

public string UploadAccess { get { return _uploadAccess; } set { _uploadAccess = value; } } private string _dowloadAccess; public string DowloadAccess { get { return _dowloadAccess; } set { _dowloadAccess = value; } } #endregion #region loadPrivilegeData public void LoadAccess() { string accessidlogin = new AccessModuleSystem().getAccesIDGrouporUser(1, LoginId); List<ModuleData> moduleNowData = new ModuleSystem().GetDetailModuleAccessData(new WebConfiguration().AreaId, new WebConfiguration().GAId, new WebConfiguration().AppId, ModuleId, accessidlogin); List<PriviledgeData> allAccessAvailable = new AccessModuleSystem().LoadPriviledge(); List<AccessModuleData> userAccessData = new PriviledgeBMv3().LoadAccess(Convert.ToInt32(moduleNowData[0].Priviledge.ToString().Trim()), allAccessAvailable); foreach (AccessModuleData userAccessDataDetail in userAccessData) { if (userAccessDataDetail.AllowPrivilegeName == "View" && userAccessDataDetail.AllowAccess == 0) { ViewAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Add" && userAccessDataDetail.AllowAccess == 0) { AddAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Edit" && userAccessDataDetail.AllowAccess == 0) { EditAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Delete" && userAccessDataDetail.AllowAccess == 0) { DeleteAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Print" && userAccessDataDetail.AllowAccess == 0) { PrintAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Send" && userAccessDataDetail.AllowAccess == 0) { SendAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Upload" && userAccessDataDetail.AllowAccess == 0) { UploadAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Download" && userAccessDataDetail.AllowAccess == 0) { DowloadAccess = "false"; }

L204

} } #endregion #region loadpage public void LoadPage() { #region set privilege ViewAccess = "true"; AddAccess = "true"; EditAccess = "true"; DeleteAccess = "true"; PrintAccess = "true"; SendAccess = "true"; UploadAccess = "true"; DowloadAccess = "true"; #endregion string tmpModuleId = ""; tmpModuleId = HttpUtility.HtmlDecode(Rijndael.Decrypt(Request.QueryString["mid"].ToString().Trim(), WebConfiguration.EncryptionKey)); try { ModuleId = Convert.ToInt32(tmpModuleId); } catch (Exception ex) { ModuleId = 0; } if (Session["uid"] != null) { LoginId = Session["uid"].ToString(); } } #endregion #region ViewState protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } }

L205

#endregion protected void ShowData() { List<FamilyData> dataSetSource = new List<FamilyData>(); dataSetSource = new FamilySystem().getListFamilyApp(ddlOrder.SelectedItem.Value.Trim(), ddlOrderType.SelectedItem.Value.Trim(), ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), SystemConfiguration.PagingSumPerPage, CurrPage,3); if (dataSetSource.Count == 0) { rptPersonalApp.Visible = false; ucPagingControl.Visible = false; litNoData.Visible = true; } else { litNoData.Visible = false; rptPersonalApp.Visible = true; ucPagingControl.Visible = true; rptPersonalApp.DataSource = dataSetSource; rptPersonalApp.DataBind(); } } #region Paging private void FillPaging() { int countPage = new FamilySystem().getListFamilyAppCount(ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), 3); litTotalRequest.Text = countPage.ToString().Trim(); int sumPage = 1; if (countPage % SystemConfiguration.PagingSumPerPage == 0) { sumPage = countPage / SystemConfiguration.PagingSumPerPage; } else { sumPage = countPage / SystemConfiguration.PagingSumPerPage + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); } #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString())

L206

{ ucPagingControl.CurrentPage = ucPagingControl.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData _binusianData = (BinusianData)Session["UserData"]; binusianid = _binusianData.BinusianId.Trim(); } LoadPage(); LoadAccess(); ddlOrder.Items.Add(new ListItem("Date", "TrHubunganKeluargaApproval.DateIn")); ddlOrder.Items.Add(new ListItem("Binusian Id", "TrHubunganKeluargaApproval.binusianid")); ddlOrder.Items.Add(new ListItem("Name", "NamaNonGelar")); ddlSearch.Items.Add(new ListItem("Binusian Id", "TrHubunganKeluargaApproval.binusianid")); ddlSearch.Items.Add(new ListItem("Name", "NamaNonGelar")); SaveViewStates(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; FillPaging(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; ShowData(); } else { ucPagingControl.DataBind(); } }

L207

protected void rptPersonalApp_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { FamilyData familyData = (FamilyData)e.Item.DataItem; FamilyData famDetail = new FamilySystem().GetFamilyMemberBasicDetailFromApproval(familyData.BinusianId, familyData.IsBinusian, familyData.KodeKeluarga); FamilyData famDetailCurrent = new FamilySystem().GetFamilyMemberBasicDetail(familyData.BinusianId, familyData.IsBinusian, familyData.KodeKeluarga); Panel pnlFamilyNonBinusian = (Panel)e.Item.FindControl("pnlFamilyNonBinusian"); Literal ltCurrentRelation = (Literal)e.Item.FindControl("ltCurrentRelation"); Literal ltNewRelation = (Literal)e.Item.FindControl("ltNewRelation"); Literal ltCurrentName = (Literal)e.Item.FindControl("ltCurrentName"); Literal ltNewName = (Literal)e.Item.FindControl("ltNewName"); Literal ltCurrentPoB = (Literal)e.Item.FindControl("ltCurrentPoB"); Literal ltNewPoB = (Literal)e.Item.FindControl("ltNewPoB"); Literal ltCurrentDoB = (Literal)e.Item.FindControl("ltCurrentDoB"); Literal ltNewDoB = (Literal)e.Item.FindControl("ltNewDoB"); Literal ltCurrentGender = (Literal)e.Item.FindControl("ltCurrentGender"); Literal ltNewGender = (Literal)e.Item.FindControl("ltNewGender"); Literal ltCurrentStatus = (Literal)e.Item.FindControl("ltCurrentStatus"); Literal ltNewStatus = (Literal)e.Item.FindControl("ltNewStatus"); Literal ltCurrentTaxStatus = (Literal)e.Item.FindControl("ltCurrentTaxStatus"); Literal ltNewTaxStatus = (Literal)e.Item.FindControl("ltNewTaxStatus"); Literal ltCurrentEduDegree = (Literal)e.Item.FindControl("ltCurrentEduDegree"); Literal ltNewEduDegree = (Literal)e.Item.FindControl("ltNewEduDegree"); Literal ltCurrentWorkField = (Literal)e.Item.FindControl("ltCurrentWorkField"); Literal ltNewWorkField = (Literal)e.Item.FindControl("ltNewWorkField"); Panel pnlFamilyBinusian = (Panel)e.Item.FindControl("pnlFamilyBinusian"); Literal ltCurrentRelationBinusian = (Literal)e.Item.FindControl("ltCurrentRelationBinusian"); Literal ltNewRelationBinusian = (Literal)e.Item.FindControl("ltNewRelationBinusian"); if (familyData.IsBinusian == 1) { pnlFamilyNonBinusian.Visible = false; ltNewRelationBinusian.Text = familyData.Hubungan; ltCurrentRelationBinusian.Text = famDetailCurrent.Hubungan; } else { pnlFamilyBinusian.Visible = false; ltNewRelation.Text = familyData.Hubungan; ltNewName.Text = famDetail.NamaLengkap; ltNewPoB.Text = famDetail.TempatLahir; ltNewDoB.Text = DateTime.ParseExact(famDetail.TglLahir, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); //ltFamilyBasicInfoDoB.Text = famDetail.TglLahir; ltNewGender.Text = famDetail.JenisKelamin; if (famDetail.StatusHidup == null || famDetail.StatusHidup == "") { ltNewStatus.Text = "-"; } else { ltNewStatus.Text = famDetail.StatusHidup; } if (famDetail.StatusPajak == null || famDetail.StatusPajak == "")

L208

{ ltNewTaxStatus.Text = "-"; } else { ltNewTaxStatus.Text = famDetail.StatusPajak; } if (famDetail.NamaJenjangPendidikan == null || famDetail.NamaJenjangPendidikan == "") { ltNewEduDegree.Text = "-"; } else { ltNewEduDegree.Text = famDetail.NamaJenjangPendidikan; } if (famDetail.Bidang == null || famDetail.Bidang == "") { ltNewWorkField.Text = "-"; } else { ltNewWorkField.Text = famDetail.Bidang; } ltCurrentRelation.Text = famDetailCurrent.Hubungan; ltCurrentName.Text = famDetailCurrent.NamaLengkap; ltCurrentPoB.Text = famDetailCurrent.TempatLahir; if (famDetailCurrent.TglLahir == null) { ltCurrentDoB.Text = "-"; } else { ltCurrentDoB.Text = DateTime.ParseExact(famDetailCurrent.TglLahir, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } //ltFamilyBasicInfoDoB.Text = famDetailCurrent.TglLahir; ltCurrentGender.Text = famDetailCurrent.JenisKelamin; if (famDetailCurrent.StatusHidup == null || famDetailCurrent.StatusHidup == "") { ltCurrentStatus.Text = "-"; } else { ltCurrentStatus.Text = famDetailCurrent.StatusHidup; } if (famDetailCurrent.StatusPajak == null || famDetailCurrent.StatusPajak == "") { ltCurrentTaxStatus.Text = "-"; } else { ltCurrentTaxStatus.Text = famDetailCurrent.StatusPajak; } if (famDetailCurrent.NamaJenjangPendidikan == null || famDetailCurrent.NamaJenjangPendidikan == "") { ltCurrentEduDegree.Text = "-"; } else { ltCurrentEduDegree.Text = famDetailCurrent.NamaJenjangPendidikan; }

L209

if (famDetailCurrent.Bidang == null || famDetailCurrent.Bidang == "") { ltCurrentWorkField.Text = "-"; } else { ltCurrentWorkField.Text = famDetailCurrent.Bidang; } } LinkButton lnkSubmit = (LinkButton)e.Item.FindControl("lnkSubmit"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); HiddenField hdfKodeluarga = (HiddenField)e.Item.FindControl("hdfKodeluarga"); pnlError.Visible = false; pnlSuccess.Visible = false; Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); Literal litName = (Literal)e.Item.FindControl("litName"); Literal litDate = (Literal)e.Item.FindControl("litDate"); litBinusianId.Text = familyData.BinusianId; litDate.Text = familyData.DateIn.ToString("dd MMMM yyyy").Trim(); litName.Text = familyData.Namanongelar; hdfKodeluarga.Value = familyData.KodeKeluarga; lnkSubmit.CommandName = "Submit"; lnkSubmit.CommandArgument = familyData.BinusianId; lnkSubmit.Attributes.Add("onclick", "return confirm('Are You Sure Want To Submit This Data');"); } } protected void rptPersonalApp_ItemCommand(object sender, RepeaterCommandEventArgs e) { Literal litError = (Literal)e.Item.FindControl("litError"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); HiddenField hdfKodeluarga = (HiddenField)e.Item.FindControl("hdfKodeluarga"); if (e.CommandName == "Submit") { pnlSuccess.Visible = false; pnlError.Visible = false; RadioButton rdApprove = (RadioButton)e.Item.FindControl("rdApprove"); RadioButton rdDeny = (RadioButton)e.Item.FindControl("rdDeny"); TextBox txtComment = (TextBox)e.Item.FindControl("txtComment"); if (rdDeny.Checked == false && rdApprove.Checked == false) { pnlError.Visible = true; litError.Text = "You Must Choose The Approval Type (Yes / No)."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() == "") { pnlError.Visible = true; litError.Text = "You Must Fill The Comment Field."; litError.Visible = true; return; }

L210

if (rdDeny.Checked == true && txtComment.Text.Trim() != "") { bool success = new FamilySystem().InsertUpdateApprovalFamily(litBinusianId.Text.Trim(), Convert.ToString(hdfKodeluarga.Value), 2, binusianid, txtComment.Text.Trim()); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } if (rdApprove.Checked == true) { bool success = new FamilySystem().InsertUpdateApprovalFamily(litBinusianId.Text.Trim(), Convert.ToString(hdfKodeluarga.Value), 1, binusianid, ""); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } } } protected void btnSearch_Click(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlSearch_SelectedIndexChanged(object sender, EventArgs e) { } protected void ddlOrder_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlOrderType_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } } }

• NPWPApprovalStudent.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI;

L211

using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using UserManagement.CrossCutting.OptMgmt; using UserManagement.Bussiness.AppFacade; using UserManagement.Business.Entities; using CrossCutting.Security; using CrossCutting.OptMgmt; namespace BMv3Home_BackEnd.NPWP { public partial class NPWPAppStudent : SecurePage { private static string binusianid; #region privilege private Int32 _moduleId; public Int32 ModuleId { get { return _moduleId; } set { _moduleId = value; } } private string _loginId; public string LoginId { get { return _loginId; } set { _loginId = value; } } private string _viewAccess; public string ViewAccess { get { return _viewAccess; } set { _viewAccess = value; } } private string _addAccess; public string AddAccess { get { return _addAccess; } set { _addAccess = value; } } private string _editAccess; public string EditAccess { get { return _editAccess; } set { _editAccess = value; } } private string _deleteAccess; public string DeleteAccess { get { return _deleteAccess; } set { _deleteAccess = value; } } private string _printAccess; public string PrintAccess { get { return _printAccess; } set { _printAccess = value; } } private string _sendAccess; public string SendAccess { get { return _sendAccess; } set { _sendAccess = value; }

L212

} private string _uploadAccess; public string UploadAccess { get { return _uploadAccess; } set { _uploadAccess = value; } } private string _dowloadAccess; public string DowloadAccess { get { return _dowloadAccess; } set { _dowloadAccess = value; } } #endregion #region loadPrivilegeData public void LoadAccess() { string accessidlogin = new AccessModuleSystem().getAccesIDGrouporUser(1, LoginId); List<ModuleData> moduleNowData = new ModuleSystem().GetDetailModuleAccessData(new WebConfiguration().AreaId, new WebConfiguration().GAId, new WebConfiguration().AppId, ModuleId, accessidlogin); List<PriviledgeData> allAccessAvailable = new AccessModuleSystem().LoadPriviledge(); List<AccessModuleData> userAccessData = new PriviledgeBMv3().LoadAccess(Convert.ToInt32(moduleNowData[0].Priviledge.ToString().Trim()), allAccessAvailable); foreach (AccessModuleData userAccessDataDetail in userAccessData) { if (userAccessDataDetail.AllowPrivilegeName == "View" && userAccessDataDetail.AllowAccess == 0) { ViewAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Add" && userAccessDataDetail.AllowAccess == 0) { AddAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Edit" && userAccessDataDetail.AllowAccess == 0) { EditAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Delete" && userAccessDataDetail.AllowAccess == 0) { DeleteAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Print" && userAccessDataDetail.AllowAccess == 0) { PrintAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Send" && userAccessDataDetail.AllowAccess == 0) { SendAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Upload" && userAccessDataDetail.AllowAccess == 0) { UploadAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Download" && userAccessDataDetail.AllowAccess == 0) {

L213

DowloadAccess = "false"; } } } #endregion #region loadpage public void LoadPage() { #region set privilege ViewAccess = "true"; AddAccess = "true"; EditAccess = "true"; DeleteAccess = "true"; PrintAccess = "true"; SendAccess = "true"; UploadAccess = "true"; DowloadAccess = "true"; #endregion string tmpModuleId = ""; tmpModuleId = HttpUtility.HtmlDecode(Rijndael.Decrypt(Request.QueryString["mid"].ToString().Trim(), WebConfiguration.EncryptionKey)); try { ModuleId = Convert.ToInt32(tmpModuleId); } catch (Exception ex) { ModuleId = 0; } if (Session["uid"] != null) { LoginId = Session["uid"].ToString(); } } #endregion #region ViewState protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0;

L214

} } #endregion protected void ShowData() { List<NPWPData> dataSetSource = new List<NPWPData>(); dataSetSource = new NPWPSystem().getListNPWPApp(ddlOrder.SelectedItem.Value.Trim(), ddlOrderType.SelectedItem.Value.Trim(), ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), SystemConfiguration.PagingSumPerPage, CurrPage, 1); if (dataSetSource.Count == 0) { rptPersonalApp.Visible = false; ucPagingControl.Visible = false; litNoData.Visible = true; } else { litNoData.Visible = false; rptPersonalApp.Visible = true; ucPagingControl.Visible = true; rptPersonalApp.DataSource = dataSetSource; rptPersonalApp.DataBind(); } } #region Paging private void FillPaging() { int countPage = new NPWPSystem().getListNPWPAppCount(ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), 1); litTotalRequest.Text = countPage.ToString().Trim(); int sumPage = 1; if (countPage % SystemConfiguration.PagingSumPerPage == 0) { sumPage = countPage / SystemConfiguration.PagingSumPerPage; } else { sumPage = countPage / SystemConfiguration.PagingSumPerPage + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); } #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1;

L215

} else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData _binusianData = (BinusianData)Session["UserData"]; binusianid = _binusianData.BinusianId.Trim(); } LoadPage(); LoadAccess(); ddlOrder.Items.Add(new ListItem("Date", "trnpwpapproval.DateIn")); ddlOrder.Items.Add(new ListItem("Binusian Id", "trnpwpapproval.binusianid")); ddlOrder.Items.Add(new ListItem("Name", "NamaNonGelar")); ddlSearch.Items.Add(new ListItem("Binusian Id", "trnpwpapproval.binusianid")); ddlSearch.Items.Add(new ListItem("Name", "NamaNonGelar")); SaveViewStates(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; FillPaging(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; ShowData(); } else { ucPagingControl.DataBind(); } }

L216

protected void rptPersonalApp_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { NPWPData _data = (NPWPData)e.Item.DataItem; Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); Literal litName = (Literal)e.Item.FindControl("litName"); Literal litDate = (Literal)e.Item.FindControl("litDate"); Literal litNPWPNumberCurrent = (Literal)e.Item.FindControl("litNPWPNumberCurrent"); Literal litNPWPNumberNew = (Literal)e.Item.FindControl("litNPWPNumberNew"); Literal litNameCurrent = (Literal)e.Item.FindControl("litNameCurrent"); Literal litNameNew = (Literal)e.Item.FindControl("litNameNew"); Literal litAddressCurrent = (Literal)e.Item.FindControl("litAddressCurrent"); Literal litAddressNew = (Literal)e.Item.FindControl("litAddressNew"); Literal litOwnershipCurrent = (Literal)e.Item.FindControl("litOwnershipCurrent"); Literal litOwnershipNew = (Literal)e.Item.FindControl("litOwnershipNew"); Literal litRegisterDateCurrent = (Literal)e.Item.FindControl("litRegisterDateCurrent"); Literal litRegisterDateNew = (Literal)e.Item.FindControl("litRegisterDateNew"); Literal litBranchOfficeCurrent = (Literal)e.Item.FindControl("litBranchOfficeCurrent"); Literal litBranchOfficeNew = (Literal)e.Item.FindControl("litBranchOfficeNew"); LinkButton lnkSubmit = (LinkButton)e.Item.FindControl("lnkSubmit"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); pnlError.Visible = false; pnlSuccess.Visible = false; litBinusianId.Text = _data.BinusianId; litDate.Text = _data.DateIn.ToString("dd MMMM yyyy").Trim(); litName.Text = _data.NamaNonGelar; if (_data.NPWPNumbers == "") { _data.NPWPNumbers = "-"; } if (_data.NPWPName == "") { _data.NPWPName = "-"; } if (_data.NPWPAddress == "") { _data.NPWPAddress = "-"; } if (_data.NPWPOwner == "") { _data.NPWPOwner = "-"; } if (_data.NPWPBranchOffice == "") { _data.NPWPBranchOffice = "-"; } litNPWPNumberNew.Text = _data.NPWPNumbers; litNameNew.Text = _data.NPWPName; litAddressNew.Text = _data.NPWPAddress; litOwnershipNew.Text = _data.NPWPOwner;

L217

litRegisterDateNew.Text = DateTime.ParseExact(_data.NPWPRegisterDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMM yyyy"); ; ; litBranchOfficeNew.Text = _data.NPWPBranchOffice; NPWPData _currentData = new NPWPSystem().GetNpwpDetailByBinusianId(_data.BinusianId); if (_currentData.NPWPNumbers == "" || _currentData.NPWPNumbers == null) { _currentData.NPWPNumbers = "-"; } if (_currentData.NPWPName == "" || _currentData.NPWPName == null) { _currentData.NPWPName = "-"; } if (_currentData.NPWPAddress == "" || _currentData.NPWPAddress == null) { _currentData.NPWPAddress = "-"; } if (_currentData.NPWPOwner == "" || _currentData.NPWPOwner == null) { _currentData.NPWPOwner = "-"; } if (_currentData.NPWPBranchOffice == "" || _currentData.NPWPBranchOffice == null) { _currentData.NPWPBranchOffice = "-"; } litNPWPNumberCurrent.Text = _currentData.NPWPNumbers; litNameCurrent.Text = _currentData.NPWPName; litAddressCurrent.Text = _currentData.NPWPAddress; litOwnershipCurrent.Text = _currentData.NPWPOwner; if (_currentData.NPWPRegisterDate == "" || _currentData.NPWPRegisterDate == null) { litRegisterDateCurrent.Text = "-"; } else { litRegisterDateCurrent.Text = DateTime.ParseExact(_currentData.NPWPRegisterDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMM yyyy"); ; ; ; } litBranchOfficeCurrent.Text = _currentData.NPWPBranchOffice; lnkSubmit.CommandName = "Submit"; lnkSubmit.CommandArgument = _data.BinusianId; lnkSubmit.Attributes.Add("onclick", "return confirm('Are You Sure Want To Submit This Data');"); } } protected void rptPersonalApp_ItemCommand(object sender, RepeaterCommandEventArgs e) { Literal litError = (Literal)e.Item.FindControl("litError"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); if (e.CommandName == "Submit") { pnlSuccess.Visible = false; pnlError.Visible = false; RadioButton rdApprove = (RadioButton)e.Item.FindControl("rdApprove"); RadioButton rdDeny = (RadioButton)e.Item.FindControl("rdDeny"); TextBox txtComment = (TextBox)e.Item.FindControl("txtComment"); if (rdDeny.Checked == false && rdApprove.Checked == false)

L218

{ pnlError.Visible = true; litError.Text = "You Must Choose The Approval Type (Yes / No)."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() == "") { pnlError.Visible = true; litError.Text = "You Must Fill The Comment Field."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() != "") { bool success = new NPWPSystem().InsertUpdateApprovalNPWP(litBinusianId.Text.Trim(), 2, binusianid, txtComment.Text.Trim()); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } if (rdApprove.Checked == true) { bool success = new NPWPSystem().InsertUpdateApprovalNPWP(litBinusianId.Text.Trim(), 1, binusianid, ""); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } } } protected void btnSearch_Click(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlSearch_SelectedIndexChanged(object sender, EventArgs e) { } protected void ddlOrder_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlOrderType_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); }

L219

} }

• NPWPApprovalLecturer.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using UserManagement.CrossCutting.OptMgmt; using UserManagement.Bussiness.AppFacade; using UserManagement.Business.Entities; using CrossCutting.Security; using CrossCutting.OptMgmt; namespace BMv3Home_BackEnd.NPWP { public partial class NPWPAppLecturer : SecurePage { private static string binusianid; #region privilege private Int32 _moduleId; public Int32 ModuleId { get { return _moduleId; } set { _moduleId = value; } } private string _loginId; public string LoginId { get { return _loginId; } set { _loginId = value; } } private string _viewAccess; public string ViewAccess { get { return _viewAccess; } set { _viewAccess = value; } } private string _addAccess; public string AddAccess { get { return _addAccess; } set { _addAccess = value; } } private string _editAccess; public string EditAccess { get { return _editAccess; } set { _editAccess = value; } } private string _deleteAccess; public string DeleteAccess { get { return _deleteAccess; } set { _deleteAccess = value; } }

L220

private string _printAccess; public string PrintAccess { get { return _printAccess; } set { _printAccess = value; } } private string _sendAccess; public string SendAccess { get { return _sendAccess; } set { _sendAccess = value; } } private string _uploadAccess; public string UploadAccess { get { return _uploadAccess; } set { _uploadAccess = value; } } private string _dowloadAccess; public string DowloadAccess { get { return _dowloadAccess; } set { _dowloadAccess = value; } } #endregion #region loadPrivilegeData public void LoadAccess() { string accessidlogin = new AccessModuleSystem().getAccesIDGrouporUser(1, LoginId); List<ModuleData> moduleNowData = new ModuleSystem().GetDetailModuleAccessData(new WebConfiguration().AreaId, new WebConfiguration().GAId, new WebConfiguration().AppId, ModuleId, accessidlogin); List<PriviledgeData> allAccessAvailable = new AccessModuleSystem().LoadPriviledge(); List<AccessModuleData> userAccessData = new PriviledgeBMv3().LoadAccess(Convert.ToInt32(moduleNowData[0].Priviledge.ToString().Trim()), allAccessAvailable); foreach (AccessModuleData userAccessDataDetail in userAccessData) { if (userAccessDataDetail.AllowPrivilegeName == "View" && userAccessDataDetail.AllowAccess == 0) { ViewAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Add" && userAccessDataDetail.AllowAccess == 0) { AddAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Edit" && userAccessDataDetail.AllowAccess == 0) { EditAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Delete" && userAccessDataDetail.AllowAccess == 0) { DeleteAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Print" && userAccessDataDetail.AllowAccess == 0) { PrintAccess = "false"; }

L221

if (userAccessDataDetail.AllowPrivilegeName == "Send" && userAccessDataDetail.AllowAccess == 0) { SendAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Upload" && userAccessDataDetail.AllowAccess == 0) { UploadAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Download" && userAccessDataDetail.AllowAccess == 0) { DowloadAccess = "false"; } } } #endregion #region loadpage public void LoadPage() { #region set privilege ViewAccess = "true"; AddAccess = "true"; EditAccess = "true"; DeleteAccess = "true"; PrintAccess = "true"; SendAccess = "true"; UploadAccess = "true"; DowloadAccess = "true"; #endregion string tmpModuleId = ""; tmpModuleId = HttpUtility.HtmlDecode(Rijndael.Decrypt(Request.QueryString["mid"].ToString().Trim(), WebConfiguration.EncryptionKey)); try { ModuleId = Convert.ToInt32(tmpModuleId); } catch (Exception ex) { ModuleId = 0; } if (Session["uid"] != null) { LoginId = Session["uid"].ToString(); } } #endregion #region ViewState protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } }

L222

private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } } #endregion protected void ShowData() { List<NPWPData> dataSetSource = new List<NPWPData>(); dataSetSource = new NPWPSystem().getListNPWPApp(ddlOrder.SelectedItem.Value.Trim(), ddlOrderType.SelectedItem.Value.Trim(), ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), SystemConfiguration.PagingSumPerPage, CurrPage, 2); if (dataSetSource.Count == 0) { rptPersonalApp.Visible = false; ucPagingControl.Visible = false; litNoData.Visible = true; } else { litNoData.Visible = false; rptPersonalApp.Visible = true; ucPagingControl.Visible = true; rptPersonalApp.DataSource = dataSetSource; rptPersonalApp.DataBind(); } } #region Paging private void FillPaging() { int countPage = new NPWPSystem().getListNPWPAppCount(ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), 2); litTotalRequest.Text = countPage.ToString().Trim(); int sumPage = 1; if (countPage % SystemConfiguration.PagingSumPerPage == 0) { sumPage = countPage / SystemConfiguration.PagingSumPerPage; } else { sumPage = countPage / SystemConfiguration.PagingSumPerPage + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); }

L223

#endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData _binusianData = (BinusianData)Session["UserData"]; binusianid = _binusianData.BinusianId.Trim(); } LoadPage(); LoadAccess(); ddlOrder.Items.Add(new ListItem("Date", "trnpwpapproval.DateIn")); ddlOrder.Items.Add(new ListItem("Binusian Id", "trnpwpapproval.binusianid")); ddlOrder.Items.Add(new ListItem("Name", "NamaNonGelar")); ddlSearch.Items.Add(new ListItem("Binusian Id", "trnpwpapproval.binusianid")); ddlSearch.Items.Add(new ListItem("Name", "NamaNonGelar")); SaveViewStates(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage;

L224

FillPaging(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; ShowData(); } else { ucPagingControl.DataBind(); } } protected void rptPersonalApp_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { NPWPData _data = (NPWPData)e.Item.DataItem; Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); Literal litName = (Literal)e.Item.FindControl("litName"); Literal litDate = (Literal)e.Item.FindControl("litDate"); Literal litNPWPNumberCurrent = (Literal)e.Item.FindControl("litNPWPNumberCurrent"); Literal litNPWPNumberNew = (Literal)e.Item.FindControl("litNPWPNumberNew"); Literal litNameCurrent = (Literal)e.Item.FindControl("litNameCurrent"); Literal litNameNew = (Literal)e.Item.FindControl("litNameNew"); Literal litAddressCurrent = (Literal)e.Item.FindControl("litAddressCurrent"); Literal litAddressNew = (Literal)e.Item.FindControl("litAddressNew"); Literal litOwnershipCurrent = (Literal)e.Item.FindControl("litOwnershipCurrent"); Literal litOwnershipNew = (Literal)e.Item.FindControl("litOwnershipNew"); Literal litRegisterDateCurrent = (Literal)e.Item.FindControl("litRegisterDateCurrent"); Literal litRegisterDateNew = (Literal)e.Item.FindControl("litRegisterDateNew"); Literal litBranchOfficeCurrent = (Literal)e.Item.FindControl("litBranchOfficeCurrent"); Literal litBranchOfficeNew = (Literal)e.Item.FindControl("litBranchOfficeNew"); LinkButton lnkSubmit = (LinkButton)e.Item.FindControl("lnkSubmit"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); pnlError.Visible = false; pnlSuccess.Visible = false; litBinusianId.Text = _data.BinusianId; litDate.Text = _data.DateIn.ToString("dd MMMM yyyy").Trim(); litName.Text = _data.NamaNonGelar; if (_data.NPWPNumbers == "") { _data.NPWPNumbers = "-"; } if (_data.NPWPName == "") { _data.NPWPName = "-"; } if (_data.NPWPAddress == "") { _data.NPWPAddress = "-";

L225

} if (_data.NPWPOwner == "") { _data.NPWPOwner = "-"; } if (_data.NPWPBranchOffice == "") { _data.NPWPBranchOffice = "-"; } litNPWPNumberNew.Text = _data.NPWPNumbers; litNameNew.Text = _data.NPWPName; litAddressNew.Text = _data.NPWPAddress; litOwnershipNew.Text = _data.NPWPOwner; litRegisterDateNew.Text = DateTime.ParseExact(_data.NPWPRegisterDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMM yyyy"); ; ; litBranchOfficeNew.Text = _data.NPWPBranchOffice; NPWPData _currentData = new NPWPSystem().GetNpwpDetailByBinusianId(_data.BinusianId); if (_currentData.NPWPNumbers == "" || _currentData.NPWPNumbers == null) { _currentData.NPWPNumbers = "-"; } if (_currentData.NPWPName == "" || _currentData.NPWPName == null) { _currentData.NPWPName = "-"; } if (_currentData.NPWPAddress == "" || _currentData.NPWPAddress == null) { _currentData.NPWPAddress = "-"; } if (_currentData.NPWPOwner == "" || _currentData.NPWPOwner == null) { _currentData.NPWPOwner = "-"; } if (_currentData.NPWPBranchOffice == "" || _currentData.NPWPBranchOffice == null) { _currentData.NPWPBranchOffice = "-"; } litNPWPNumberCurrent.Text = _currentData.NPWPNumbers; litNameCurrent.Text = _currentData.NPWPName; litAddressCurrent.Text = _currentData.NPWPAddress; litOwnershipCurrent.Text = _currentData.NPWPOwner; if (_currentData.NPWPRegisterDate == "" || _currentData.NPWPRegisterDate == null) { litRegisterDateCurrent.Text = "-"; } else { litRegisterDateCurrent.Text = DateTime.ParseExact(_currentData.NPWPRegisterDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMM yyyy"); ; ; ; } litBranchOfficeCurrent.Text = _currentData.NPWPBranchOffice; lnkSubmit.CommandName = "Submit"; lnkSubmit.CommandArgument = _data.BinusianId; lnkSubmit.Attributes.Add("onclick", "return confirm('Are You Sure Want To Submit This Data');"); } } protected void rptPersonalApp_ItemCommand(object sender, RepeaterCommandEventArgs e) { Literal litError = (Literal)e.Item.FindControl("litError"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId");

L226

if (e.CommandName == "Submit") { pnlSuccess.Visible = false; pnlError.Visible = false; RadioButton rdApprove = (RadioButton)e.Item.FindControl("rdApprove"); RadioButton rdDeny = (RadioButton)e.Item.FindControl("rdDeny"); TextBox txtComment = (TextBox)e.Item.FindControl("txtComment"); if (rdDeny.Checked == false && rdApprove.Checked == false) { pnlError.Visible = true; litError.Text = "You Must Choose The Approval Type (Yes / No)."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() == "") { pnlError.Visible = true; litError.Text = "You Must Fill The Comment Field."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() != "") { bool success = new NPWPSystem().InsertUpdateApprovalNPWP(litBinusianId.Text.Trim(), 2, binusianid, txtComment.Text.Trim()); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } if (rdApprove.Checked == true) { bool success = new NPWPSystem().InsertUpdateApprovalNPWP(litBinusianId.Text.Trim(), 1, binusianid, ""); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } } } protected void btnSearch_Click(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlSearch_SelectedIndexChanged(object sender, EventArgs e) { } protected void ddlOrder_SelectedIndexChanged(object sender, EventArgs e) {

L227

FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlOrderType_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } } }

• NPWPApprovalStaff.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using UserManagement.CrossCutting.OptMgmt; using UserManagement.Bussiness.AppFacade; using UserManagement.Business.Entities; using CrossCutting.Security; using CrossCutting.OptMgmt; namespace BMv3Home_BackEnd.NPWP { public partial class NPWPAppStaff : SecurePage { private static string binusianid; #region privilege private Int32 _moduleId; public Int32 ModuleId { get { return _moduleId; } set { _moduleId = value; } } private string _loginId; public string LoginId { get { return _loginId; } set { _loginId = value; } } private string _viewAccess; public string ViewAccess { get { return _viewAccess; } set { _viewAccess = value; } } private string _addAccess; public string AddAccess { get { return _addAccess; } set { _addAccess = value; } } private string _editAccess;

L228

public string EditAccess { get { return _editAccess; } set { _editAccess = value; } } private string _deleteAccess; public string DeleteAccess { get { return _deleteAccess; } set { _deleteAccess = value; } } private string _printAccess; public string PrintAccess { get { return _printAccess; } set { _printAccess = value; } } private string _sendAccess; public string SendAccess { get { return _sendAccess; } set { _sendAccess = value; } } private string _uploadAccess; public string UploadAccess { get { return _uploadAccess; } set { _uploadAccess = value; } } private string _dowloadAccess; public string DowloadAccess { get { return _dowloadAccess; } set { _dowloadAccess = value; } } #endregion #region loadPrivilegeData public void LoadAccess() { string accessidlogin = new AccessModuleSystem().getAccesIDGrouporUser(1, LoginId); List<ModuleData> moduleNowData = new ModuleSystem().GetDetailModuleAccessData(new WebConfiguration().AreaId, new WebConfiguration().GAId, new WebConfiguration().AppId, ModuleId, accessidlogin); List<PriviledgeData> allAccessAvailable = new AccessModuleSystem().LoadPriviledge(); List<AccessModuleData> userAccessData = new PriviledgeBMv3().LoadAccess(Convert.ToInt32(moduleNowData[0].Priviledge.ToString().Trim()), allAccessAvailable); foreach (AccessModuleData userAccessDataDetail in userAccessData) { if (userAccessDataDetail.AllowPrivilegeName == "View" && userAccessDataDetail.AllowAccess == 0) { ViewAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Add" && userAccessDataDetail.AllowAccess == 0) { AddAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Edit" && userAccessDataDetail.AllowAccess == 0) {

L229

EditAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Delete" && userAccessDataDetail.AllowAccess == 0) { DeleteAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Print" && userAccessDataDetail.AllowAccess == 0) { PrintAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Send" && userAccessDataDetail.AllowAccess == 0) { SendAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Upload" && userAccessDataDetail.AllowAccess == 0) { UploadAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Download" && userAccessDataDetail.AllowAccess == 0) { DowloadAccess = "false"; } } } #endregion #region loadpage public void LoadPage() { #region set privilege ViewAccess = "true"; AddAccess = "true"; EditAccess = "true"; DeleteAccess = "true"; PrintAccess = "true"; SendAccess = "true"; UploadAccess = "true"; DowloadAccess = "true"; #endregion string tmpModuleId = ""; tmpModuleId = HttpUtility.HtmlDecode(Rijndael.Decrypt(Request.QueryString["mid"].ToString().Trim(), WebConfiguration.EncryptionKey)); try { ModuleId = Convert.ToInt32(tmpModuleId); } catch (Exception ex) { ModuleId = 0; } if (Session["uid"] != null) { LoginId = Session["uid"].ToString(); } } #endregion

L230

#region ViewState protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } } #endregion protected void ShowData() { List<NPWPData> dataSetSource = new List<NPWPData>(); dataSetSource = new NPWPSystem().getListNPWPApp(ddlOrder.SelectedItem.Value.Trim(), ddlOrderType.SelectedItem.Value.Trim(), ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), SystemConfiguration.PagingSumPerPage, CurrPage, 3); if (dataSetSource.Count == 0) { rptPersonalApp.Visible = false; ucPagingControl.Visible = false; litNoData.Visible = true; } else { litNoData.Visible = false; rptPersonalApp.Visible = true; ucPagingControl.Visible = true; rptPersonalApp.DataSource = dataSetSource; rptPersonalApp.DataBind(); } } #region Paging private void FillPaging() { int countPage = new NPWPSystem().getListNPWPAppCount(ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), 3); litTotalRequest.Text = countPage.ToString().Trim(); int sumPage = 1; if (countPage % SystemConfiguration.PagingSumPerPage == 0) { sumPage = countPage / SystemConfiguration.PagingSumPerPage; } else

L231

{ sumPage = countPage / SystemConfiguration.PagingSumPerPage + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); } #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData _binusianData = (BinusianData)Session["UserData"]; binusianid = _binusianData.BinusianId.Trim(); } LoadPage(); LoadAccess(); ddlOrder.Items.Add(new ListItem("Date", "trnpwpapproval.DateIn"));

L232

ddlOrder.Items.Add(new ListItem("Binusian Id", "trnpwpapproval.binusianid")); ddlOrder.Items.Add(new ListItem("Name", "NamaNonGelar")); ddlSearch.Items.Add(new ListItem("Binusian Id", "trnpwpapproval.binusianid")); ddlSearch.Items.Add(new ListItem("Name", "NamaNonGelar")); SaveViewStates(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; FillPaging(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; ShowData(); } else { ucPagingControl.DataBind(); } } protected void rptPersonalApp_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { NPWPData _data = (NPWPData)e.Item.DataItem; Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); Literal litName = (Literal)e.Item.FindControl("litName"); Literal litDate = (Literal)e.Item.FindControl("litDate"); Literal litNPWPNumberCurrent = (Literal)e.Item.FindControl("litNPWPNumberCurrent"); Literal litNPWPNumberNew = (Literal)e.Item.FindControl("litNPWPNumberNew"); Literal litNameCurrent = (Literal)e.Item.FindControl("litNameCurrent"); Literal litNameNew = (Literal)e.Item.FindControl("litNameNew"); Literal litAddressCurrent = (Literal)e.Item.FindControl("litAddressCurrent"); Literal litAddressNew = (Literal)e.Item.FindControl("litAddressNew"); Literal litOwnershipCurrent = (Literal)e.Item.FindControl("litOwnershipCurrent"); Literal litOwnershipNew = (Literal)e.Item.FindControl("litOwnershipNew"); Literal litRegisterDateCurrent = (Literal)e.Item.FindControl("litRegisterDateCurrent"); Literal litRegisterDateNew = (Literal)e.Item.FindControl("litRegisterDateNew"); Literal litBranchOfficeCurrent = (Literal)e.Item.FindControl("litBranchOfficeCurrent"); Literal litBranchOfficeNew = (Literal)e.Item.FindControl("litBranchOfficeNew"); LinkButton lnkSubmit = (LinkButton)e.Item.FindControl("lnkSubmit"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); pnlError.Visible = false; pnlSuccess.Visible = false; litBinusianId.Text = _data.BinusianId; litDate.Text = _data.DateIn.ToString("dd MMMM yyyy").Trim();

L233

litName.Text = _data.NamaNonGelar; if (_data.NPWPNumbers == "") { _data.NPWPNumbers = "-"; } if (_data.NPWPName == "") { _data.NPWPName = "-"; } if (_data.NPWPAddress == "") { _data.NPWPAddress = "-"; } if (_data.NPWPOwner == "") { _data.NPWPOwner = "-"; } if (_data.NPWPBranchOffice == "") { _data.NPWPBranchOffice = "-"; } litNPWPNumberNew.Text = _data.NPWPNumbers; litNameNew.Text = _data.NPWPName; litAddressNew.Text = _data.NPWPAddress; litOwnershipNew.Text = _data.NPWPOwner; litRegisterDateNew.Text = DateTime.ParseExact(_data.NPWPRegisterDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMM yyyy"); ; ; litBranchOfficeNew.Text = _data.NPWPBranchOffice; NPWPData _currentData = new NPWPSystem().GetNpwpDetailByBinusianId(_data.BinusianId); if (_currentData.NPWPNumbers == "" || _currentData.NPWPNumbers == null) { _currentData.NPWPNumbers = "-"; } if (_currentData.NPWPName == "" || _currentData.NPWPName == null) { _currentData.NPWPName = "-"; } if (_currentData.NPWPAddress == "" || _currentData.NPWPAddress == null) { _currentData.NPWPAddress = "-"; } if (_currentData.NPWPOwner == "" || _currentData.NPWPOwner == null) { _currentData.NPWPOwner = "-"; } if (_currentData.NPWPBranchOffice == "" || _currentData.NPWPBranchOffice == null) { _currentData.NPWPBranchOffice = "-"; } litNPWPNumberCurrent.Text = _currentData.NPWPNumbers; litNameCurrent.Text = _currentData.NPWPName; litAddressCurrent.Text = _currentData.NPWPAddress; litOwnershipCurrent.Text = _currentData.NPWPOwner; if (_currentData.NPWPRegisterDate == "" || _currentData.NPWPRegisterDate == null) { litRegisterDateCurrent.Text = "-"; } else { litRegisterDateCurrent.Text = DateTime.ParseExact(_currentData.NPWPRegisterDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMM yyyy"); ; ; ; } litBranchOfficeCurrent.Text = _currentData.NPWPBranchOffice;

L234

lnkSubmit.CommandName = "Submit"; lnkSubmit.CommandArgument = _data.BinusianId; lnkSubmit.Attributes.Add("onclick", "return confirm('Are You Sure Want To Submit This Data');"); } } protected void rptPersonalApp_ItemCommand(object sender, RepeaterCommandEventArgs e) { Literal litError = (Literal)e.Item.FindControl("litError"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); if (e.CommandName == "Submit") { pnlSuccess.Visible = false; pnlError.Visible = false; RadioButton rdApprove = (RadioButton)e.Item.FindControl("rdApprove"); RadioButton rdDeny = (RadioButton)e.Item.FindControl("rdDeny"); TextBox txtComment = (TextBox)e.Item.FindControl("txtComment"); if (rdDeny.Checked == false && rdApprove.Checked == false) { pnlError.Visible = true; litError.Text = "You Must Choose The Approval Type (Yes / No)."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() == "") { pnlError.Visible = true; litError.Text = "You Must Fill The Comment Field."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() != "") { bool success = new NPWPSystem().InsertUpdateApprovalNPWP(litBinusianId.Text.Trim(), 2, binusianid, txtComment.Text.Trim()); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } if (rdApprove.Checked == true) { bool success = new NPWPSystem().InsertUpdateApprovalNPWP(litBinusianId.Text.Trim(), 1, binusianid, ""); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } } }

L235

protected void btnSearch_Click(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlSearch_SelectedIndexChanged(object sender, EventArgs e) { } protected void ddlOrder_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlOrderType_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } } }

• EditStudentActivity.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using CrossCutting.OptMgmt; namespace BinusianProfile.Portofolio { public partial class EditStudentActivity : SecurePage// System.Web.UI.Page { private static string binusianId = ""; // private static string binusianRoleId = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; //binusianRoleId = new BinusianSsytem().GetBinusianRole(binusianId); //if (binusianRoleId != "01") //{ // Response.Redirect("~/Welcomepage.aspx"); //} if (!new BinusianSsytem().CheckStatusGabungan(binusianId, 4)) { Response.Redirect("~/WelcomePage.aspx"); } } else {

L236

Response.Redirect("~/NotAuthorizedAccessPage.aspx"); } ltTitleStudentAct.Text = "Add New Student Activity"; ddlActType.DataSource = new StudentActivitySystem().GetActivityCategoryForDDL(); ddlActType.DataTextField = "ActivityCategory"; ddlActType.DataValueField = "ActivityCategoryId"; ddlActType.DataBind(); int flagActivityCategory = 0; if (new StudentActivitySystem().CheckIfBlogSubmitted(binusianId)) { ddlActType.Items.RemoveAt(0); flagActivityCategory = 1; } if (new StudentActivitySystem().CheckIfSeminarMoreThan2(binusianId)) { if (flagActivityCategory == 0) { ddlActType.Items.RemoveAt(1); } else if (flagActivityCategory == 1) { ddlActType.Items.RemoveAt(0); } } else if (!new StudentActivitySystem().CheckIfSeminarMoreThan2(binusianId)) { if (flagActivityCategory == 0) { ddlActType.Items.RemoveAt(2); } else if (flagActivityCategory == 1) { ddlActType.Items.RemoveAt(1); } } if (ddlActType.SelectedValue == "2") { pnlBlog.Visible = true; pnlPublication.Visible = false; pnlOther.Visible = false; } else if (ddlActType.SelectedValue == "17") { pnlBlog.Visible = false; pnlPublication.Visible = true; pnlOther.Visible = false; ddlActMediaType.DataSource = new StudentActivitySystem().GetMediaTypeForDDL(); ddlActMediaType.DataTextField = "MediaType"; ddlActMediaType.DataValueField = "MediaId"; ddlActMediaType.DataBind(); ddlActLevelPublication.DataSource = new StudentActivitySystem().GetLevelSATForDDL(ddlActType.SelectedValue); ddlActLevelPublication.DataTextField = "ActivityLevel"; ddlActLevelPublication.DataValueField = "ActivityLevelId"; ddlActLevelPublication.DataBind(); ddlActRolePublication.DataSource = new StudentActivitySystem().GetPositionSATForDDL(ddlActType.SelectedValue); ddlActRolePublication.DataTextField = "ActivityRole"; ddlActRolePublication.DataValueField = "ActivityRoleId"; ddlActRolePublication.DataBind(); } else { pnlBlog.Visible = false; pnlPublication.Visible = false;

L237

pnlOther.Visible = true; ddlActLevelOther.DataSource = new StudentActivitySystem().GetLevelSATForDDL(ddlActType.SelectedValue); ddlActLevelOther.DataTextField = "ActivityLevel"; ddlActLevelOther.DataValueField = "ActivityLevelId"; ddlActLevelOther.DataBind(); if (ddlActType.SelectedValue == "3") { ddlActRoleOther.DataSource = new StudentActivitySystem().GetPositionSATForDDL("4"); } else { ddlActRoleOther.DataSource = new StudentActivitySystem().GetPositionSATForDDL(ddlActType.SelectedValue); } ddlActRoleOther.DataTextField = "ActivityRole"; ddlActRoleOther.DataValueField = "ActivityRoleId"; ddlActRoleOther.DataBind(); } if (Request.QueryString["e"] != null && Request.QueryString["id"] != null) { string tempId = Request.QueryString["id"].ToString().Trim(); try { int satId = Convert.ToInt32(HttpUtility.UrlDecode(Encryption64.Decrypt(tempId, SystemConfiguration.EncryptionKey))); StudentActivityData satData = new StudentActivitySystem().GetSATDetail(satId, binusianId); if (satData.Nimhs == binusianId) { ltTitleStudentAct.Text = "Activity Editing"; ddlActType.DataSource = new StudentActivitySystem().GetActivityCategoryForDDL(); ddlActType.DataTextField = "ActivityCategory"; ddlActType.DataValueField = "ActivityCategoryId"; ddlActType.DataBind(); ddlActType.SelectedValue = satData.ActivityCategoryId; ddlActType.Enabled = false; if (satData.ActivityCategoryId == "2") { pnlBlog.Visible = true; pnlPublication.Visible = false; pnlOther.Visible = false; txtActBlogUrl.Text = satData.ActivityDetail; ucBlogCreateDate.setDate(satData.ActivityStartDate); } else if (satData.ActivityCategoryId == "17") { pnlBlog.Visible = false; pnlPublication.Visible = true; pnlOther.Visible = false; ddlActMediaType.DataSource = new StudentActivitySystem().GetMediaTypeForDDL(); ddlActMediaType.DataTextField = "MediaType"; ddlActMediaType.DataValueField = "MediaId"; ddlActMediaType.DataBind(); ddlActLevelPublication.DataSource = new StudentActivitySystem().GetLevelSATForDDL(ddlActType.SelectedValue); ddlActLevelPublication.DataTextField = "ActivityLevel"; ddlActLevelPublication.DataValueField = "ActivityLevelId"; ddlActLevelPublication.DataBind(); ddlActRolePublication.DataSource = new StudentActivitySystem().GetPositionSATForDDL(ddlActType.SelectedValue);

L238

ddlActRolePublication.DataTextField = "ActivityRole"; ddlActRolePublication.DataValueField = "ActivityRoleId"; ddlActRolePublication.DataBind(); txtPublicationTitle.Text = satData.ActivityDetail; ddlActMediaType.SelectedValue = satData.MediaId; txtActMediaName.Text = satData.MediaName; ddlActLevelPublication.SelectedValue = satData.ActivityLevelId; ddlActRolePublication.SelectedValue = satData.ActivityRoleId; ucPublicationDate.setDate(satData.ActivityStartDate); } else { pnlBlog.Visible = false; pnlPublication.Visible = false; pnlOther.Visible = true; ddlActLevelOther.DataSource = new StudentActivitySystem().GetLevelSATForDDL(ddlActType.SelectedValue); ddlActLevelOther.DataTextField = "ActivityLevel"; ddlActLevelOther.DataValueField = "ActivityLevelId"; ddlActLevelOther.DataBind(); if (satData.ActivityCategoryId == "3") { ddlActRoleOther.DataSource = new StudentActivitySystem().GetPositionSATForDDL("4"); } else { ddlActRoleOther.DataSource = new StudentActivitySystem().GetPositionSATForDDL(ddlActType.SelectedValue); } ddlActRoleOther.DataTextField = "ActivityRole"; ddlActRoleOther.DataValueField = "ActivityRoleId"; ddlActRoleOther.DataBind(); txtActName.Text = satData.ActivityDetail; txtActPlace.Text = satData.ActivityPlace; ddlActLevelOther.SelectedValue = satData.ActivityLevelId; ddlActRoleOther.SelectedValue = satData.ActivityRoleId; ucStartDate.setDate(satData.ActivityStartDate); ucEndDate.setDate(satData.ActivityEndDate); } } else { Response.Redirect("StudentActivity.aspx"); } } catch (Exception ex) { Response.Redirect("StudentActivity.aspx"); } } else if ((Request.QueryString["e"] != null && Request.QueryString["id"] == null) || (Request.QueryString["e"] == null && Request.QueryString["id"] != null)) { Response.Redirect("StudentActivity.aspx"); } } } protected void lbBackToStudentActivity_Click(object sender, EventArgs e) { Response.Redirect("StudentActivity.aspx");

L239

} protected void ddlActType_SelectedIndexChanged(object sender, EventArgs e) { if (ddlActType.SelectedValue == "2") { pnlBlog.Visible = true; pnlPublication.Visible = false; pnlOther.Visible = false; } else if (ddlActType.SelectedValue == "17") { pnlBlog.Visible = false; pnlPublication.Visible = true; pnlOther.Visible = false; ddlActMediaType.DataSource = new StudentActivitySystem().GetMediaTypeForDDL(); ddlActMediaType.DataTextField = "MediaType"; ddlActMediaType.DataValueField = "MediaId"; ddlActMediaType.DataBind(); ddlActLevelPublication.DataSource = new StudentActivitySystem().GetLevelSATForDDL(ddlActType.SelectedValue); ddlActLevelPublication.DataTextField = "ActivityLevel"; ddlActLevelPublication.DataValueField = "ActivityLevelId"; ddlActLevelPublication.DataBind(); ddlActRolePublication.DataSource = new StudentActivitySystem().GetPositionSATForDDL(ddlActType.SelectedValue); ddlActRolePublication.DataTextField = "ActivityRole"; ddlActRolePublication.DataValueField = "ActivityRoleId"; ddlActRolePublication.DataBind(); } else { pnlBlog.Visible = false; pnlPublication.Visible = false; pnlOther.Visible = true; ddlActLevelOther.DataSource = new StudentActivitySystem().GetLevelSATForDDL(ddlActType.SelectedValue); ddlActLevelOther.DataTextField = "ActivityLevel"; ddlActLevelOther.DataValueField = "ActivityLevelId"; ddlActLevelOther.DataBind(); if (ddlActType.SelectedValue == "3") { ddlActRoleOther.DataSource = new StudentActivitySystem().GetPositionSATForDDL("4"); } else { ddlActRoleOther.DataSource = new StudentActivitySystem().GetPositionSATForDDL(ddlActType.SelectedValue); } ddlActRoleOther.DataTextField = "ActivityRole"; ddlActRoleOther.DataValueField = "ActivityRoleId"; ddlActRoleOther.DataBind(); } lblWarn.Text = ""; lblWarn.Visible = false; } protected void btnSubmitSATBlog_Click(object sender, EventArgs e) { if (txtActBlogUrl.Text == null || txtActBlogUrl.Text == "") { lblWarn.Visible = true; lblWarn.Text = "Please input your blog URL"; return; } else if (ucBlogCreateDate.getDate() == null || ucBlogCreateDate.getDate() == "") { lblWarn.Visible = true;

L240

lblWarn.Text = "Please input the created date of your blog"; return; } StudentActivityData satBlogData = new StudentActivityData(); if (Request.QueryString["e"] != null && Request.QueryString["id"] != null) { string tempId = Request.QueryString["id"].ToString().Trim(); satBlogData.StudentActivityId =Convert.ToInt32(HttpUtility.UrlDecode(Encryption64.Decrypt(Request.QueryString["id"], SystemConfiguration.EncryptionKey))); } else if ((Request.QueryString["e"] != null && Request.QueryString["id"] == null) || (Request.QueryString["e"] == null && Request.QueryString["id"] != null)) { Response.Redirect("~/WelcomePage.aspx"); } else { satBlogData.StudentActivityId = 0; } satBlogData.ActivityCategoryId = ddlActType.SelectedValue; if (!txtActBlogUrl.Text.StartsWith("http://")) { satBlogData.ActivityDetail = "http://" + txtActBlogUrl.Text; } else if (txtActBlogUrl.Text.StartsWith("http://")) { satBlogData.ActivityDetail = txtActBlogUrl.Text; } satBlogData.ActivityStartDate = ucBlogCreateDate.getDate(); StudentActivityData IdBaAndPoint = new StudentActivitySystem().GetIdBAandPoint(Convert.ToInt32(satBlogData.ActivityCategoryId), 0, 0); satBlogData.ActivityPoints = IdBaAndPoint.ActivityDefaultPoints; satBlogData.ActivityIdBa = IdBaAndPoint.ActivityIdBa; if (new StudentActivitySystem().InsertUpdateStudentActivityBlog(binusianId, satBlogData, binusianId)) { Response.Redirect("StudentActivity.aspx"); } else { Response.Redirect("EditStudentActivity.aspx"); } } protected void btnSubmitSATPublication_Click(object sender, EventArgs e) { if (txtPublicationTitle.Text == null || txtPublicationTitle.Text == "") { lblWarn.Visible = true; lblWarn.Text = "Please input your publication title"; return; } else if (txtActMediaName.Text == null || txtActMediaName.Text == "") { lblWarn.Visible = true; lblWarn.Text = "Please input your media name"; return; } else if (ucPublicationDate.getDate() == null || ucPublicationDate.getDate() == "") { lblWarn.Visible = true; lblWarn.Text = "Please input the date of your publciation"; return; } StudentActivityData satPublicationData = new StudentActivityData(); if (Request.QueryString["e"] != null && Request.QueryString["id"] != null)

L241

{ string tempId = Request.QueryString["id"].ToString().Trim(); satPublicationData.StudentActivityId = Convert.ToInt32(HttpUtility.UrlDecode(Encryption64.Decrypt(Request.QueryString["id"], SystemConfiguration.EncryptionKey))); } else if ((Request.QueryString["e"] != null && Request.QueryString["id"] == null) || (Request.QueryString["e"] == null && Request.QueryString["id"] != null)) { Response.Redirect("~/WelcomePage.aspx"); } else { satPublicationData.StudentActivityId = 0; } satPublicationData.ActivityCategoryId = ddlActType.SelectedValue; satPublicationData.ActivityDetail = txtPublicationTitle.Text; satPublicationData.MediaType = ddlActMediaType.SelectedValue; satPublicationData.MediaName = txtActMediaName.Text; satPublicationData.ActivityLevel = ddlActLevelPublication.SelectedItem.Text; satPublicationData.ActivityLevelId = ddlActLevelPublication.SelectedValue; satPublicationData.ActivityRole = ddlActRolePublication.SelectedItem.Text; satPublicationData.ActivityRoleId = ddlActRolePublication.SelectedValue; satPublicationData.ActivityStartDate = ucPublicationDate.getDate(); StudentActivityData IdBaAndPoint = new StudentActivitySystem().GetIdBAandPoint(Convert.ToInt32(satPublicationData.ActivityCategoryId), Convert.ToInt32(satPublicationData.ActivityLevelId), Convert.ToInt32(satPublicationData.ActivityRoleId)); satPublicationData.ActivityPoints = IdBaAndPoint.ActivityDefaultPoints; satPublicationData.ActivityIdBa = IdBaAndPoint.ActivityIdBa; if (new StudentActivitySystem().InsertUpdateStudentActivityPublication(binusianId, satPublicationData, binusianId)) { Response.Redirect("StudentActivity.aspx"); } else { Response.Redirect("EditStudentActivity.aspx"); } } protected void btnSubmitSATOther_Click(object sender, EventArgs e) { if(txtActName.Text == null || txtActName.Text == "") { lblWarn.Visible = true; lblWarn.Text = "Please input the name of your activity"; return; } else if (txtActPlace.Text == null || txtActPlace.Text == "") { lblWarn.Visible = true; lblWarn.Text = "Please input the location of your activity"; return; } else if(ucStartDate.getDate() == null || ucStartDate.getDate() == "") { lblWarn.Visible = true; lblWarn.Text = "Please input the start date of your activity"; return; } else if (ucEndDate.getDate() == null || ucEndDate.getDate() == "") { lblWarn.Visible = true; lblWarn.Text = "Please input the end date of your activity"; return; }

L242

else if ((ucStartDate.getDate() != null && ucStartDate.getDate() != "") && (ucEndDate.getDate() != null || ucEndDate.getDate() != "")) { DateTime tempStart = DateTime.ParseExact(ucStartDate.getDate(), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); DateTime tempEnd = DateTime.ParseExact(ucEndDate.getDate(), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); int tempCompare = tempStart.CompareTo(tempEnd); if (tempCompare > 0) { lblWarn.Visible = true; lblWarn.Text = "The start date must be earlier than end date"; return; } } StudentActivityData satOtherData = new StudentActivityData(); if (Request.QueryString["e"] != null && Request.QueryString["id"] != null) { string tempId = Request.QueryString["id"].ToString().Trim(); satOtherData.StudentActivityId = Convert.ToInt32(HttpUtility.UrlDecode(Encryption64.Decrypt(Request.QueryString["id"], SystemConfiguration.EncryptionKey))); } else if ((Request.QueryString["e"] != null && Request.QueryString["id"] == null) || (Request.QueryString["e"] == null && Request.QueryString["id"] != null)) { Response.Redirect("~/WelcomePage.aspx"); } else { satOtherData.StudentActivityId = 0; } satOtherData.ActivityCategoryId = ddlActType.SelectedValue; satOtherData.ActivityDetail = txtActName.Text; satOtherData.ActivityPlace = txtActPlace.Text; satOtherData.ActivityLevel = ddlActLevelOther.SelectedItem.Text; satOtherData.ActivityLevelId = ddlActLevelOther.SelectedValue; satOtherData.ActivityRole = ddlActRoleOther.SelectedItem.Text; satOtherData.ActivityRoleId = ddlActRoleOther.SelectedValue; if (satOtherData.ActivityCategoryId == "3" && satOtherData.ActivityRoleId != "3") { satOtherData.ActivityCategoryId = "4"; } satOtherData.ActivityStartDate = ucStartDate.getDate(); satOtherData.ActivityEndDate = ucEndDate.getDate(); StudentActivityData IdBaAndPoint = new StudentActivitySystem().GetIdBAandPoint(Convert.ToInt32(satOtherData.ActivityCategoryId), Convert.ToInt32(satOtherData.ActivityLevelId), Convert.ToInt32(satOtherData.ActivityRoleId)); satOtherData.ActivityPoints = IdBaAndPoint.ActivityDefaultPoints; satOtherData.ActivityIdBa = IdBaAndPoint.ActivityIdBa; if (new StudentActivitySystem().InsertUpdateStudentActivityOther(binusianId, satOtherData, binusianId)) { Response.Redirect("StudentActivity.aspx"); } else { Response.Redirect("EditStudentActivity.aspx"); } } } }

L243

• PrintStudentActivity.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using CrossCutting.OptMgmt; namespace BinusianProfile.Portofolio { public partial class PrintStudentActivity :SecurePage { private static string binusianId = ""; private static string binusianRoleId = ""; private int tempPointOpt = 0; private int tempPointCore = 0; protected void Page_Load(object sender, EventArgs e) { //else //{ // Response.Redirect("~/NotAuthorizedAccessPage.aspx"); //} if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; // binusianRoleId = new BinusianSsytem().GetBinusianRole(binusianId); //if (binusianRoleId != "01") //{ // Response.Redirect("~/WelcomePage.aspx"); //} if (!new BinusianSsytem().CheckStatusGabungan(binusianId, 4)) { Response.Redirect("~/WelcomePage.aspx"); } } List<StudentActivityData> coreSatData = new StudentActivitySystem().GetCoreStudentActivity(binusianId); if (coreSatData.Count == 0) { rptCoreActivity.Visible = false; lblNoteCore.Text = "You don't have any core activity yet."; lblNoteCore.Visible = true; } else { rptCoreActivity.Visible = true; rptCoreActivity.DataSource = coreSatData; rptCoreActivity.DataBind(); } List<StudentActivityData> optSatData = new StudentActivitySystem().GetOptionalStudentActivity(binusianId); if (optSatData.Count == 0) { rptOptActivity.Visible = false; lblNoteOpt.Text = "You don't have any optional activity yet."; lblNoteOpt.Visible = true; } else

L244

{ rptOptActivity.Visible = true; rptOptActivity.DataSource = optSatData; rptOptActivity.DataBind(); } ltPointTotal.Text = "<strong>Total activity points: " + (tempPointCore + tempPointOpt).ToString() + "</strong>"; } } protected void lbAddNewActivity_Click(object sender, EventArgs e) { Response.Redirect("EditStudentActivity.aspx"); } protected void rptCoreActivity_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { StudentActivityData coreSatData = (StudentActivityData)e.Item.DataItem; HiddenField hdnCoreSatId = (HiddenField)e.Item.FindControl("hdnCoreSatId"); Literal ltCoreActType = (Literal)e.Item.FindControl("ltCoreActType"); Literal ltCoreActDetail = (Literal)e.Item.FindControl("ltCoreActDetail"); Literal ltCoreActRole = (Literal)e.Item.FindControl("ltCoreActRole"); Literal ltCoreActLevel = (Literal)e.Item.FindControl("ltCoreActLevel"); Literal ltCoreActYear = (Literal)e.Item.FindControl("ltCoreActYear"); Literal ltCoreActPoints = (Literal)e.Item.FindControl("ltCoreActPoints"); hdnCoreSatId.Value = coreSatData.StudentActivityId.ToString().Trim(); ltCoreActType.Text = coreSatData.ActivityCategory; ltCoreActDetail.Text = coreSatData.ActivityDetail ; ltCoreActLevel.Text = coreSatData.ActivityLevel; ltCoreActRole.Text = coreSatData.ActivityRole; ltCoreActYear.Text = coreSatData.ActivityYear; ltCoreActPoints.Text = coreSatData.ActivityPoints.ToString().Trim(); tempPointCore = tempPointCore + coreSatData.ActivityPoints; } if (e.Item.ItemType == ListItemType.Footer) { Label lblPointCore = (Label)e.Item.FindControl("lblPointCore"); lblPointCore.Visible = true; lblPointCore.Text = "Total points for core activity: " + tempPointCore.ToString() + "<br />"; } } protected void rptOptActivity_itemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { StudentActivityData optSatData = (StudentActivityData)e.Item.DataItem; HiddenField hdnOptSatId = (HiddenField)e.Item.FindControl("hdnOptSatId"); Literal ltOptActType = (Literal)e.Item.FindControl("ltOptActType"); Literal ltOptActDetail = (Literal)e.Item.FindControl("ltOptActDetail"); Literal ltOptActLevel = (Literal)e.Item.FindControl("ltOptActLevel"); Literal ltOptActRole = (Literal)e.Item.FindControl("ltOptActRole"); Literal ltOptActYear = (Literal)e.Item.FindControl("ltOptActYear"); Literal ltOptActPoints = (Literal)e.Item.FindControl("ltOptActPoints"); hdnOptSatId.Value = optSatData.StudentActivityId.ToString().Trim(); ltOptActType.Text = optSatData.ActivityCategory; ltOptActDetail.Text = optSatData.ActivityDetail;

L245

ltOptActLevel.Text = optSatData.ActivityLevel; ltOptActRole.Text = optSatData.ActivityRole; ltOptActYear.Text = optSatData.ActivityYear; ltOptActPoints.Text = optSatData.ActivityPoints.ToString().Trim(); tempPointOpt = tempPointOpt + optSatData.ActivityPoints; } if (e.Item.ItemType == ListItemType.Footer) { Label lblPointOpt = (Label)e.Item.FindControl("lblPointOpt"); lblPointOpt.Visible = true; lblPointOpt.Text = "Total points for optional activity: " + tempPointOpt.ToString() + "<br />"; } } protected void btnCetak_Click(object sender, EventArgs e) { btnCetak.Visible = false; string script = @"window.print();"; ScriptManager.RegisterStartupScript(this, this.GetType(), "jsCall", script, true); } } }

• PersonalApproval.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.AppFacade; using Business.Entities.Data; namespace BinusianProfile.Approval { public partial class PersonalApproval : SecurePage//System.Web.UI.Page { private static string binusianId = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; } PersonalData newInfo = new PersonalSystem().GetPersonalDataFromApproval(binusianId); if (newInfo.ReligionId == null && newInfo.NationalityId == null && newInfo.MaritalId == null) { pnlApprovalDetail.Visible = false; ltNoteApproval.Text = "You don't have any change request of personal information"; } else {

L246

pnlApprovalDetail.Visible = true; ltNewReligion.Text = newInfo.Religion; ltNewNationality.Text = newInfo.Nationality; ltNewMarital.Text = newInfo.MaritalStatus; PersonalData currInfo = new PersonalSystem().GetPersonalDataByBinusianId(binusianId); ltCurrentReligion.Text = currInfo.Religion; ltCurrentNationality.Text = currInfo.Nationality; ltCurrentMarital.Text = currInfo.MaritalStatus; ltNoteApproval.Text = "You have request this change at " + newInfo.DateIn.ToString("dd MMMM yyyy"); } } } } }

• FamilyApproval.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.AppFacade; using Business.Entities.Data; namespace BinusianProfile.Approval { public partial class FamilyApproval : SecurePage //System.Web.UI.Page { public static string binusianId = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; } List<FamilyData> familyData = new FamilySystem().GetFamilyListIdentifierFromApproval(binusianId); if (familyData.Count > 0) { rptFamilyApproval.DataSource = familyData; rptFamilyApproval.DataBind(); } else { ltNoDataApproval.Text = "You don't have any change request of family information"; } } } protected void rptFamilyApproval_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem ) { FamilyData familyData = (FamilyData)e.Item.DataItem; FamilyData famDetail = new FamilySystem().GetFamilyMemberBasicDetailFromApproval(binusianId, familyData.IsBinusian, familyData.KodeKeluarga);

L247

FamilyData famDetailCurrent = new FamilySystem().GetFamilyMemberBasicDetail(binusianId, familyData.IsBinusian, familyData.KodeKeluarga); Panel pnlFamilyNonBinusian = (Panel)e.Item.FindControl("pnlFamilyNonBinusian"); Literal ltCurrentRelation = (Literal)e.Item.FindControl("ltCurrentRelation"); Literal ltNewRelation = (Literal)e.Item.FindControl("ltNewRelation"); Literal ltCurrentName = (Literal)e.Item.FindControl("ltCurrentName"); Literal ltNewName = (Literal)e.Item.FindControl("ltNewName"); Literal ltCurrentPoB = (Literal)e.Item.FindControl("ltCurrentPoB"); Literal ltNewPoB = (Literal)e.Item.FindControl("ltNewPoB"); Literal ltCurrentDoB = (Literal)e.Item.FindControl("ltCurrentDoB"); Literal ltNewDoB = (Literal)e.Item.FindControl("ltNewDoB"); Literal ltCurrentGender = (Literal)e.Item.FindControl("ltCurrentGender"); Literal ltNewGender = (Literal)e.Item.FindControl("ltNewGender"); Literal ltCurrentStatus = (Literal)e.Item.FindControl("ltCurrentStatus"); Literal ltNewStatus = (Literal)e.Item.FindControl("ltNewStatus"); Literal ltCurrentTaxStatus = (Literal)e.Item.FindControl("ltCurrentTaxStatus"); Literal ltNewTaxStatus = (Literal)e.Item.FindControl("ltNewTaxStatus"); Literal ltCurrentEduDegree = (Literal)e.Item.FindControl("ltCurrentEduDegree"); Literal ltNewEduDegree = (Literal)e.Item.FindControl("ltNewEduDegree"); Literal ltCurrentWorkField = (Literal)e.Item.FindControl("ltCurrentWorkField"); Literal ltNewWorkField = (Literal)e.Item.FindControl("ltNewWorkField"); Panel pnlFamilyBinusian = (Panel)e.Item.FindControl("pnlFamilyBinusian"); Literal ltCurrentRelationBinusian = (Literal)e.Item.FindControl("ltCurrentRelationBinusian"); Literal ltNewRelationBinusian = (Literal)e.Item.FindControl("ltNewRelationBinusian"); Literal ltFamilyNameTitle = (Literal)e.Item.FindControl("ltFamilyNameTitle"); Literal ltNoteApproval = (Literal)e.Item.FindControl("ltNoteApproval"); ltNoteApproval.Text = " Request New Data at " + famDetail.DateIn.ToString("dd MMMM yyyy"); if (familyData.IsBinusian == 1) { ltFamilyNameTitle.Text = "- " + familyData.Hubungan + " - " + famDetail.NamaLengkap + " [" + familyData.KodeKeluarga + "]"; pnlFamilyNonBinusian.Visible = false; ltNewRelationBinusian.Text = familyData.Hubungan; if (famDetailCurrent.Hubungan == "" || famDetailCurrent.Hubungan == null) { ltCurrentRelationBinusian.Text = "<div style='text-align:center;'>-</div>"; } else { ltCurrentRelationBinusian.Text = famDetailCurrent.Hubungan; } } else { ltFamilyNameTitle.Text = "- " + familyData.Hubungan + " - " + famDetail.NamaLengkap; pnlFamilyBinusian.Visible = false; ltNewRelation.Text = familyData.Hubungan; ltNewName.Text = famDetail.NamaLengkap; ltNewPoB.Text = famDetail.TempatLahir; ltNewDoB.Text = DateTime.ParseExact(famDetail.TglLahir, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); //ltFamilyBasicInfoDoB.Text = famDetail.TglLahir;

L248

ltNewGender.Text = famDetail.JenisKelamin; if (famDetail.StatusHidup == null || famDetail.StatusHidup == "") { ltNewStatus.Text = "-"; } else { ltNewStatus.Text = famDetail.StatusHidup; } if (famDetail.StatusPajak == null || famDetail.StatusPajak == "") { ltNewTaxStatus.Text = "<div style='text-align:center;'>-</div>"; } else { ltNewTaxStatus.Text = famDetail.StatusPajak; } if (famDetail.NamaJenjangPendidikan == null || famDetail.NamaJenjangPendidikan == "") { ltNewEduDegree.Text = "<div style='text-align:center;'>-</div>"; } else { ltNewEduDegree.Text = famDetail.NamaJenjangPendidikan; } if (famDetail.Bidang == null || famDetail.Bidang == "") { ltNewWorkField.Text = "<div style='text-align:center;'>-</div>"; } else { ltNewWorkField.Text = famDetail.Bidang; } if (famDetailCurrent.Hubungan == "" || famDetailCurrent.Hubungan == null) { ltCurrentRelation.Text = "<div style='text-align:center;'>-</div>"; } else { ltCurrentRelation.Text = famDetailCurrent.Hubungan; } if (famDetailCurrent.NamaLengkap == "" || famDetailCurrent.NamaLengkap == null) { ltCurrentName.Text = "<div style='text-align:center;'>-</div>"; } else { ltCurrentName.Text = famDetailCurrent.NamaLengkap; } if (famDetailCurrent.TempatLahir == "" || famDetailCurrent.TempatLahir == null) { ltCurrentPoB.Text = "<div style='text-align:center;'>-</div>"; } else { ltCurrentPoB.Text = famDetailCurrent.TempatLahir; } if (famDetailCurrent.TglLahir == null) {

L249

ltCurrentDoB.Text = "<div style='text-align:center;'>-</div>"; } else { ltCurrentDoB.Text = DateTime.ParseExact(famDetailCurrent.TglLahir, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } //ltFamilyBasicInfoDoB.Text = famDetailCurrent.TglLahir; if (famDetailCurrent.JenisKelamin == null || famDetailCurrent.JenisKelamin == "") { ltCurrentGender.Text = "<div style='text-align:center;'>-</div>"; } else { ltCurrentGender.Text = famDetailCurrent.JenisKelamin; } if (famDetailCurrent.StatusHidup == null || famDetailCurrent.StatusHidup == "") { ltCurrentStatus.Text = "<div style='text-align:center;'>-</div>"; } else { ltCurrentStatus.Text = famDetailCurrent.StatusHidup; } if (famDetailCurrent.StatusPajak == null || famDetailCurrent.StatusPajak == "") { ltCurrentTaxStatus.Text = "<div style='text-align:center;'>-</div>"; } else { ltCurrentTaxStatus.Text = famDetailCurrent.StatusPajak; } if (famDetailCurrent.NamaJenjangPendidikan == null || famDetailCurrent.NamaJenjangPendidikan == "") { ltCurrentEduDegree.Text = "<div style='text-align:center;'>-</div>"; } else { ltCurrentEduDegree.Text = famDetailCurrent.NamaJenjangPendidikan; } if (famDetailCurrent.Bidang == null || famDetailCurrent.Bidang == "") { ltCurrentWorkField.Text = "<div style='text-align:center;'>-</div>"; } else { ltCurrentWorkField.Text = famDetailCurrent.Bidang; } } } } }

L250

}

• EducationApproval.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.AppFacade; using Business.Entities.Data; namespace BinusianProfile.Approval { public partial class EducationApproval : SecurePage// System.Web.UI.Page { private static string binusianId = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; } List<EducationData> eduData = new EducationSystem().GetEducationCollegeListFromApproval(binusianId); if (eduData.Count == 0) { rptEduCollegeApproval.Visible = false; ltNoteApproval.Visible = true; ltNoteApproval.Text = "You don't have any request of education data"; } else { rptEduCollegeApproval.Visible = true; rptEduCollegeApproval.DataSource = eduData; rptEduCollegeApproval.DataBind(); } } } protected void rptEduCollegeApproval_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { EducationData eduData = (EducationData)e.Item.DataItem; Literal ltNewDegree = (Literal)e.Item.FindControl("ltNewDegree"); Literal ltNewMajor = (Literal)e.Item.FindControl("ltNewMajor"); Literal ltNewInstitution = (Literal)e.Item.FindControl("ltNewInstitution"); Literal ltNewStudentID = (Literal)e.Item.FindControl("ltNewStudentID"); Literal ltNewAddress = (Literal)e.Item.FindControl("ltNewAddress"); Literal ltNewCountry = (Literal)e.Item.FindControl("ltNewCountry"); Literal ltNewProvince = (Literal)e.Item.FindControl("ltNewProvince"); Literal ltNewDistrict = (Literal)e.Item.FindControl("ltNewDistrict"); Literal ltNewSubDistrict = (Literal)e.Item.FindControl("ltNewSubDistrict"); Literal ltNewEnrollment = (Literal)e.Item.FindControl("ltNewEnrollment"); Literal ltNewGraduate = (Literal)e.Item.FindControl("ltNewGraduate"); Literal ltNewGPA = (Literal)e.Item.FindControl("ltNewGPA"); Literal ltNewMinGPA = (Literal)e.Item.FindControl("ltNewMinGPA"); Literal ltNewMaxGPA = (Literal)e.Item.FindControl("ltNewMaxGPA");

L251

Literal ltDateApproval = (Literal)e.Item.FindControl("ltDateApproval"); ltDateApproval.Text = "You have request this change at " + eduData.DateIn.ToString("dd MMMM yyyy"); if (eduData.EduDegree == null || eduData.EduDegree == "") { ltNewDegree.Text = "-"; } else { ltNewDegree.Text = eduData.EduDegree; } if (eduData.EduStudyProgram == null || eduData.EduStudyProgram == "") { ltNewMajor.Text = "-"; } else { ltNewMajor.Text = eduData.EduStudyProgram; } if (eduData.EduInstitution == null || eduData.EduInstitution == "") { ltNewInstitution.Text = "-"; } else { ltNewInstitution.Text = eduData.EduInstitution; } if (eduData.EduStudentId == null || eduData.EduStudentId == "") { ltNewStudentID.Text = "-"; } else { ltNewStudentID.Text = eduData.EduStudentId; } if (eduData.EduInstitutionAddress == null || eduData.EduInstitutionAddress == "") { ltNewAddress.Text = "-"; } else { ltNewAddress.Text = eduData.EduInstitutionAddress; } if (eduData.EduInstitutionCountry == null || eduData.EduInstitutionCountry == "") { ltNewCountry.Text = "-"; } else { ltNewCountry.Text = eduData.EduInstitutionCountry; } if (eduData.EduInstitutionProvince == null || eduData.EduInstitutionProvince == "") { ltNewProvince.Text = "-"; } else { ltNewProvince.Text = eduData.EduInstitutionProvince; }

L252

if (eduData.EduInstitutionDistrict == null || eduData.EduInstitutionDistrict == "") { ltNewDistrict.Text = "-"; } else { ltNewDistrict.Text = eduData.EduInstitutionDistrict; } if (eduData.EduInstitutionSubDistrict == null || eduData.EduInstitutionSubDistrict == "") { ltNewSubDistrict.Text = "-"; } else { ltNewSubDistrict.Text = eduData.EduInstitutionSubDistrict; } if (eduData.EduEnrollmentYear == null || eduData.EduEnrollmentYear == "") { ltNewEnrollment.Text = "-"; } else { ltNewEnrollment.Text = eduData.EduEnrollmentYear; } if (eduData.EduGraduateYear == null || eduData.EduGraduateYear == "") { ltNewGraduate.Text = "-"; } else { ltNewGraduate.Text = eduData.EduGraduateYear; } if (eduData.EduAvgScore == null || eduData.EduAvgScore == "") { ltNewGPA.Text = "-"; } else { ltNewGPA.Text = eduData.EduAvgScore; } if (eduData.EduMinScale == null || eduData.EduMinScale == "") { ltNewMinGPA.Text = "-"; } else { ltNewMinGPA.Text = eduData.EduMinScale; } if (eduData.EduMaxScale == null || eduData.EduMaxScale == "") { ltNewMaxGPA.Text = "-"; } else { ltNewMaxGPA.Text = eduData.EduMaxScale; } Literal ltCurrentDegree = (Literal)e.Item.FindControl("ltCurrentDegree"); Literal ltCurrentMajor = (Literal)e.Item.FindControl("ltCurrentMajor"); Literal ltCurrentInstitution = (Literal)e.Item.FindControl("ltCurrentInstitution"); Literal ltCurrentStudentID = (Literal)e.Item.FindControl("ltCurrentStudentID");

L253

Literal ltCurrentAddress = (Literal)e.Item.FindControl("ltCurrentAddress"); Literal ltCurrentCountry = (Literal)e.Item.FindControl("ltCurrentCountry"); Literal ltCurrentProvince = (Literal)e.Item.FindControl("ltCurrentProvince"); Literal ltCurrentDistrict = (Literal)e.Item.FindControl("ltCurrentDistrict"); Literal ltCurrentSubDistrict = (Literal)e.Item.FindControl("ltCurrentSubDistrict"); Literal ltCurrentEnrollment = (Literal)e.Item.FindControl("ltCurrentEnrollment"); Literal ltCurrentGraduate = (Literal)e.Item.FindControl("ltCurrentGraduate"); Literal ltCurrentGPA = (Literal)e.Item.FindControl("ltCurrentGPA"); Literal ltCurrentMinGPA = (Literal)e.Item.FindControl("ltCurrentMinGPA"); Literal ltCurrentMaxGPA = (Literal)e.Item.FindControl("ltCurrentMaxGPA"); EducationData eduCurrentData = new EducationSystem().GetEducationDetailCollegeById(binusianId, eduData.EduCollegeId); if (eduCurrentData.EduDegree == null || eduCurrentData.EduDegree == "") { ltCurrentDegree.Text = "-"; } else { ltCurrentDegree.Text = eduCurrentData.EduDegree; } if (eduCurrentData.EduStudyProgram == null || eduCurrentData.EduStudyProgram == "") { ltCurrentMajor.Text = "-"; } else { ltCurrentMajor.Text = eduCurrentData.EduStudyProgram; } if (eduCurrentData.EduInstitution == null || eduCurrentData.EduInstitution == "") { ltCurrentInstitution.Text = "-"; } else { ltCurrentInstitution.Text = eduCurrentData.EduInstitution; } if (eduCurrentData.EduStudentId == null || eduCurrentData.EduStudentId == "") { ltCurrentStudentID.Text = "-"; } else { ltCurrentStudentID.Text = eduCurrentData.EduStudentId; } if (eduCurrentData.EduInstitutionAddress == null || eduCurrentData.EduInstitutionAddress == "") { ltCurrentAddress.Text = "-"; } else { ltCurrentAddress.Text = eduCurrentData.EduInstitutionAddress; } if (eduCurrentData.EduInstitutionCountry == null || eduCurrentData.EduInstitutionCountry == "")

L254

{ ltCurrentCountry.Text = "-"; } else { ltCurrentCountry.Text = eduCurrentData.EduInstitutionCountry; } if (eduCurrentData.EduInstitutionProvince == null || eduCurrentData.EduInstitutionProvince == "") { ltCurrentProvince.Text = "-"; } else { ltCurrentProvince.Text = eduCurrentData.EduInstitutionProvince; } if (eduCurrentData.EduInstitutionDistrict == null || eduCurrentData.EduInstitutionDistrict == "") { ltCurrentDistrict.Text = "-"; } else { ltCurrentDistrict.Text = eduCurrentData.EduInstitutionDistrict; } if (eduCurrentData.EduInstitutionSubDistrict == null || eduCurrentData.EduInstitutionSubDistrict == "") { ltCurrentSubDistrict.Text = "-"; } else { ltCurrentSubDistrict.Text = eduCurrentData.EduInstitutionSubDistrict; } if (eduCurrentData.EduEnrollmentYear == null || eduCurrentData.EduEnrollmentYear == "") { ltCurrentEnrollment.Text = "-"; } else { ltCurrentEnrollment.Text = eduCurrentData.EduEnrollmentYear; } if (eduCurrentData.EduGraduateYear == null || eduCurrentData.EduGraduateYear == "") { ltCurrentGraduate.Text = "-"; } else { ltCurrentGraduate.Text = eduCurrentData.EduGraduateYear; } if (eduCurrentData.EduAvgScore == null || eduCurrentData.EduAvgScore == "") { ltCurrentGPA.Text = "-"; } else { ltCurrentGPA.Text = eduCurrentData.EduAvgScore; } if (eduCurrentData.EduMinScale == null || eduCurrentData.EduMinScale == "") {

L255

ltCurrentMinGPA.Text = "-"; } else { ltCurrentMinGPA.Text = eduCurrentData.EduMinScale; } if (eduCurrentData.EduMaxScale == null || eduCurrentData.EduMaxScale == "") { ltCurrentMaxGPA.Text = "-"; } else { ltCurrentMaxGPA.Text = eduCurrentData.EduMaxScale; } } } } }

• NPWPApproval.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.AppFacade; using Business.Entities.Data; namespace BinusianProfile.Approval { public partial class NPWPApproval : SecurePage // System.Web.UI.Page { private static string binusianId = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; } NPWPData npwpDataApp = new NPWPSystem().GetNPWPDetailFromApprovalByBinusianId(binusianId); if (npwpDataApp.NPWPAddress == null && npwpDataApp.NPWPName == null && npwpDataApp.NPWPAddress == null) { pnlApprovalDetail.Visible = false; ltNoteApproval.Visible = true; ltNoteApproval.Text = "You don't have any change request of NPWP information"; } else { pnlApprovalDetail.Visible = true; ltNoteApproval.Visible = true; ltNoteApproval.Text = "You have request this change at " + npwpDataApp.DateIn.ToString("dd MMMM yyyy"); if (npwpDataApp.NPWPNumbers == null || npwpDataApp.NPWPNumbers == "") { ltNewNumbers.Text = "-";

L256

} else { ltNewNumbers.Text = npwpDataApp.NPWPNumbers; } if (npwpDataApp.NPWPName == null || npwpDataApp.NPWPName == "") { ltNewName.Text = "-"; } else { ltNewName.Text = npwpDataApp.NPWPName; } if (npwpDataApp.NPWPAddress == null || npwpDataApp.NPWPAddress == "") { ltNewAddress.Text = "-"; } else { ltNewAddress.Text = npwpDataApp.NPWPAddress; } if (npwpDataApp.NPWPOwner == null || npwpDataApp.NPWPOwner == "") { ltNewOwner.Text = "-"; } else { ltNewOwner.Text = npwpDataApp.NPWPOwner; } if (npwpDataApp.NPWPRegisterDate == null) { ltNewRegisterDate.Text = "-"; } else { ltNewRegisterDate.Text = DateTime.ParseExact(npwpDataApp.NPWPRegisterDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMM yyyy"); ; } if (npwpDataApp.NPWPBranchOffice == null || npwpDataApp.NPWPBranchOffice == "") { ltNewBranch.Text = "-"; } else { ltNewBranch.Text = npwpDataApp.NPWPBranchOffice; } NPWPData npwpData = new NPWPSystem().GetNpwpDetailByBinusianId(binusianId); if (npwpData.NPWPNumbers == null || npwpData.NPWPNumbers == "") { ltCurrentNumbers.Text = "-"; } else { ltCurrentNumbers.Text = npwpData.NPWPNumbers; } if (npwpData.NPWPName == null || npwpData.NPWPName == "") { ltCurrentName.Text = "-"; } else {

L257

ltCurrentName.Text = npwpData.NPWPName; } if (npwpData.NPWPAddress == null || npwpData.NPWPAddress == "") { ltCurrentAddress.Text = "-"; } else { ltCurrentAddress.Text = npwpData.NPWPAddress; } if (npwpData.NPWPOwner == null || npwpData.NPWPOwner == "") { ltCurrentOwner.Text = "-"; } else { ltCurrentOwner.Text = npwpData.NPWPOwner; } if (npwpData.NPWPRegisterDate == "" || npwpData.NPWPRegisterDate == null) { ltCurrentRegisterDate.Text = "-"; } else { ltCurrentRegisterDate.Text = DateTime.ParseExact(npwpData.NPWPRegisterDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMM yyyy"); ; ; } if (npwpData.NPWPBranchOffice == null || npwpData.NPWPBranchOffice == "") { ltCurrentBranch.Text = "-"; } else { ltCurrentBranch.Text = npwpData.NPWPBranchOffice; } } } } } }

• StudentActivityApproval.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.AppFacade; using Business.Entities.Data; using CrossCutting.OptMgmt; namespace BinusianProfile.Approval { public partial class StudentActivity : System.Web.UI.Page { private static string binusianId = ""; private static string binusianRoleId = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack)

L258

{ if (Session["UserData"] != null) { BinusianData binusianData = (BinusianData)Session["UserData"]; binusianId = binusianData.BinusianId; //binusianRoleId = new BinusianSsytem().GetBinusianRole(binusianId); //if (binusianRoleId != "01") //{ // Response.Redirect("PersonalApproval.aspx"); //} if (!new BinusianSsytem().CheckStatusGabungan(binusianId, 4)) { Response.Redirect("PersonalApproval.aspx"); } } List<StudentActivityData> satData = new StudentActivitySystem().GetAllSATHeader(binusianId); if (satData.Count == 0) { rptApprovalSAT.Visible = false; lblNoteApprovalSAT.Visible = true; lblNoteApprovalSAT.Text = "You don't have any submitted student activity"; } else { rptApprovalSAT.Visible = true; rptApprovalSAT.DataSource = satData; rptApprovalSAT.DataBind(); } } } protected void rptApprovalSAT_itemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { StudentActivityData studentActivityData = (StudentActivityData)e.Item.DataItem; HiddenField hdnSATId = (HiddenField)e.Item.FindControl("hdnSATId"); Literal ltActType = (Literal)e.Item.FindControl("ltActType"); Literal ltActDetail = (Literal)e.Item.FindControl("ltActDetail"); Literal ltActLevel = (Literal)e.Item.FindControl("ltActLevel"); Literal ltActRole = (Literal)e.Item.FindControl("ltActRole"); Literal ltActApproveStatus = (Literal)e.Item.FindControl("ltActApproveStatus"); Literal ltActApproveDate = (Literal)e.Item.FindControl("ltActApproveDate"); Literal ltActPoints = (Literal)e.Item.FindControl("ltActPoints"); hdnSATId.Value = studentActivityData.StudentActivityId.ToString().Trim(); ltActType.Text = studentActivityData.ActivityCategory; ltActDetail.Text = "<a href='../Portofolio/DetailStudentActivity.aspx?id=" + HttpUtility.UrlEncode(Encryption64.Encrypt(hdnSATId.Value, SystemConfiguration.EncryptionKey)) + "'>" + studentActivityData.ActivityDetail + "</a>"; ltActLevel.Text = studentActivityData.ActivityLevel; ltActRole.Text = studentActivityData.ActivityRole; ltActApproveStatus.Text = studentActivityData.ActivityStatusApprove; if (studentActivityData.ActivityApproveDate == null) { ltActApproveDate.Text = "-"; } else if(studentActivityData.ActivityStatusApproveId == "0") { ltActApproveDate.Text = "-"; } else {

L259

ltActApproveDate.Text = studentActivityData.ActivityApproveDate.ToString("dd MMMM yyyy"); } if (studentActivityData.ActivityStatusApproveId != "1") { ltActPoints.Text = "-"; } else { ltActPoints.Text = studentActivityData.ActivityPoints.ToString().Trim(); } } } } }

• PersonalAppLecturer.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using UserManagement.CrossCutting.OptMgmt; using UserManagement.Bussiness.AppFacade; using UserManagement.Business.Entities; using CrossCutting.Security; using CrossCutting.OptMgmt; namespace BMv3Home_BackEnd.Personal { public partial class PersonalAppLecturer : SecurePage { private static string binusianid; #region privilege private Int32 _moduleId; public Int32 ModuleId { get { return _moduleId; } set { _moduleId = value; } } private string _loginId; public string LoginId { get { return _loginId; } set { _loginId = value; } } private string _viewAccess; public string ViewAccess { get { return _viewAccess; } set { _viewAccess = value; } } private string _addAccess; public string AddAccess { get { return _addAccess; } set { _addAccess = value; } }

L260

private string _editAccess; public string EditAccess { get { return _editAccess; } set { _editAccess = value; } } private string _deleteAccess; public string DeleteAccess { get { return _deleteAccess; } set { _deleteAccess = value; } } private string _printAccess; public string PrintAccess { get { return _printAccess; } set { _printAccess = value; } } private string _sendAccess; public string SendAccess { get { return _sendAccess; } set { _sendAccess = value; } } private string _uploadAccess; public string UploadAccess { get { return _uploadAccess; } set { _uploadAccess = value; } } private string _dowloadAccess; public string DowloadAccess { get { return _dowloadAccess; } set { _dowloadAccess = value; } } #endregion #region loadPrivilegeData public void LoadAccess() { string accessidlogin = new AccessModuleSystem().getAccesIDGrouporUser(1, LoginId); List<ModuleData> moduleNowData = new ModuleSystem().GetDetailModuleAccessData(new WebConfiguration().AreaId, new WebConfiguration().GAId, new WebConfiguration().AppId, ModuleId, accessidlogin); List<PriviledgeData> allAccessAvailable = new AccessModuleSystem().LoadPriviledge(); List<AccessModuleData> userAccessData = new PriviledgeBMv3().LoadAccess(Convert.ToInt32(moduleNowData[0].Priviledge.ToString().Trim()), allAccessAvailable); foreach (AccessModuleData userAccessDataDetail in userAccessData) { if (userAccessDataDetail.AllowPrivilegeName == "View" && userAccessDataDetail.AllowAccess == 0) { ViewAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Add" && userAccessDataDetail.AllowAccess == 0) { AddAccess = "false"; }

L261

if (userAccessDataDetail.AllowPrivilegeName == "Edit" && userAccessDataDetail.AllowAccess == 0) { EditAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Delete" && userAccessDataDetail.AllowAccess == 0) { DeleteAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Print" && userAccessDataDetail.AllowAccess == 0) { PrintAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Send" && userAccessDataDetail.AllowAccess == 0) { SendAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Upload" && userAccessDataDetail.AllowAccess == 0) { UploadAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Download" && userAccessDataDetail.AllowAccess == 0) { DowloadAccess = "false"; } } } #endregion #region loadpage public void LoadPage() { #region set privilege ViewAccess = "true"; AddAccess = "true"; EditAccess = "true"; DeleteAccess = "true"; PrintAccess = "true"; SendAccess = "true"; UploadAccess = "true"; DowloadAccess = "true"; #endregion string tmpModuleId = ""; tmpModuleId = HttpUtility.HtmlDecode(Rijndael.Decrypt(Request.QueryString["mid"].ToString().Trim(), WebConfiguration.EncryptionKey)); try { ModuleId = Convert.ToInt32(tmpModuleId); } catch (Exception ex) { ModuleId = 0; } if (Session["uid"] != null) { LoginId = Session["uid"].ToString(); }

L262

} #endregion #region ViewState protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } } #endregion protected void ShowData() { List<PersonalData> dataSetSource = new List<PersonalData>(); dataSetSource = new PersonalSystem().getListPersonalApp(ddlOrder.SelectedItem.Value.Trim(), ddlOrderType.SelectedItem.Value.Trim(), ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), SystemConfiguration.PagingSumPerPage, CurrPage, 2); if (dataSetSource.Count == 0) { rptPersonalApp.Visible = false; ucPagingControl.Visible = false; litNoData.Visible = true; } else { litNoData.Visible = false; rptPersonalApp.Visible = true; ucPagingControl.Visible = true; rptPersonalApp.DataSource = dataSetSource; rptPersonalApp.DataBind(); } } #region Paging private void FillPaging() { int countPage = new PersonalSystem().getListPersonalAppCount(ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(),2); litTotalRequest.Text = countPage.ToString().Trim(); int sumPage = 1; if (countPage % SystemConfiguration.PagingSumPerPage == 0) {

L263

sumPage = countPage / SystemConfiguration.PagingSumPerPage; } else { sumPage = countPage / SystemConfiguration.PagingSumPerPage + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); } #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData _binusianData = (BinusianData)Session["UserData"]; binusianid = _binusianData.BinusianId.Trim(); } LoadPage(); LoadAccess();

L264

ddlOrder.Items.Add(new ListItem("Date", "MsBinusianApproval.DateIn")); ddlOrder.Items.Add(new ListItem("Binusian Id", "MsBinusianApproval.binusianid")); ddlOrder.Items.Add(new ListItem("Name", "NamaNonGelar")); ddlSearch.Items.Add(new ListItem("Binusian Id", "MsBinusianApproval.binusianid")); ddlSearch.Items.Add(new ListItem("Name", "NamaNonGelar")); SaveViewStates(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; FillPaging(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; ShowData(); } else { ucPagingControl.DataBind(); } } protected void rptPersonalApp_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { PersonalData _data = (PersonalData)e.Item.DataItem; Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); Literal litName = (Literal)e.Item.FindControl("litName"); Literal litDate = (Literal)e.Item.FindControl("litDate"); Literal litReligionCurrent = (Literal)e.Item.FindControl("litReligionCurrent"); Literal litReligionNew = (Literal)e.Item.FindControl("litReligionNew"); Literal litMaritalCurrent = (Literal)e.Item.FindControl("litMaritalCurrent"); Literal litMaritalNew = (Literal)e.Item.FindControl("litMaritalNew"); Literal litNationalityCurrent = (Literal)e.Item.FindControl("litNationalityCurrent"); Literal litNationalityNew = (Literal)e.Item.FindControl("litNationalityNew"); Literal litCardCurrent = (Literal)e.Item.FindControl("litCardCurrent"); Literal litCardNew = (Literal)e.Item.FindControl("litCardNew"); LinkButton lnkSubmit = (LinkButton)e.Item.FindControl("lnkSubmit"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); pnlError.Visible = false; pnlSuccess.Visible = false; litBinusianId.Text = _data.BinusianId; litDate.Text = _data.DateIn.ToString("dd MMMM yyyy").Trim(); litMaritalNew.Text = _data.NamaMarital; litName.Text = _data.NamaNonGelar; litNationalityNew.Text = _data.Nationality; litReligionNew.Text = _data.NamaAgama; litCardNew.Text = _data.CardFileName; PersonalData _currentData = new PersonalSystem().GetPersonalDataByBinusianId(_data.BinusianId); litMaritalCurrent.Text = _currentData.NamaMarital;

L265

litNationalityCurrent.Text = _currentData.Nationality; litReligionCurrent.Text = _currentData.NamaAgama; litCardCurrent.Text = _currentData.CardFileName; lnkSubmit.CommandName = "Submit"; lnkSubmit.CommandArgument = _data.BinusianId; lnkSubmit.Attributes.Add("onclick", "return confirm('Are You Sure Want To Submit This Data');"); } } protected void rptPersonalApp_ItemCommand(object sender, RepeaterCommandEventArgs e) { Literal litError = (Literal)e.Item.FindControl("litError"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); if (e.CommandName == "Submit") { pnlSuccess.Visible = false; pnlError.Visible = false; RadioButton rdApprove = (RadioButton)e.Item.FindControl("rdApprove"); RadioButton rdDeny = (RadioButton)e.Item.FindControl("rdDeny"); TextBox txtComment = (TextBox)e.Item.FindControl("txtComment"); if (rdDeny.Checked == false && rdApprove.Checked == false) { pnlError.Visible = true; litError.Text = "You Must Choose The Approval Type (Yes / No)."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() == "") { pnlError.Visible = true; litError.Text = "You Must Fill The Comment Field."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() != "") { bool success = new PersonalSystem().InsertUpdateApprovalPersonal(litBinusianId.Text.Trim(), 2, binusianid, txtComment.Text.Trim()); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } if (rdApprove.Checked == true) { bool success = new PersonalSystem().InsertUpdateApprovalPersonal(litBinusianId.Text.Trim(), 1, binusianid, ""); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true;

L266

} } } } protected void btnSearch_Click(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlSearch_SelectedIndexChanged(object sender, EventArgs e) { } protected void ddlOrder_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlOrderType_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } } }

• PersonalAppStaff.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using UserManagement.CrossCutting.OptMgmt; using UserManagement.Bussiness.AppFacade; using UserManagement.Business.Entities; using CrossCutting.Security; using CrossCutting.OptMgmt; namespace BMv3Home_BackEnd.Personal { public partial class PersonalAppStaff : SecurePage { private static string binusianid; #region privilege private Int32 _moduleId; public Int32 ModuleId { get { return _moduleId; } set { _moduleId = value; } } private string _loginId; public string LoginId { get { return _loginId; } set { _loginId = value; } }

L267

private string _viewAccess; public string ViewAccess { get { return _viewAccess; } set { _viewAccess = value; } } private string _addAccess; public string AddAccess { get { return _addAccess; } set { _addAccess = value; } } private string _editAccess; public string EditAccess { get { return _editAccess; } set { _editAccess = value; } } private string _deleteAccess; public string DeleteAccess { get { return _deleteAccess; } set { _deleteAccess = value; } } private string _printAccess; public string PrintAccess { get { return _printAccess; } set { _printAccess = value; } } private string _sendAccess; public string SendAccess { get { return _sendAccess; } set { _sendAccess = value; } } private string _uploadAccess; public string UploadAccess { get { return _uploadAccess; } set { _uploadAccess = value; } } private string _dowloadAccess; public string DowloadAccess { get { return _dowloadAccess; } set { _dowloadAccess = value; } } #endregion #region loadPrivilegeData public void LoadAccess() { string accessidlogin = new AccessModuleSystem().getAccesIDGrouporUser(1, LoginId); List<ModuleData> moduleNowData = new ModuleSystem().GetDetailModuleAccessData(new WebConfiguration().AreaId, new WebConfiguration().GAId, new WebConfiguration().AppId, ModuleId, accessidlogin); List<PriviledgeData> allAccessAvailable = new AccessModuleSystem().LoadPriviledge();

L268

List<AccessModuleData> userAccessData = new PriviledgeBMv3().LoadAccess(Convert.ToInt32(moduleNowData[0].Priviledge.ToString().Trim()), allAccessAvailable); foreach (AccessModuleData userAccessDataDetail in userAccessData) { if (userAccessDataDetail.AllowPrivilegeName == "View" && userAccessDataDetail.AllowAccess == 0) { ViewAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Add" && userAccessDataDetail.AllowAccess == 0) { AddAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Edit" && userAccessDataDetail.AllowAccess == 0) { EditAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Delete" && userAccessDataDetail.AllowAccess == 0) { DeleteAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Print" && userAccessDataDetail.AllowAccess == 0) { PrintAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Send" && userAccessDataDetail.AllowAccess == 0) { SendAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Upload" && userAccessDataDetail.AllowAccess == 0) { UploadAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Download" && userAccessDataDetail.AllowAccess == 0) { DowloadAccess = "false"; } } } #endregion #region loadpage public void LoadPage() { #region set privilege ViewAccess = "true"; AddAccess = "true"; EditAccess = "true"; DeleteAccess = "true"; PrintAccess = "true"; SendAccess = "true"; UploadAccess = "true"; DowloadAccess = "true"; #endregion string tmpModuleId = ""; tmpModuleId = HttpUtility.HtmlDecode(Rijndael.Decrypt(Request.QueryString["mid"].ToString().Trim(), WebConfiguration.EncryptionKey));

L269

try { ModuleId = Convert.ToInt32(tmpModuleId); } catch (Exception ex) { ModuleId = 0; } if (Session["uid"] != null) { LoginId = Session["uid"].ToString(); } } #endregion #region ViewState protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } } #endregion protected void ShowData() { List<PersonalData> dataSetSource = new List<PersonalData>(); dataSetSource = new PersonalSystem().getListPersonalApp(ddlOrder.SelectedItem.Value.Trim(), ddlOrderType.SelectedItem.Value.Trim(), ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), SystemConfiguration.PagingSumPerPage, CurrPage, 3); if (dataSetSource.Count == 0) { rptPersonalApp.Visible = false; ucPagingControl.Visible = false; litNoData.Visible = true; } else { litNoData.Visible = false; rptPersonalApp.Visible = true; ucPagingControl.Visible = true; rptPersonalApp.DataSource = dataSetSource; rptPersonalApp.DataBind();

L270

} } #region Paging private void FillPaging() { int countPage = new PersonalSystem().getListPersonalAppCount(ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), 3); litTotalRequest.Text = countPage.ToString().Trim(); int sumPage = 1; if (countPage % SystemConfiguration.PagingSumPerPage == 0) { sumPage = countPage / SystemConfiguration.PagingSumPerPage; } else { sumPage = countPage / SystemConfiguration.PagingSumPerPage + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); } #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging();

L271

} protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData _binusianData = (BinusianData)Session["UserData"]; binusianid = _binusianData.BinusianId.Trim(); } LoadPage(); LoadAccess(); ddlOrder.Items.Add(new ListItem("Date", "MsBinusianApproval.DateIn")); ddlOrder.Items.Add(new ListItem("Binusian Id", "MsBinusianApproval.binusianid")); ddlOrder.Items.Add(new ListItem("Name", "NamaNonGelar")); ddlSearch.Items.Add(new ListItem("Binusian Id", "MsBinusianApproval.binusianid")); ddlSearch.Items.Add(new ListItem("Name", "NamaNonGelar")); SaveViewStates(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; FillPaging(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; ShowData(); } else { ucPagingControl.DataBind(); } } protected void rptPersonalApp_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { PersonalData _data = (PersonalData)e.Item.DataItem; Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); Literal litName = (Literal)e.Item.FindControl("litName"); Literal litDate = (Literal)e.Item.FindControl("litDate"); Literal litReligionCurrent = (Literal)e.Item.FindControl("litReligionCurrent"); Literal litReligionNew = (Literal)e.Item.FindControl("litReligionNew"); Literal litMaritalCurrent = (Literal)e.Item.FindControl("litMaritalCurrent"); Literal litMaritalNew = (Literal)e.Item.FindControl("litMaritalNew"); Literal litNationalityCurrent = (Literal)e.Item.FindControl("litNationalityCurrent"); Literal litNationalityNew = (Literal)e.Item.FindControl("litNationalityNew"); Literal litCardCurrent = (Literal)e.Item.FindControl("litCardCurrent"); Literal litCardNew = (Literal)e.Item.FindControl("litCardNew"); LinkButton lnkSubmit = (LinkButton)e.Item.FindControl("lnkSubmit"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess");

L272

pnlError.Visible = false; pnlSuccess.Visible = false; litBinusianId.Text = _data.BinusianId; litDate.Text = _data.DateIn.ToString("dd MMMM yyyy").Trim(); litMaritalNew.Text = _data.NamaMarital; litName.Text = _data.NamaNonGelar; litNationalityNew.Text = _data.Nationality; litReligionNew.Text = _data.NamaAgama; litCardNew.Text = _data.CardFileName; PersonalData _currentData = new PersonalSystem().GetPersonalDataByBinusianId(_data.BinusianId); litMaritalCurrent.Text = _currentData.NamaMarital; litNationalityCurrent.Text = _currentData.Nationality; litReligionCurrent.Text = _currentData.NamaAgama; litCardCurrent.Text = _currentData.CardFileName; lnkSubmit.CommandName = "Submit"; lnkSubmit.CommandArgument = _data.BinusianId; lnkSubmit.Attributes.Add("onclick", "return confirm('Are You Sure Want To Submit This Data');"); } } protected void rptPersonalApp_ItemCommand(object sender, RepeaterCommandEventArgs e) { Literal litError = (Literal)e.Item.FindControl("litError"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); if (e.CommandName == "Submit") { pnlSuccess.Visible = false; pnlError.Visible = false; RadioButton rdApprove = (RadioButton)e.Item.FindControl("rdApprove"); RadioButton rdDeny = (RadioButton)e.Item.FindControl("rdDeny"); TextBox txtComment = (TextBox)e.Item.FindControl("txtComment"); if (rdDeny.Checked == false && rdApprove.Checked == false) { pnlError.Visible = true; litError.Text = "You Must Choose The Approval Type (Yes / No)."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() == "") { pnlError.Visible = true; litError.Text = "You Must Fill The Comment Field."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() != "") { bool success = new PersonalSystem().InsertUpdateApprovalPersonal(litBinusianId.Text.Trim(), 2, binusianid, txtComment.Text.Trim()); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData();

L273

pnlSuccess.Visible = true; } } if (rdApprove.Checked == true) { bool success = new PersonalSystem().InsertUpdateApprovalPersonal(litBinusianId.Text.Trim(), 1, binusianid, ""); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } } } protected void btnSearch_Click(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlSearch_SelectedIndexChanged(object sender, EventArgs e) { } protected void ddlOrder_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlOrderType_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } } }

• PersonalAppStudent.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business.Entities.Data; using Business.AppFacade; using UserManagement.CrossCutting.OptMgmt; using UserManagement.Bussiness.AppFacade; using UserManagement.Business.Entities; using CrossCutting.Security; using CrossCutting.OptMgmt; namespace BMv3Home_BackEnd.Personal { public partial class PersonalAppStudent : SecurePage {

L274

private static string binusianid; #region privilege private Int32 _moduleId; public Int32 ModuleId { get { return _moduleId; } set { _moduleId = value; } } private string _loginId; public string LoginId { get { return _loginId; } set { _loginId = value; } } private string _viewAccess; public string ViewAccess { get { return _viewAccess; } set { _viewAccess = value; } } private string _addAccess; public string AddAccess { get { return _addAccess; } set { _addAccess = value; } } private string _editAccess; public string EditAccess { get { return _editAccess; } set { _editAccess = value; } } private string _deleteAccess; public string DeleteAccess { get { return _deleteAccess; } set { _deleteAccess = value; } } private string _printAccess; public string PrintAccess { get { return _printAccess; } set { _printAccess = value; } } private string _sendAccess; public string SendAccess { get { return _sendAccess; } set { _sendAccess = value; } } private string _uploadAccess; public string UploadAccess { get { return _uploadAccess; } set { _uploadAccess = value; } } private string _dowloadAccess; public string DowloadAccess {

L275

get { return _dowloadAccess; } set { _dowloadAccess = value; } } #endregion #region loadPrivilegeData public void LoadAccess() { string accessidlogin = new AccessModuleSystem().getAccesIDGrouporUser(1, LoginId); List<ModuleData> moduleNowData = new ModuleSystem().GetDetailModuleAccessData(new WebConfiguration().AreaId, new WebConfiguration().GAId, new WebConfiguration().AppId, ModuleId, accessidlogin); List<PriviledgeData> allAccessAvailable = new AccessModuleSystem().LoadPriviledge(); List<AccessModuleData> userAccessData = new PriviledgeBMv3().LoadAccess(Convert.ToInt32(moduleNowData[0].Priviledge.ToString().Trim()), allAccessAvailable); foreach (AccessModuleData userAccessDataDetail in userAccessData) { if (userAccessDataDetail.AllowPrivilegeName == "View" && userAccessDataDetail.AllowAccess == 0) { ViewAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Add" && userAccessDataDetail.AllowAccess == 0) { AddAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Edit" && userAccessDataDetail.AllowAccess == 0) { EditAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Delete" && userAccessDataDetail.AllowAccess == 0) { DeleteAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Print" && userAccessDataDetail.AllowAccess == 0) { PrintAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Send" && userAccessDataDetail.AllowAccess == 0) { SendAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Upload" && userAccessDataDetail.AllowAccess == 0) { UploadAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Download" && userAccessDataDetail.AllowAccess == 0) { DowloadAccess = "false"; } } } #endregion #region loadpage public void LoadPage() { #region set privilege

L276

ViewAccess = "true"; AddAccess = "true"; EditAccess = "true"; DeleteAccess = "true"; PrintAccess = "true"; SendAccess = "true"; UploadAccess = "true"; DowloadAccess = "true"; #endregion string tmpModuleId = ""; tmpModuleId = HttpUtility.HtmlDecode(Rijndael.Decrypt(Request.QueryString["mid"].ToString().Trim(), WebConfiguration.EncryptionKey)); try { ModuleId = Convert.ToInt32(tmpModuleId); } catch (Exception ex) { ModuleId = 0; } if (Session["uid"] != null) { LoginId = Session["uid"].ToString(); } } #endregion #region ViewState protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } } #endregion protected void ShowData() { List<PersonalData> dataSetSource = new List<PersonalData>(); dataSetSource = new PersonalSystem().getListPersonalApp(ddlOrder.SelectedItem.Value.Trim(),ddlOrderType.Selec

L277

tedItem.Value.Trim(), ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(), SystemConfiguration.PagingSumPerPage, CurrPage,1); if (dataSetSource.Count == 0) { rptPersonalApp.Visible = false; ucPagingControl.Visible = false; litNoData.Visible = true; } else { litNoData.Visible = false; rptPersonalApp.Visible = true; ucPagingControl.Visible = true; rptPersonalApp.DataSource = dataSetSource; rptPersonalApp.DataBind(); } } #region Paging private void FillPaging() { int countPage = new PersonalSystem().getListPersonalAppCount(ddlSearch.SelectedItem.Value.Trim(), txtSearch.Text.Trim(),1); litTotalRequest.Text = countPage.ToString().Trim(); int sumPage = 1; if (countPage % SystemConfiguration.PagingSumPerPage == 0) { sumPage = countPage / SystemConfiguration.PagingSumPerPage; } else { sumPage = countPage / SystemConfiguration.PagingSumPerPage + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); } #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1;

L278

ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserData"] != null) { BinusianData _binusianData = (BinusianData)Session["UserData"]; binusianid = _binusianData.BinusianId.Trim(); } LoadPage(); LoadAccess(); ddlOrder.Items.Add(new ListItem("Date","MsBinusianApproval.DateIn")); ddlOrder.Items.Add(new ListItem("Binusian Id","MsBinusianApproval.binusianid")); ddlOrder.Items.Add(new ListItem("Name","NamaNonGelar")); ddlSearch.Items.Add(new ListItem("Binusian Id","MsBinusianApproval.binusianid")); ddlSearch.Items.Add(new ListItem("Name","NamaNonGelar")); SaveViewStates(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; FillPaging(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; ShowData(); } else { ucPagingControl.DataBind(); } } protected void rptPersonalApp_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { PersonalData _data =(PersonalData) e.Item.DataItem; Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); Literal litName = (Literal)e.Item.FindControl("litName"); Literal litDate = (Literal)e.Item.FindControl("litDate");

L279

Literal litReligionCurrent = (Literal)e.Item.FindControl("litReligionCurrent"); Literal litReligionNew = (Literal)e.Item.FindControl("litReligionNew"); Literal litMaritalCurrent = (Literal)e.Item.FindControl("litMaritalCurrent"); Literal litMaritalNew = (Literal)e.Item.FindControl("litMaritalNew"); Literal litNationalityCurrent = (Literal)e.Item.FindControl("litNationalityCurrent"); Literal litNationalityNew = (Literal)e.Item.FindControl("litNationalityNew"); Literal litCardCurrent = (Literal)e.Item.FindControl("litCardCurrent"); Literal litCardNew = (Literal)e.Item.FindControl("litCardNew"); LinkButton lnkSubmit = (LinkButton)e.Item.FindControl("lnkSubmit"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); pnlError.Visible = false; pnlSuccess.Visible = false; litBinusianId.Text = _data.BinusianId; litDate.Text = _data.DateIn.ToString("dd MMMM yyyy").Trim(); litMaritalNew.Text = _data.NamaMarital; litName.Text = _data.NamaNonGelar; litNationalityNew.Text = _data.Nationality; litReligionNew.Text = _data.NamaAgama; litCardNew.Text = _data.CardFileName; PersonalData _currentData = new PersonalSystem().GetPersonalDataByBinusianId(_data.BinusianId); litMaritalCurrent.Text = _currentData.NamaMarital; litNationalityCurrent.Text = _currentData.Nationality; litReligionCurrent.Text = _currentData.NamaAgama; litCardCurrent.Text = _currentData.CardFileName; lnkSubmit.CommandName = "Submit"; lnkSubmit.CommandArgument = _data.BinusianId; lnkSubmit.Attributes.Add("onclick", "return confirm('Are You Sure Want To Submit This Data');"); } } protected void rptPersonalApp_ItemCommand(object sender, RepeaterCommandEventArgs e) { Literal litError = (Literal)e.Item.FindControl("litError"); Panel pnlError = (Panel)e.Item.FindControl("pnlError"); Panel pnlSuccess = (Panel)e.Item.FindControl("pnlSuccess"); Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); if (e.CommandName == "Submit") { pnlSuccess.Visible = false; pnlError.Visible = false; RadioButton rdApprove = (RadioButton) e.Item.FindControl("rdApprove"); RadioButton rdDeny = (RadioButton) e.Item.FindControl("rdDeny"); TextBox txtComment = (TextBox)e.Item.FindControl("txtComment"); if (rdDeny.Checked == false && rdApprove.Checked == false) { pnlError.Visible = true; litError.Text = "You Must Choose The Approval Type (Yes / No)."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() == "") {

L280

pnlError.Visible = true; litError.Text = "You Must Fill The Comment Field."; litError.Visible = true; return; } if (rdDeny.Checked == true && txtComment.Text.Trim() != "") { bool success = new PersonalSystem().InsertUpdateApprovalPersonal(litBinusianId.Text.Trim(), 2, binusianid, txtComment.Text.Trim()); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } if (rdApprove.Checked == true) { bool success = new PersonalSystem().InsertUpdateApprovalPersonal(litBinusianId.Text.Trim(), 1, binusianid, ""); if (success) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); pnlSuccess.Visible = true; } } } } protected void btnSearch_Click(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlSearch_SelectedIndexChanged(object sender, EventArgs e) { } protected void ddlOrder_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } protected void ddlOrderType_SelectedIndexChanged(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } } }

L281

• ActivityApp.aspx.cs

using System; using System.Collections; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Xml.Linq; using Infragistics.WebUI.UltraWebGrid; using Business.AppFacade; using Business.Entities; using CrossCutting.Security; using CrossCutting.OptMgmt; using UserManagement.CrossCutting.OptMgmt; using UserManagement.Bussiness.AppFacade; using UserManagement.Business.Entities; namespace BMv3Home_BackEnd.Activity { public partial class ActivityApp : SecurePage//System.Web.UI.Page { #region privilege private Int32 _moduleId; public Int32 ModuleId { get { return _moduleId; } set { _moduleId = value; } } private string _loginId; public string LoginId { get { return _loginId; } set { _loginId = value; } } private string _viewAccess; public string ViewAccess { get { return _viewAccess; } set { _viewAccess = value; } } private string _addAccess; public string AddAccess { get { return _addAccess; } set { _addAccess = value; } } private string _editAccess; public string EditAccess { get { return _editAccess; } set { _editAccess = value; } } private string _deleteAccess; public string DeleteAccess

L282

{ get { return _deleteAccess; } set { _deleteAccess = value; } } private string _printAccess; public string PrintAccess { get { return _printAccess; } set { _printAccess = value; } } private string _sendAccess; public string SendAccess { get { return _sendAccess; } set { _sendAccess = value; } } private string _uploadAccess; public string UploadAccess { get { return _uploadAccess; } set { _uploadAccess = value; } } private string _dowloadAccess; public string DowloadAccess { get { return _dowloadAccess; } set { _dowloadAccess = value; } } #endregion #region loadPrivilegeData public void LoadAccess() { string accessidlogin = new AccessModuleSystem().getAccesIDGrouporUser(1, LoginId); List<ModuleData> moduleNowData = new ModuleSystem().GetDetailModuleAccessData(new WebConfiguration().AreaId, new WebConfiguration().GAId, new WebConfiguration().AppId, ModuleId, accessidlogin); List<PriviledgeData> allAccessAvailable = new AccessModuleSystem().LoadPriviledge(); List<AccessModuleData> userAccessData = new PriviledgeBMv3().LoadAccess(Convert.ToInt32(moduleNowData[0].Priviledge.ToString().Trim()), allAccessAvailable); foreach (AccessModuleData userAccessDataDetail in userAccessData) { if (userAccessDataDetail.AllowPrivilegeName == "View" && userAccessDataDetail.AllowAccess == 0) { ViewAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Add" && userAccessDataDetail.AllowAccess == 0) { AddAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Edit" && userAccessDataDetail.AllowAccess == 0) { EditAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Delete" && userAccessDataDetail.AllowAccess == 0) { DeleteAccess = "false"; }

L283

if (userAccessDataDetail.AllowPrivilegeName == "Print" && userAccessDataDetail.AllowAccess == 0) { PrintAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Send" && userAccessDataDetail.AllowAccess == 0) { SendAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Upload" && userAccessDataDetail.AllowAccess == 0) { UploadAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Download" && userAccessDataDetail.AllowAccess == 0) { DowloadAccess = "false"; } } } #endregion #region loadpage public void LoadPage() { #region set privilege ViewAccess = "true"; AddAccess = "true"; EditAccess = "true"; DeleteAccess = "true"; PrintAccess = "true"; SendAccess = "true"; UploadAccess = "true"; DowloadAccess = "true"; #endregion string tmpModuleId = ""; tmpModuleId = HttpUtility.HtmlDecode(Rijndael.Decrypt(Request.QueryString["mid"].ToString().Trim(), WebConfiguration.EncryptionKey)); try { ModuleId = Convert.ToInt32(tmpModuleId); } catch(Exception ex) { ModuleId = 0; } if (Session["uid"] != null) { LoginId = Session["uid"].ToString(); } } #endregion #region ViewState protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); }

L284

set { ViewState["CurrPage"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } } #endregion protected void ShowData() { DataSet dataSetSource = new DataSet(); dataSetSource = new ActivitySystem().GetActivityPendingBySeachDataSetPaging(Convert.ToInt32(ddlSearch.SelectedItem.Value), txtSearch.Text.Trim(), SystemConfiguration.PagingSumPerPage, CurrPage); if (dataSetSource.Tables[0].Rows.Count == 0) { ultraWebGrid1.Visible = false; ucPagingControl.Visible = false; litNoData.Visible = true; } else { litNoData.Visible = false; ultraWebGrid1.Visible = true; ucPagingControl.Visible = true; ultraWebGrid1.DataSource = dataSetSource; ultraWebGrid1.DataBind(); } } #region Paging private void FillPaging() { int countPage = new ActivitySystem().GetActivityPendingBySeachCountData(Convert.ToInt32(ddlSearch.SelectedItem.Value),txtSearch.Text.Trim()); litTotal.Text = countPage.ToString(); int sumPage = 1; if (countPage % SystemConfiguration.PagingSumPerPage == 0) { sumPage = countPage / SystemConfiguration.PagingSumPerPage; } else { sumPage = countPage / SystemConfiguration.PagingSumPerPage + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind();

L285

} #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1) ; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1) ; } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LoadPage(); LoadAccess(); lnkHistory.PostBackUrl = "~/Activity/ActivityHistory.aspx?mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString()); litNavigasi.Text += " >> Activity"; ddlSearch.Items.Add(new ListItem("Binusian Id", "1")); ddlSearch.Items.Add(new ListItem("Name", "2")); SaveViewStates(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; FillPaging(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; ShowData(); } else

L286

{ ucPagingControl.DataBind(); } } protected void ultraWebGrid_InitializeRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e) { LinkButton Detail = new LinkButton(); Detail.Text = @"<a href='ActivityDetail.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.Row.Cells[0].Text, SystemConfiguration.EncryptionKey)) + "&mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString()) + "'>See Detail</a>"; //<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/edit.gif' alt='Edit' /> e.Row.Cells[3].Text = Detail.Text; } protected void ultraWebGrid_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e) { e.Layout.Bands[0].Columns[0].Header.Caption = "Binusian ID"; e.Layout.Bands[0].Columns[0].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[0].Width = 100; e.Layout.Bands[0].Columns[1].Header.Caption = "Name"; e.Layout.Bands[0].Columns[1].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[1].Width = 300; e.Layout.Bands[0].Columns[2].Header.Caption = "Date Requested"; e.Layout.Bands[0].Columns[2].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[2].CellStyle.Width = 100; e.Layout.Bands[0].Columns[2].Format = "dd MMM yyyy"; e.Layout.Bands[0].Columns.Add("Action", "ACTION"); } protected void ddlSearch_SelectedIndexChanged(object sender, EventArgs e) { } protected void btnSearch_Click(object sender, EventArgs e) { FillPaging(); ucPagingControl.CurrentPage = CurrPage; ShowData(); } } }

• ActivityDetail.aspx.cs

using System; using System.Collections; using System.Configuration;

L287

using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Xml.Linq; using Infragistics.WebUI.UltraWebGrid; using Business.AppFacade; using Business.Entities.Data; using CrossCutting.Security; using CrossCutting.OptMgmt; using UserManagement.CrossCutting.OptMgmt; using System.Collections.Generic; using UserManagement.Bussiness.AppFacade; using UserManagement.Business.Entities; namespace BMv3Home_BackEnd.Activity { public partial class ActivityDetail : SecurePage// System.Web.UI.Page { #region privilege private Int32 _moduleId; public Int32 ModuleId { get { return _moduleId; } set { _moduleId = value; } } private string _loginId; public string LoginId { get { return _loginId; } set { _loginId = value; } } private string _viewAccess; public string ViewAccess { get { return _viewAccess; } set { _viewAccess = value; } } private string _addAccess; public string AddAccess { get { return _addAccess; } set { _addAccess = value; } } private string _editAccess; public string EditAccess { get { return _editAccess; } set { _editAccess = value; } } private string _deleteAccess; public string DeleteAccess { get { return _deleteAccess; } set { _deleteAccess = value; } } private string _printAccess;

L288

public string PrintAccess { get { return _printAccess; } set { _printAccess = value; } } private string _sendAccess; public string SendAccess { get { return _sendAccess; } set { _sendAccess = value; } } private string _uploadAccess; public string UploadAccess { get { return _uploadAccess; } set { _uploadAccess = value; } } private string _dowloadAccess; public string DowloadAccess { get { return _dowloadAccess; } set { _dowloadAccess = value; } } #endregion #region loadPrivilegeData public void LoadAccess() { string accessidlogin = new AccessModuleSystem().getAccesIDGrouporUser(1, LoginId); List<ModuleData> moduleNowData = new ModuleSystem().GetDetailModuleAccessData(new WebConfiguration().AreaId, new WebConfiguration().GAId, new WebConfiguration().AppId, ModuleId, accessidlogin); List<PriviledgeData> allAccessAvailable = new AccessModuleSystem().LoadPriviledge(); List<AccessModuleData> userAccessData = new PriviledgeBMv3().LoadAccess(Convert.ToInt32(moduleNowData[0].Priviledge.ToString().Trim()), allAccessAvailable); foreach (AccessModuleData userAccessDataDetail in userAccessData) { if (userAccessDataDetail.AllowPrivilegeName == "View" && userAccessDataDetail.AllowAccess == 0) { ViewAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Add" && userAccessDataDetail.AllowAccess == 0) { AddAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Edit" && userAccessDataDetail.AllowAccess == 0) { EditAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Delete" && userAccessDataDetail.AllowAccess == 0) { DeleteAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Print" && userAccessDataDetail.AllowAccess == 0) { PrintAccess = "false"; }

L289

if (userAccessDataDetail.AllowPrivilegeName == "Send" && userAccessDataDetail.AllowAccess == 0) { SendAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Upload" && userAccessDataDetail.AllowAccess == 0) { UploadAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Download" && userAccessDataDetail.AllowAccess == 0) { DowloadAccess = "false"; } } } #endregion #region loadpage public void LoadPage() { #region set privilege ViewAccess = "true"; AddAccess = "true"; EditAccess = "true"; DeleteAccess = "true"; PrintAccess = "true"; SendAccess = "true"; UploadAccess = "true"; DowloadAccess = "true"; #endregion string tmpModuleId = ""; tmpModuleId = HttpUtility.HtmlDecode(Rijndael.Decrypt(Request.QueryString["mid"].ToString().Trim(), WebConfiguration.EncryptionKey)); try { ModuleId = Convert.ToInt32(tmpModuleId); } catch (Exception ex) { ModuleId = 0; } if (Session["uid"] != null) { LoginId = Session["uid"].ToString(); } } #endregion #region ViewState protected int CurrPagePending { get { return Convert.ToInt32(ViewState["CurrPagePending"]); } set { ViewState["CurrPagePending"] = value;

L290

} } protected int CurrPageCore { get { return Convert.ToInt32(ViewState["CurrPageCore"]); } set { ViewState["CurrPageCore"] = value; } } protected int CurrPageOptional { get { return Convert.ToInt32(ViewState["CurrPageOptional"]); } set { ViewState["CurrPageOptional"] = value; } } #endregion protected static int sumCore = 0,sumOptional = 0,sumAll = 0; protected Boolean isDecline { get { return (Request.QueryString["Decline"] != null && Request.QueryString["Decline"] != ""); } } protected Boolean isApprove { get { return (Request.QueryString["Approve"] != null && Request.QueryString["Approve"] != ""); } } protected string BinusianId { get { return Convert.ToString(ViewState["BinusianId"]); } set { ViewState["BinusianId"] = value; } } protected int IdSAT { get { return Convert.ToInt32(ViewState["IdSAT"]); } set

L291

{ ViewState["IdSAT"] = value; } } protected int isViewDetail { get { return Convert.ToInt32(ViewState["isViewDetail"]); } set { ViewState["isViewDetail"] = value; } } private static int currentpagePending, currentPageCore, currentPageOptional; private void SaveViewStates() { if (Request.QueryString["id"] != null) { string temp = Request.QueryString["id"].ToString().Trim(); temp = temp.Replace(" ", "+"); BinusianId = Convert.ToString(HttpUtility.UrlDecode(Rijndael.Decrypt(temp))); } if (Request.QueryString["isViewDetail"] != null) { isViewDetail = Convert.ToInt32(Request.QueryString["isViewDetail"]); } if (Request.QueryString["idSAT"] != null) { string temp = Request.QueryString["idSAT"].ToString().Trim(); temp = temp.Replace(" ", "+"); IdSAT = Convert.ToInt32(HttpUtility.UrlDecode(Rijndael.Decrypt(temp))); } if (isViewDetail != 1) { if (Request.QueryString["pgP"] != null) { CurrPagePending = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pgP"])); } else { CurrPagePending = (ucPagingControlPending.CurrentPage == 0) ? 1 : 0; } if (Request.QueryString["pgC"] != null) { CurrPageCore = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pgC"])); } else { CurrPageCore = (ucPagingControlCore.CurrentPage == 0) ? 1 : 0; } if (Request.QueryString["pgO"] != null) { CurrPageOptional = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pgO"])); } else

L292

{ CurrPageOptional = (ucPagingControlOptional.CurrentPage == 0) ? 1 : 0; } } else { if (currentPageCore == 0) { currentPageCore = 1; } if (currentPageOptional == 0) { currentPageOptional = 1; } if (currentpagePending == 0) { currentpagePending = 1; } CurrPageCore = currentPageCore; CurrPageOptional = currentPageOptional; CurrPagePending = currentpagePending; } } protected void ShowData() { DataSet dataSetSource = new DataSet(); dataSetSource = new ActivitySystem().GetActivityPendingDetailByDataSetPaging(BinusianId, SystemConfiguration.PagingSumPerPage, CurrPagePending); if (dataSetSource.Tables[0].Rows.Count == 0) { uwgRequestedActivity.Visible = false; ucPagingControlPending.Visible = false; litNoDataGridPending.Visible = true; } else { litNoDataGridPending.Visible = false; uwgRequestedActivity.Visible = true; ucPagingControlPending.Visible = true; uwgRequestedActivity.DataSource = dataSetSource; uwgRequestedActivity.DataBind(); } dataSetSource = new ActivitySystem().GetActivityCoreDetailByDataSetPaging(BinusianId, SystemConfiguration.PagingSumPerPage, CurrPageCore); if (dataSetSource.Tables[0].Rows.Count == 0) { uwgCoreApproved.Visible = false; ucPagingControlCore.Visible = false; litNoDataCoreGrid.Visible = true; } else { litNoDataCoreGrid.Visible = false; uwgCoreApproved.Visible = true; ucPagingControlCore.Visible = true; uwgCoreApproved.DataSource = dataSetSource; uwgCoreApproved.DataBind(); }

L293

dataSetSource = new ActivitySystem().GetActivityOptionalDetailByDataSetPaging(BinusianId, SystemConfiguration.PagingSumPerPage, CurrPageOptional); if (dataSetSource.Tables[0].Rows.Count == 0) { uwgOptionalApproved.Visible = false; ucPagingControlOptional.Visible = false; litOptionalNoData.Visible = true; } else { litOptionalNoData.Visible = false; uwgOptionalApproved.Visible = true; ucPagingControlOptional.Visible = true; uwgOptionalApproved.DataSource = dataSetSource; uwgOptionalApproved.DataBind(); } litTotalPoint.Text = (sumOptional + sumCore).ToString(); litPointCore.Text = sumCore.ToString(); litOptionalPoint.Text = sumOptional.ToString(); } #region Paging private void FillPaging() { int countPagePending = new ActivitySystem().GetActivityPendingDetailByDataSetPagingCount(BinusianId); int sumPagePending = 1; if (countPagePending % SystemConfiguration.PagingSumPerPage == 0) { sumPagePending = countPagePending / SystemConfiguration.PagingSumPerPage; } else { sumPagePending = countPagePending / SystemConfiguration.PagingSumPerPage + 1; } ucPagingControlPending.SumPage = sumPagePending; ucPagingControlPending.Clear(); ucPagingControlPending.DataBind(); int countPageCore = new ActivitySystem().GetActivityCoreDetailByDataSetPagingCount(BinusianId); int sumPageCore = 1; if (countPageCore % SystemConfiguration.PagingSumPerPage == 0) { sumPageCore = countPageCore / SystemConfiguration.PagingSumPerPage; } else { sumPageCore = countPageCore / SystemConfiguration.PagingSumPerPage + 1; } ucPagingControlCore.SumPage = sumPageCore; ucPagingControlCore.Clear(); ucPagingControlCore.DataBind();

L294

int countPageOptional = new ActivitySystem().GetActivityOptionalDetailByDataSetPagingCount(BinusianId); int sumPageOptional = 1; if (countPageOptional % SystemConfiguration.PagingSumPerPage == 0) { sumPageOptional = countPageOptional / SystemConfiguration.PagingSumPerPage; } else { sumPageOptional = countPageOptional / SystemConfiguration.PagingSumPerPage + 1; } ucPagingControlOptional.SumPage = sumPageOptional; ucPagingControlOptional.Clear(); ucPagingControlOptional.DataBind(); } #endregion public void LinkPagingPending_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControlPending.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControlPending.CurrentPage = ucPagingControlPending.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControlPending.CurrentPage = (ucPagingControlPending.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControlPending.CurrentPage = (ucPagingControlPending.CurrentPage - 1); } else { ucPagingControlPending.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPagePending = ucPagingControlPending.CurrentPage; currentpagePending = ucPagingControlPending.CurrentPage; ShowData(); FillPaging(); }

L295

public void LinkPagingOptional_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControlOptional.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControlOptional.CurrentPage = ucPagingControlOptional.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControlOptional.CurrentPage = (ucPagingControlOptional.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControlOptional.CurrentPage = (ucPagingControlOptional.CurrentPage - 1); } else { ucPagingControlOptional.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPageOptional = ucPagingControlOptional.CurrentPage; currentPageOptional = ucPagingControlOptional.CurrentPage; ShowData(); FillPaging(); } public void LinkPagingCore_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControlCore.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControlCore.CurrentPage = ucPagingControlCore.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControlCore.CurrentPage = (ucPagingControlCore.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControlCore.CurrentPage = (ucPagingControlCore.CurrentPage - 1); } else { ucPagingControlCore.CurrentPage = Convert.ToInt32(linkButton.ID); }

L296

CurrPageCore = ucPagingControlCore.CurrentPage; currentPageCore = ucPagingControlCore.CurrentPage; ShowData(); FillPaging(); } protected void Page_Load(object sender, EventArgs e) { sumCore = 0; sumOptional = 0; sumAll = 0; if (!IsPostBack) { litNavigasi.Text += " >><a href='ActivityApp.aspx?mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString()) + "'>Activity</a>>> Activity Detail"; litErrorAccept.Visible = false; litErrorDeny.Visible = false; pnlNoDataBinusian.Visible = false; pnlData.Visible = true; if (Request.QueryString["id"] == null) { Response.Redirect("~/Activity/ActivityApp.aspx?mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString())); } else { SaveViewStates(); ucPagingControlPending.CurrentPage = CurrPagePending; ucPagingControlOptional.CurrentPage = CurrPageOptional; ucPagingControlCore.CurrentPage = CurrPageCore; FillPaging(); ucPagingControlPending.CurrentPage = CurrPagePending; ucPagingControlOptional.CurrentPage = CurrPageOptional; ucPagingControlCore.CurrentPage = CurrPageCore; ddlSearch.Items.Clear(); ddlSearch.Items.Add(new ListItem("Binusian Id", "1")); lnkHistory.PostBackUrl = "~/Activity/ActivityHistory.aspx?bid=" + HttpUtility.UrlEncode(Rijndael.Encrypt(BinusianId, SystemConfiguration.EncryptionKey)) + "&mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString()); BinusianData _userData = new BinusianSystem().GetUserDataByBinusianId(BinusianId.Trim()); litBinusianId.Text = BinusianId; litNameBinusian.Text = _userData.Name; ShowData(); if (isViewDetail == 1) { StudentActivityData satData = new ActivitySystem().GetSATDetail2(IdSAT); litDateRequestedDetail.Text = DateTime.ParseExact(satData.DateRequested, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); litBinusianIdDetail.Text = satData.Nimhs; litName.Text = satData.Name;

L297

ltSATCategory.Text = satData.ActivityCategory; if (satData.ApproveBy == "-") { pnlApproveBy.Visible = false; } else { pnlApproveBy.Visible = true; litApprovedBy.Text = satData.ApproveBy.Trim() + " - " + satData.ApproveByName.Trim(); } if (satData.ActivityCategoryId == "2") { pnlBlog.Visible = true; pnlPublication.Visible = false; pnlOther.Visible = false; ltSATBlogURL.Text = "<a href='" + satData.ActivityDetail + "'>" + satData.ActivityDetail + "</a>"; ltSATBlogDate.Text = DateTime.ParseExact(satData.ActivityStartDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } else if (satData.ActivityCategoryId == "17") { pnlBlog.Visible = false; pnlPublication.Visible = true; pnlOther.Visible = false; ltSATPublicationTitle.Text = satData.ActivityDetail; ltSATPublicationMediaType.Text = satData.MediaType; ltSATPublicationMediaName.Text = satData.MediaName; ltSATPublicationLevel.Text = satData.ActivityLevel; ltSATPublicationRole.Text = satData.ActivityRole; ltSATPublicationDate.Text = DateTime.ParseExact(satData.ActivityStartDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } else { pnlBlog.Visible = false; pnlPublication.Visible = false; pnlOther.Visible = true; ltSATOtherName.Text = satData.ActivityDetail; ltSATOtherPlace.Text = satData.ActivityPlace; ltSATOtherLevel.Text = satData.ActivityLevel; ltSATOtherRole.Text = satData.ActivityRole; ltSATOtherStartDate.Text = DateTime.ParseExact(satData.ActivityStartDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); ltSATOtherEndDate.Text = DateTime.ParseExact(satData.ActivityEndDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } modalDetail.Show(); } if (isDecline) { modalDeclined.Show(); litBinusianDecline.Text = BinusianId + " - " +_userData.Name; StudentActivityData _data = new ActivitySystem().GetSATDetail2(IdSAT);

L298

ltSATCategoryDeny.Text = _data.ActivityCategory; if (_data.ApproveBy == "-") { pnlApproveByDeny.Visible = false; } else { pnlApproveByDeny.Visible = true; litApprovedByDeny.Text = _data.ApproveBy.Trim() + " - " + _data.ApproveByName.Trim(); } if (_data.ActivityCategoryId == "2") { pnlBlogDeny.Visible = true; pnlPublicationDeny.Visible = false; pnlOtherDeny.Visible = false; ltSATBlogURLDeny.Text = "<a href='" + _data.ActivityDetail + "'>" + _data.ActivityDetail + "</a>"; ltSATBlogDateDeny.Text = DateTime.ParseExact(_data.ActivityStartDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } else if (_data.ActivityCategoryId == "17") { pnlBlogDeny.Visible = false; pnlPublicationDeny.Visible = true; pnlOtherDeny.Visible = false; ltSATPublicationTitleDeny.Text = _data.ActivityDetail; ltSATPublicationMediaTypeDeny.Text = _data.MediaType; ltSATPublicationMediaNameDeny.Text = _data.MediaName; ltSATPublicationLevelDeny.Text = _data.ActivityLevel; ltSATPublicationRoleDeny.Text = _data.ActivityRole; ltSATPublicationDateDeny.Text = DateTime.ParseExact(_data.ActivityStartDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } else { pnlBlogDeny.Visible = false; pnlPublicationDeny.Visible = false; pnlOtherDeny.Visible = true; ltSATOtherNameDeny.Text = _data.ActivityDetail; ltSATOtherPlaceDeny.Text = _data.ActivityPlace; ltSATOtherLevelDeny.Text = _data.ActivityLevel; ltSATOtherRoleDeny.Text = _data.ActivityRole; ltSATOtherStartDateDeny.Text = DateTime.ParseExact(_data.ActivityStartDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); ltSATOtherEndDateDeny.Text = DateTime.ParseExact(_data.ActivityEndDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } litPointDecline.Text = _data.ActivityPoints.ToString(); } else if (isApprove) { modalAccept.Show(); litBinusianAccept.Text = BinusianId + " - " + _userData.Name; StudentActivityData _data = new ActivitySystem().GetSATDetail2(IdSAT);

L299

ltSATCategoryAccept.Text = _data.ActivityCategory; if (_data.ApproveBy == "-") { pnlApproveByAccept.Visible = false; } else { pnlApproveByAccept.Visible = true; litApprovedByAccept.Text = _data.ApproveBy.Trim() + " - " + _data.ApproveByName.Trim(); } if (_data.ActivityCategoryId == "2") { pnlBlogAccept.Visible = true; pnlPublicationAccept.Visible = false; pnlOtherAccept.Visible = false; ltSATBlogURLAccept.Text = "<a href='" + _data.ActivityDetail + "'>" + _data.ActivityDetail + "</a>"; ltSATBlogDateAccept.Text = DateTime.ParseExact(_data.ActivityStartDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } else if (_data.ActivityCategoryId == "17") { pnlBlogAccept.Visible = false; pnlPublicationAccept.Visible = true; pnlOtherAccept.Visible = false; ltSATPublicationTitleAccept.Text = _data.ActivityDetail; ltSATPublicationMediaTypeAccept.Text = _data.MediaType; ltSATPublicationMediaNameAccept.Text = _data.MediaName; ltSATPublicationLevelAccept.Text = _data.ActivityLevel; ltSATPublicationRoleAccept.Text = _data.ActivityRole; ltSATPublicationDateAccept.Text = DateTime.ParseExact(_data.ActivityStartDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } else { pnlBlogAccept.Visible = false; pnlPublicationAccept.Visible = false; pnlOtherAccept.Visible = true; ltSATOtherNameAccept.Text = _data.ActivityDetail; ltSATOtherPlaceAccept.Text = _data.ActivityPlace; ltSATOtherLevelAccept.Text = _data.ActivityLevel; ltSATOtherRoleAccept.Text = _data.ActivityRole; ltSATOtherStartDateAccept.Text = DateTime.ParseExact(_data.ActivityStartDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); ltSATOtherEndDateAccept.Text = DateTime.ParseExact(_data.ActivityEndDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } txtPointAccept.Text = _data.ActivityPoints.ToString(); } } } else { ucPagingControlPending.DataBind(); ucPagingControlCore.DataBind();

L300

ucPagingControlOptional.DataBind(); } } protected void uwgRequestedActivity_InitializeRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e) { TextBox Point = new TextBox(); LinkButton Approve = new LinkButton(); LinkButton Decline = new LinkButton(); Point.Text = e.Row.Cells[5].Text; Approve.Text = @"<a href='ActivityDetail.aspx?Approve=1&idSAT=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.Row.Cells[6].Text, SystemConfiguration.EncryptionKey)) + "&id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(BinusianId, SystemConfiguration.EncryptionKey)) + "&mid=" + Request.QueryString["mid"].ToString() + "'>Approve</a>"; //<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/edit.gif' alt='Edit' /> Decline.Text = @"<a href='ActivityDetail.aspx?Decline=1&idSAT=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.Row.Cells[6].Text, SystemConfiguration.EncryptionKey)) + "&id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(BinusianId, SystemConfiguration.EncryptionKey)) + "&mid=" + Request.QueryString["mid"].ToString() + "'>Decline</a>"; LinkButton ActType = new LinkButton(); ActType.Text = @"<a href='ActivityDetail.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(BinusianId, SystemConfiguration.EncryptionKey)) + "&isViewDetail=1&idSAT=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.Row.Cells[6].Text, SystemConfiguration.EncryptionKey)) + "&mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString()) + "'>" + e.Row.Cells[0].Text + "</a>"; e.Row.Cells[0].Text = ActType.Text; LinkButton ActName = new LinkButton(); ActName.Text = @"<a href='ActivityDetail.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(BinusianId, SystemConfiguration.EncryptionKey)) + "&isViewDetail=1&idSAT=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.Row.Cells[6].Text, SystemConfiguration.EncryptionKey)) + "&mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString()) + "'>" + e.Row.Cells[1].Text + "</a>"; e.Row.Cells[1].Text = ActName.Text; e.Row.Cells[9].Text = Point.Text; e.Row.Cells[10].Text = Approve.Text + " | " + Decline.Text; } protected void uwgRequestedActivity_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e) { e.Layout.Bands[0].Columns[0].Header.Caption = "Activity Type"; e.Layout.Bands[0].Columns[0].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[0].Width = 120; e.Layout.Bands[0].Columns[1].Header.Caption = "Name / Title"; e.Layout.Bands[0].Columns[1].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[1].Width = 150; e.Layout.Bands[0].Columns[2].Header.Caption = "Category"; e.Layout.Bands[0].Columns[2].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[2].Width = 60; e.Layout.Bands[0].Columns[3].Header.Caption = "Role"; e.Layout.Bands[0].Columns[3].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[3].Width = 100; e.Layout.Bands[0].Columns[4].Header.Caption = "Date Requested"; e.Layout.Bands[0].Columns[4].CellStyle.Wrap = true;

L301

e.Layout.Bands[0].Columns[4].CellStyle.Width = 60; e.Layout.Bands[0].Columns[4].Format = "dd MMM yyyy"; e.Layout.Bands[0].Columns[5].Hidden = true; e.Layout.Bands[0].Columns[6].Hidden = true; e.Layout.Bands[0].Columns[7].Hidden = true; e.Layout.Bands[0].Columns[8].Hidden = true; e.Layout.Bands[0].Columns.Add("Points", "Points"); e.Layout.Bands[0].Columns[9].Width = 50; //e.Layout.Bands[0].Columns[9].Type = Infragistics.WebUI.UltraWebGrid.ColumnType.Custom; //e.Layout.Bands[0].Columns[9].AllowUpdate = Infragistics.WebUI.UltraWebGrid.AllowUpdate.Yes; e.Layout.Bands[0].Columns.Add("Action", "Action"); e.Layout.Bands[0].Columns[10].Width = 120; } protected void uwgCoreApproved_InitializeRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e) { LinkButton ActType = new LinkButton(); ActType.Text = @"<a href='ActivityDetail.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(BinusianId, SystemConfiguration.EncryptionKey)) + "&isViewDetail=1&idSAT=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.Row.Cells[6].Text, SystemConfiguration.EncryptionKey)) + "&mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString()) + "'>" + e.Row.Cells[0].Text + "</a>"; e.Row.Cells[0].Text = ActType.Text; LinkButton ActName = new LinkButton(); ActName.Text = @"<a href='ActivityDetail.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(BinusianId, SystemConfiguration.EncryptionKey)) + "&isViewDetail=1&idSAT=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.Row.Cells[6].Text, SystemConfiguration.EncryptionKey)) + "&mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString()) + "'>" + e.Row.Cells[1].Text + "</a>"; e.Row.Cells[1].Text = ActName.Text; sumCore = Convert.ToInt32(e.Row.Cells[8].Text); LinkButton Edit = new LinkButton(); LinkButton Delete = new LinkButton(); Edit.Text = @"<a href='ActivityDetail.aspx?Approve=1&idSAT=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.Row.Cells[6].Text, SystemConfiguration.EncryptionKey)) + "&id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(BinusianId, SystemConfiguration.EncryptionKey)) + "&mid=" + Request.QueryString["mid"].ToString() + "'>Edit</a>"; Delete.Text = @"<a href='ActivityDetail.aspx?Decline=1&idSAT=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.Row.Cells[6].Text, SystemConfiguration.EncryptionKey)) + "&id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(BinusianId, SystemConfiguration.EncryptionKey)) + "&mid=" + Request.QueryString["mid"].ToString() + "'>Delete</a>"; e.Row.Cells[9].Text = Edit.Text + " | " + Delete.Text; } protected void uwgCoreApproved_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e) { e.Layout.Bands[0].Columns[0].Header.Caption = "Activity Type"; e.Layout.Bands[0].Columns[0].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[0].Width = 120;

L302

e.Layout.Bands[0].Columns[1].Header.Caption = "Name / Title"; e.Layout.Bands[0].Columns[1].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[1].Width = 150; e.Layout.Bands[0].Columns[2].Header.Caption = "Role"; e.Layout.Bands[0].Columns[2].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[2].Width = 100; e.Layout.Bands[0].Columns[3].Header.Caption = "Level"; e.Layout.Bands[0].Columns[3].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[3].Width = 100; e.Layout.Bands[0].Columns[4].Header.Caption = "Date Approved"; e.Layout.Bands[0].Columns[4].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[4].CellStyle.Width = 60; e.Layout.Bands[0].Columns[4].Format = "dd MMM yyyy"; e.Layout.Bands[0].Columns[5].Header.Caption = "Points"; e.Layout.Bands[0].Columns[5].Width = 50; e.Layout.Bands[0].Columns[6].Hidden = true; e.Layout.Bands[0].Columns[7].Hidden = true; e.Layout.Bands[0].Columns[8].Hidden = true; e.Layout.Bands[0].Columns.Add("Action", "Action"); e.Layout.Bands[0].Columns[9].Width = 80; } protected void uwgOptionalApproved_InitializeRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e) { LinkButton ActType = new LinkButton(); ActType.Text = @"<a href='ActivityDetail.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(BinusianId, SystemConfiguration.EncryptionKey)) + "&isViewDetail=1&idSAT=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.Row.Cells[6].Text, SystemConfiguration.EncryptionKey)) + "&mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString()) + "'>" + e.Row.Cells[0].Text + "</a>"; e.Row.Cells[0].Text = ActType.Text; LinkButton ActName = new LinkButton(); ActName.Text = @"<a href='ActivityDetail.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(BinusianId, SystemConfiguration.EncryptionKey)) + "&isViewDetail=1&idSAT=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.Row.Cells[6].Text, SystemConfiguration.EncryptionKey)) + "&mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString()) + "'>" + e.Row.Cells[1].Text + "</a>"; e.Row.Cells[1].Text = ActName.Text; sumOptional = Convert.ToInt32(e.Row.Cells[8].Text); LinkButton Edit = new LinkButton(); LinkButton Delete = new LinkButton(); Edit.Text = @"<a href='ActivityDetail.aspx?Approve=1&idSAT=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.Row.Cells[6].Text, SystemConfiguration.EncryptionKey)) + "&id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(BinusianId, SystemConfiguration.EncryptionKey)) + "&mid=" + Request.QueryString["mid"].ToString() + "'>Edit</a>"; Delete.Text = @"<a href='ActivityDetail.aspx?Decline=1&idSAT=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.Row.Cells[6].Text, SystemConfiguration.EncryptionKey)) + "&id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(BinusianId, SystemConfiguration.EncryptionKey)) + "&mid=" + Request.QueryString["mid"].ToString() + "'>Delete</a>"; e.Row.Cells[9].Text = Edit.Text + " | " + Delete.Text; }

L303

protected void uwgOptionalApproved_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e) { e.Layout.Bands[0].Columns[0].Header.Caption = "Activity Type"; e.Layout.Bands[0].Columns[0].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[0].Width = 120; e.Layout.Bands[0].Columns[1].Header.Caption = "Name / Title"; e.Layout.Bands[0].Columns[1].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[1].Width = 150; e.Layout.Bands[0].Columns[2].Header.Caption = "Role"; e.Layout.Bands[0].Columns[2].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[2].Width = 100; e.Layout.Bands[0].Columns[3].Header.Caption = "Level"; e.Layout.Bands[0].Columns[3].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[3].Width = 100; e.Layout.Bands[0].Columns[4].Header.Caption = "Date Approved"; e.Layout.Bands[0].Columns[4].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[4].CellStyle.Width = 60; e.Layout.Bands[0].Columns[4].Format = "dd MMM yyyy"; e.Layout.Bands[0].Columns[5].Header.Caption = "Points"; e.Layout.Bands[0].Columns[5].Width = 50; e.Layout.Bands[0].Columns[6].Hidden = true; e.Layout.Bands[0].Columns[7].Hidden = true; e.Layout.Bands[0].Columns[8].Hidden = true; e.Layout.Bands[0].Columns.Add("Action", "Action"); e.Layout.Bands[0].Columns[9].Width = 80; } protected void ddlSearch_SelectedIndexChanged(object sender, EventArgs e) { } protected void btnSearch_Click(object sender, EventArgs e) { BinusianId = txtSearch.Text; BinusianData _userData = new BinusianSystem().GetUserDataByBinusianId(BinusianId.Trim()); if (_userData != null) { litBinusianId.Text = BinusianId; lnkHistory.PostBackUrl = "~/Activity/ActivityHistory.aspx?bid=" + HttpUtility.UrlEncode(Rijndael.Encrypt(BinusianId, SystemConfiguration.EncryptionKey)) + "&mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString()); litNameBinusian.Text = _userData.Name; pnlData.Visible = true; pnlNoDataBinusian.Visible = false; CurrPagePending = 1; CurrPageCore = 1; CurrPageOptional = 1; currentPageCore = 1; currentPageOptional = 1; currentpagePending = 1; ucPagingControlPending.CurrentPage = CurrPagePending; ucPagingControlCore.CurrentPage = CurrPageCore; ucPagingControlOptional.CurrentPage = CurrPageOptional;

L304

FillPaging(); ucPagingControlPending.CurrentPage = CurrPagePending; ucPagingControlCore.CurrentPage = CurrPageCore; ucPagingControlOptional.CurrentPage = CurrPageOptional; ShowData(); } else { pnlData.Visible = false; pnlNoDataBinusian.Visible = true; } } protected void btnSubmitDeny_Click(object sender, EventArgs e) { litErrorDeny.Visible = false; if (txtComment.Text.Trim().Length <= 0) { litErrorDeny.Visible = true; litErrorDeny.Text = "Comment Must Be Filled"; return; } string userid = ((BinusianData) Session["UserData"]).BinusianId.Trim(); new ActivitySystem().UpdateApprovalStudentActivity(IdSAT, BinusianId, "2", userid, txtComment.Text.Trim(), Convert.ToInt32(litPointDecline.Text)); SaveViewStates(); ddlSearch.Items.Clear(); ddlSearch.Items.Add(new ListItem("Binusian Id", "1")); BinusianData _userData = new BinusianSystem().GetUserDataByBinusianId(BinusianId.Trim()); litBinusianId.Text = BinusianId; litNameBinusian.Text = _userData.Name; CurrPagePending = 1; CurrPageCore = 1; CurrPageOptional = 1; currentPageCore = 1; currentPageOptional = 1; currentpagePending = 1; ucPagingControlPending.CurrentPage = CurrPagePending; ucPagingControlCore.CurrentPage = CurrPageCore; ucPagingControlOptional.CurrentPage = CurrPageOptional; FillPaging(); ucPagingControlPending.CurrentPage = CurrPagePending; ucPagingControlCore.CurrentPage = CurrPageCore; ucPagingControlOptional.CurrentPage = CurrPageOptional; ShowData(); } protected void btnSubmitAccept_Click(object sender, EventArgs e) { litErrorAccept.Visible = false; litErrorAccept.Text = ""; if (txtPointAccept.Text.Trim() == "") { litErrorAccept.Visible = true; litErrorAccept.Text = "Point Must Be Filled"; return; } try

L305

{ if (Convert.ToInt32(txtPointAccept.Text) < 0) { litErrorAccept.Visible = true; litErrorAccept.Text = "Point Must Be Greater Than 0"; return; } } catch (Exception ex) { } string userid = ((BinusianData)Session["UserData"]).BinusianId.Trim(); new ActivitySystem().UpdateApprovalStudentActivity(IdSAT, BinusianId, "1", userid, "", Convert.ToInt32(txtPointAccept.Text)); SaveViewStates(); ddlSearch.Items.Clear(); ddlSearch.Items.Add(new ListItem("Binusian Id", "1")); BinusianData _userData = new BinusianSystem().GetUserDataByBinusianId(BinusianId.Trim()); litBinusianId.Text = BinusianId; litNameBinusian.Text = _userData.Name; CurrPagePending = 1; CurrPageCore = 1; CurrPageOptional = 1; currentPageCore = 1; currentPageOptional = 1; currentpagePending = 1; ucPagingControlPending.CurrentPage = CurrPagePending; ucPagingControlCore.CurrentPage = CurrPageCore; ucPagingControlOptional.CurrentPage = CurrPageOptional; FillPaging(); ucPagingControlPending.CurrentPage = CurrPagePending; ucPagingControlCore.CurrentPage = CurrPageCore; ucPagingControlOptional.CurrentPage = CurrPageOptional; ShowData(); } } }

• ActivityHistory.aspx.cs

using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Xml.Linq; using Infragistics.WebUI.UltraWebGrid; using Business.AppFacade; using Business.Entities.Data; using CrossCutting.Security; using CrossCutting.OptMgmt; namespace BMv3Home_BackEnd.Activity

L306

{ public partial class ActivityHistory : SecurePage// System.Web.UI.Page { #region ViewState protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } } protected int isViewDetail { get { return Convert.ToInt32(ViewState["isViewDetail"]); } set { ViewState["isViewDetail"] = value; } } protected int IdSAT { get { return Convert.ToInt32(ViewState["IdSAT"]); } set { ViewState["IdSAT"] = value; } } private void SaveViewStates() { if (Request.QueryString["idSAT"] != null) { string temp = Request.QueryString["idSAT"].ToString().Trim(); temp = temp.Replace(" ", "+"); IdSAT = Convert.ToInt32(Rijndael.Decrypt(temp)); } if (Request.QueryString["isViewDetail"] != null) { isViewDetail = Convert.ToInt32(Request.QueryString["isViewDetail"]); } if (isViewDetail != 1) { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } } else { if (currentpage == 0) { currentpage = 1; }

L307

CurrPage = currentpage; } } #endregion protected void ShowData() { DataSet dataSetSource = new DataSet(); dataSetSource = new ActivitySystem().GetActivityHistoryBySeachDataSetPaging(Convert.ToInt32(ddlSearch.SelectedItem.Value), txtSearch.Text.Trim(), SystemConfiguration.PagingSumPerPage, CurrPage); if (dataSetSource.Tables[0].Rows.Count == 0) { ultraWebGrid1.Visible = false; ucPagingControl.Visible = false; litNoData.Visible = true; } else { litNoData.Visible = false; ultraWebGrid1.Visible = true; ucPagingControl.Visible = true; ultraWebGrid1.DataSource = dataSetSource; ultraWebGrid1.DataBind(); } } #region Paging private void FillPaging() { int countPage = new ActivitySystem().GetActivityHistoryBySeachCountData(Convert.ToInt32(ddlSearch.SelectedItem.Value), txtSearch.Text.Trim()); int sumPage = 1; if (countPage % SystemConfiguration.PagingSumPerPage == 0) { sumPage = countPage / SystemConfiguration.PagingSumPerPage; } else { sumPage = countPage / SystemConfiguration.PagingSumPerPage + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); } #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1;

L308

// ucPagingControl.CurrentPageBlock = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; // ucPagingControl.CurrentPageBlock = ucPagingControl.SumPageBlock; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; currentpage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } private static string bid; private static int currentpage; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BinusianData binusianData = (BinusianData)Session["UserData"]; string binusianId = binusianData.BinusianId; ddlSearch.Items.Add(new ListItem("Binusian Id", "1")); ddlSearch.Items.Add(new ListItem("Name", "2")); if (Request.QueryString["bid"] != null) { string tempBid = Request.QueryString["bid"].ToString().Trim(); tempBid = tempBid.Replace(" ", "+"); bid = Rijndael.Decrypt(tempBid, SystemConfiguration.EncryptionKey); txtSearch.Text = bid; ddlSearch.SelectedIndex = 0; litNavigasi.Text += " >><a href='ActivityApp.aspx?mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString()) + "'>Activity</a>>><a href='ActivityDetail.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(bid)) + "&mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString()) + "'>Activity Detail</a>>> Activity History"; } else { litNavigasi.Text += " >><a href='ActivityApp.aspx?mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString()) + "'>Activity</a>>> Activity History"; } SaveViewStates();

L309

ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPageBlock; FillPaging(); ucPagingControl.CurrentPage = CurrPage; //ucPagingControl.CurrentPageBlock = CurrPageBlock; ShowData(); if (isViewDetail == 1) { StudentActivityData satData = new ActivitySystem().GetSATDetail2(IdSAT); litDateRequested.Text = DateTime.ParseExact(satData.DateRequested, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); litBinusianId.Text = satData.Nimhs; litName.Text = satData.Name; ltSATCategory.Text = satData.ActivityCategory; if (satData.ApproveBy == "-") { pnlApproveBy.Visible = false; } else { pnlApproveBy.Visible = true; litApprovedBy.Text = satData.ApproveBy.Trim() + " - " + satData.ApproveByName.Trim(); } if (satData.ActivityCategoryId == "2") { pnlBlog.Visible = true; pnlPublication.Visible = false; pnlOther.Visible = false; ltSATBlogURL.Text = "<a href='" + satData.ActivityDetail + "'>" + satData.ActivityDetail + "</a>"; ltSATBlogDate.Text = DateTime.ParseExact(satData.ActivityStartDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } else if (satData.ActivityCategoryId == "17") { pnlBlog.Visible = false; pnlPublication.Visible = true; pnlOther.Visible = false; ltSATPublicationTitle.Text = satData.ActivityDetail; ltSATPublicationMediaType.Text = satData.MediaType; ltSATPublicationMediaName.Text = satData.MediaName; ltSATPublicationLevel.Text = satData.ActivityLevel; ltSATPublicationRole.Text = satData.ActivityRole; ltSATPublicationDate.Text = DateTime.ParseExact(satData.ActivityStartDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } else { pnlBlog.Visible = false; pnlPublication.Visible = false; pnlOther.Visible = true;

L310

ltSATOtherName.Text = satData.ActivityDetail; ltSATOtherPlace.Text = satData.ActivityPlace; ltSATOtherLevel.Text = satData.ActivityLevel; ltSATOtherRole.Text = satData.ActivityRole; ltSATOtherStartDate.Text = DateTime.ParseExact(satData.ActivityStartDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); ltSATOtherEndDate.Text = DateTime.ParseExact(satData.ActivityEndDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd MMMM yyyy"); } modalDetail.Show(); } } else { ucPagingControl.DataBind(); } } protected void ultraWebGrid_InitializeRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e) { string binusianid = e.Row.Cells[0].Text.Trim(); LinkButton BinusianId = new LinkButton(); BinusianId.Text = @"<a href='ActivityDetail.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.Row.Cells[0].Text, SystemConfiguration.EncryptionKey)) + "&mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString()) + "'>" + e.Row.Cells[0].Text + "</a>"; e.Row.Cells[0].Text = BinusianId.Text; LinkButton Name = new LinkButton(); Name.Text = @"<a href='ActivityDetail.aspx?id=" + HttpUtility.UrlEncode(Rijndael.Encrypt(binusianid, SystemConfiguration.EncryptionKey)) + "&mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString()) + "'>" + e.Row.Cells[1].Text + "</a>"; e.Row.Cells[1].Text = Name.Text; LinkButton Detail = new LinkButton(); string bid2 = ""; if (bid != null && bid != "") { bid2 = HttpUtility.UrlEncode(Rijndael.Encrypt(bid, SystemConfiguration.EncryptionKey)); Detail.Text = @"<a href='ActivityHistory.aspx?bid="+bid2+ "&isViewDetail=1&idSAT=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.Row.Cells[5].Text, SystemConfiguration.EncryptionKey)) + "&mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString()) + "'>See Detail</a>"; } else { Detail.Text = @"<a href='ActivityHistory.aspx?isViewDetail=1&idSAT=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.Row.Cells[5].Text, SystemConfiguration.EncryptionKey)) + "&mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"].ToString()) + "'>See Detail</a>"; } //<img src='" + PathHelper.AppVirtualDirectory + @"common/images/icon/edit.gif' alt='Edit' /> e.Row.Cells[6].Text = Detail.Text;

L311

} protected void ultraWebGrid_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e) { e.Layout.Bands[0].Columns[0].Header.Caption = "Binusian ID"; e.Layout.Bands[0].Columns[0].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[0].Width = 80; e.Layout.Bands[0].Columns[1].Header.Caption = "Name"; e.Layout.Bands[0].Columns[1].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[1].Width = 200; e.Layout.Bands[0].Columns[2].Header.Caption = "Date Requested"; e.Layout.Bands[0].Columns[2].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[2].CellStyle.Width = 100; e.Layout.Bands[0].Columns[2].Format = "dd MMM yyyy"; e.Layout.Bands[0].Columns[3].Header.Caption = "Approval Status"; e.Layout.Bands[0].Columns[3].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[3].CellStyle.Width = 40; e.Layout.Bands[0].Columns[4].Header.Caption = "Comment"; e.Layout.Bands[0].Columns[4].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[4].CellStyle.Width = 120; e.Layout.Bands[0].Columns[5].Header.Caption = "idsat"; e.Layout.Bands[0].Columns[5].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[5].Hidden = true; e.Layout.Bands[0].Columns.Add("Action", "ACTION"); e.Layout.Bands[0].Columns[6].CellStyle.Width = 70; e.Layout.Bands[0].Columns[6].Type = ColumnType.Custom; } protected void ddlSearch_SelectedIndexChanged(object sender, EventArgs e) { } protected void btnSearch_Click(object sender, EventArgs e) { currentpage = 1; CurrPage = 1; FillPaging(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPageBlock; ShowData(); } } }

• BMv3BackEnd/Default.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI;

L312

using System.Web.UI.WebControls; using BusinessFacade; using Common.Data; //using Web.Controls; using System.Text; using System.Security.Cryptography; using BMv3_BackEnd.WebReference; namespace BMv3_BackEnd { public partial class _Default : SecurePage// System.Web.UI.Page { private string pageRedirect { get { if (Session["pageRedirect"] != null) { return Session["pageRedirect"].ToString(); } else { return null; } } } private string errorMode { get { if (Request.QueryString["Error"] != null) { return Request.QueryString["Error"].ToString().Trim(); } else { return null; } } } protected void Page_Load(object sender, EventArgs e) { if (Session["UserData"] != null) { BinusianData _binusianData = (BinusianData)Session["UserData"]; LoginData loginData = new LoginData(); loginData.BinusianID = _binusianData.BinusianID; Session[SessionNameFactory.LoginData] = loginData; Response.Redirect("~/Home.aspx"); } //Service1 check = new Service1(); //string binusianID = ""; //string tokenID = ""; //if (Request.QueryString["id"] != null) //{ // binusianID = Request.QueryString["id"].ToString().Trim(); //} //if (Request.QueryString["tknid"] != null) //{ // tokenID = Request.QueryString["tknid"].ToString().Trim(); //} //string binusID = check.Bv3_GetBinusian(binusianID, tokenID).ToString().Trim(); ////check.Bv3_CheckAlive(Session["tokenID"].ToString().Trim(), Session["binusianID"].ToString().Trim());

L313

//if (binusID != "FALSE") //{ // LoginData loginData = new LoginData(); // loginData.BinusianID = binusID; // Session[SessionNameFactory.LoginData] = loginData; // Response.Redirect("Home.aspx"); //} if (!Page.IsPostBack) { if (errorMode == "4") { lblWarning.Text = "Session Expired"; } } } protected void btnLogin_Click(object sender, EventArgs e) { if (txbUserName.Text.Trim() != "" && txbPassword.Text.Trim() != "") { LoginData loginData = new LoginData(); loginData.BinusianID = txbUserName.Text; loginData.Password = txbPassword.Text; string passHash = ""; byte[] dataToHash = new UnicodeEncoding().GetBytes(loginData.Password); byte[] hashValue = ((HashAlgorithm)CryptoConfig.CreateFromName(SystemConfiguration.Hash)).ComputeHash(dataToHash); StringBuilder sb = new StringBuilder(BitConverter.ToString(hashValue)); passHash = sb.Replace("-", "").ToString(); LoginSystem loginSystem = new LoginSystem(); if (loginSystem.CekLogin(loginData.BinusianID, passHash, ref loginData)) { Session[SessionNameFactory.LoginData] = loginData; if (pageRedirect != null) { Response.Redirect(pageRedirect); } else { Response.Redirect("Home.aspx"); } } else { lblWarning.Text = "Your ID is not registered or wrong password"; } } else { lblWarning.Text = "Username and password must be filled"; } } protected void btnLogOut_Click(object sender, EventArgs e) { Session[SessionNameFactory.LoginData] = null; Session.Clear(); Session.Abandon(); pnlGreeting.Visible = false; pnlLogin.Visible = true; Response.Redirect("~/Default.aspx"); } protected void lbtForgotPassword_Click(object sender, EventArgs e)

L314

{ Response.Redirect("~/ForgotPassword.aspx"); } } }

• BMv3BackEnd/ApplicationList.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BusinessFacade; using Common.Data; using Web.Controls; using Common; namespace BMv3_BackEnd { public partial class ApplicationList : SecurePage//System.Web.UI.Page { private LoginData loginData { get { return (LoginData)Session[SessionNameFactory.LoginData]; } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { List<ApplicationData> applicationData = new ApplicationSystem().GetApplicationList(); if (applicationData.Count == 0) { rptAppList.Visible = false; } else { rptAppList.Visible = true; rptAppList.DataSource = applicationData; rptAppList.DataBind(); } } } protected void btnNewApp_Click(object sender, EventArgs e) { Response.Redirect("EntryApplication.aspx"); } protected void rptAppList_itemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { ApplicationData applicationData = (ApplicationData)e.Item.DataItem; HiddenField valAppID = (HiddenField)e.Item.FindControl("valAppID"); Literal ltAppName = (Literal)e.Item.FindControl("ltAppName"); Literal ltAppDesc = (Literal)e.Item.FindControl("ltAppDesc"); HyperLink hlAppLink = (HyperLink)e.Item.FindControl("hlAppLink"); //Literal ltAppBackEnd = (Literal)e.Item.FindControl("ltAppBackEnd");

L315

//Literal ltAppCreatorID = (Literal)e.Item.FindControl("ltAppCreatorID"); Button btnEditApp = (Button)e.Item.FindControl("btnEditApp"); Button btnDelApp = (Button)e.Item.FindControl("btnDelApp"); valAppID.Value = applicationData.ApplicationID; ltAppName.Text = applicationData.ApplicationName; ltAppDesc.Text = applicationData.ApplicationDesc; hlAppLink.Text = applicationData.ApplicationLink; hlAppLink.NavigateUrl = applicationData.ApplicationLink; /*if(applicationData.ApplicationBackend == "0") { ltAppBackEnd.Text = "No"; } else if (applicationData.ApplicationBackend == "1") { ltAppBackEnd.Text = "Yes"; } ltAppCreatorID.Text = applicationData.ApplicationCreatorID;*/ btnEditApp.CommandName = "EditDetail"; } } protected void rptAppList_itemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName.ToString() == "EditDetail") { HiddenField valAppID = (HiddenField)e.Item.FindControl("valAppID"); Response.Redirect("EntryApplication.aspx?edit=" + valAppID.Value); } else if (e.CommandName.ToString() == "DeleteApp") { string paramAppID = e.CommandArgument.ToString(); } } } }

• BMv3BackEnd/EntryApplication.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BusinessFacade; using Common.Data; using Web.Controls; using Common; namespace BMv3_BackEnd { public partial class EntryApplication : SecurePage//System.Web.UI.Page { private LoginData loginData { get { return (LoginData)Session[SessionNameFactory.LoginData]; } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["edit"] != null)

L316

{ ApplicationData appParam = new ApplicationData(); appParam.ApplicationID = Request.QueryString["edit"]; ApplicationData appData = new ApplicationSystem().GetApplicationDetail(appParam.ApplicationID); txtAppName.Text = appData.ApplicationName; txtAppDesc.Text = appData.ApplicationDesc; txtLink.Text = appData.ApplicationLink; ddlBackend.SelectedValue = appData.ApplicationBackend; txtCreatorID.Text = appData.ApplicationCreatorID; txtAppServer.Text = appData.ApplicationServer; valForPicLink.Value = appData.ApplicationPicLink; ddlAppStatus.SelectedValue = appData.ApplicationStatus; ddlDevelopBy.SelectedValue = appData.ApplicationDevelopedByBinus; } } } protected void btnSubmitApp_Click(object sender, EventArgs e) { ApplicationData applicationData = new ApplicationData(); applicationData.ApplicationName = txtAppName.Text; applicationData.ApplicationDesc = txtAppDesc.Text; if (txtLink.Text.StartsWith("http://")) { applicationData.ApplicationLink = txtLink.Text; } else { applicationData.ApplicationLink = "http://" + txtLink.Text; } applicationData.ApplicationBackend = ddlBackend.SelectedValue; applicationData.ApplicationCreatorID = txtCreatorID.Text; if (filePicLink.PostedFile.FileName != "") { applicationData.ApplicationPicLink = filePicLink.PostedFile.FileName; filePicLink.PostedFile.SaveAs(Server.MapPath(Configurations.ApplicationPictureLink + applicationData.ApplicationPicLink)); } applicationData.ApplicationServer = txtAppServer.Text; applicationData.ApplicationStatus = ddlAppStatus.SelectedValue; applicationData.ApplicationDevelopedByBinus = ddlDevelopBy.SelectedValue; string user = loginData.BinusianID; if (Request.QueryString["edit"] == null) { new ApplicationSystem().InsertApplication(applicationData, user); } else if (Request.QueryString["edit"] != null) { applicationData.ApplicationID = Request.QueryString["edit"].ToString().Trim(); if (filePicLink.PostedFile.FileName == "") { applicationData.ApplicationPicLink = valForPicLink.Value; } new ApplicationSystem().UpdateApplication(applicationData, "E", user); } Response.Redirect("ApplicationList.aspx"); } } }

• BMv3BackEnd/Disclaimer.aspx.cs

using System;

L317

using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BusinessFacade; using Common.Data; using Web.Controls; using Common; namespace BMv3_BackEnd { public partial class Disclaimer :SecurePage// System.Web.UI.Page { private LoginData loginData { get { return (LoginData)Session[SessionNameFactory.LoginData]; } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { List<DisclaimerData> disclaimerData = new DisclaimerSystem().GetDisclaimerList(); if (disclaimerData.Count == 0) { rptDisclaimer.Visible = false; } else { rptDisclaimer.DataSource = disclaimerData; rptDisclaimer.DataBind(); } } } protected void rptDisclaimer_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DisclaimerData disclaimerData = (DisclaimerData)e.Item.DataItem; Literal ltDisclaimerLang = (Literal)e.Item.FindControl("ltDisclaimerLang"); Literal ltDisclaimerDesc = (Literal)e.Item.FindControl("ltDisclaimerDesc"); Literal ltDisclaimerVer = (Literal)e.Item.FindControl("ltDisclaimerVer"); HiddenField valDisclaimerID = (HiddenField)e.Item.FindControl("valDisclaimerID"); HiddenField valDisclaimerLangID = (HiddenField)e.Item.FindControl("valDisclaimerLangID"); Button btnEditDisclaimer = (Button)e.Item.FindControl("btnEditDisclaimer"); ltDisclaimerLang.Text = new LanguageSystem().GetLanguageNameFromID(disclaimerData.DisclaimerLanguageID); ltDisclaimerDesc.Text = disclaimerData.DisclaimerDescription; ltDisclaimerVer.Text = disclaimerData.DisclaimerVersion; valDisclaimerID.Value = disclaimerData.DisclaimerID; valDisclaimerLangID.Value = disclaimerData.DisclaimerLanguageID.ToString().Trim(); btnEditDisclaimer.CommandName = "EditDetail"; } }

L318

protected void btnNewDisclaimer_Click(object sender, EventArgs e) { Response.Redirect("EntryDisclaimer.aspx"); } protected void rptDisclaimer_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName.ToString() == "EditDetail") { HiddenField valDisclaimerID = (HiddenField)e.Item.FindControl("valDisclaimerID"); HiddenField valDisclaimerLangID = (HiddenField)e.Item.FindControl("valDisclaimerLangID"); Response.Redirect("EntryDisclaimer.aspx?edit=" + valDisclaimerID.Value + "&lang=" + valDisclaimerLangID.Value); } } } }

• BMv3BackEnd/EntryDisclaimer.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BusinessFacade; using Common.Data; using Web.Controls; using Common; namespace BMv3_BackEnd { public partial class EntryDisclaimer : SecurePage//System.Web.UI.Page { private LoginData loginData { get { return (LoginData)Session[SessionNameFactory.LoginData]; } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ddlLanguage.DataSource = new LanguageSystem().GetLanguageList(); ddlLanguage.DataTextField = "LanguageName"; ddlLanguage.DataValueField = "LanguageID"; ddlLanguage.DataBind(); if (Request.QueryString["edit"] != null && Request.QueryString["lang"] != null) { DisclaimerData disclaimerParam = new DisclaimerData(); disclaimerParam.DisclaimerID = Request.QueryString["edit"].ToString().Trim(); disclaimerParam.DisclaimerLanguageID = Convert.ToInt32(Request.QueryString["lang"].ToString().Trim()); DisclaimerData disclaimerData = new DisclaimerSystem().GetDisclaimerDetail(disclaimerParam); ddlLanguage.SelectedValue = disclaimerData.DisclaimerLanguageID.ToString().Trim();

L319

ddlLanguage.Enabled = false; txtVersion.Text = disclaimerData.DisclaimerVersion; WebHtmlEditor1.Text = disclaimerData.DisclaimerDescription; } } } protected void btnSubmitDisclaimer_Click(object sender, EventArgs e) { DisclaimerData disclaimerData = new DisclaimerData(); disclaimerData.DisclaimerLanguageID = Convert.ToInt32(ddlLanguage.SelectedValue); disclaimerData.DisclaimerVersion = txtVersion.Text; disclaimerData.DisclaimerDescription = WebHtmlEditor1.Text; string user = loginData.BinusianID; if (Request.QueryString["edit"] == null && Request.QueryString["lang"] == null) { new DisclaimerSystem().InsertDisclaimer(disclaimerData, user); } else if (Request.QueryString["edit"] != null && Request.QueryString["lang"] != null) { disclaimerData.DisclaimerID = Request.QueryString["edit"].ToString().Trim(); new DisclaimerSystem().UpdateDisclaimer(disclaimerData, user); } Response.Redirect("Disclaimer.aspx"); } } }

• BMv3BackEnd/ResetPassword.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Security; using System.Net.Mail; using BusinessFacade; using Common.Data; using Web.Controls; using Common; namespace BMv3_BackEnd { public partial class ResetPassword : SecurePage//System.Web.UI.Page { public static string defPass; public static string defaultPass; public static string oldPass; public static string copiedPass; private LoginData loginData { get { return (LoginData)Session[SessionNameFactory.LoginData]; } } public static string To2Digit(string s) { if (s.Length == 2) return s; if (s.Length > 2) return s.Substring(s.Length - 2, 2);

L320

return "0" + s; } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { pnlResult.Visible = false; lblWarning.Visible = false; } } protected void btnSearchBinusian_Click(object sender, EventArgs e) { if (txtBinusianID.Text != "") { string binusianSearched = txtBinusianID.Text; BinusianData binusianData = new BinusianSystem().GetBinusianDataById(binusianSearched); if (binusianData.BinusianName != null) { binusianData.BinusianOrgEmail = new BinusianSystem().GetBinusianOrgEmail(binusianSearched); if (binusianData.BinusianOrgEmail == null || binusianData.BinusianOrgEmail == "") { ltBinusianOrgEmail.Text = "Binusian hasn't create binusian.org email yet"; btnCopyBinusianPassword.Enabled = false; } else { ltBinusianOrgEmail.Text = binusianData.BinusianOrgEmail; btnCopyBinusianPassword.Enabled = true; btnCopyBinusianPassword.Attributes.Add("onclick", "return confirm('Are you sure you want to copy this binusian password?');"); } lblWarning.Text = ""; lblWarning.Visible = false; ltBinusianIdResult.Text = binusianData.BinusianID; ltBinusianName.Text = binusianData.BinusianName; ltBinusianBirthDate.Text = binusianData.BinusianBirthDate.ToLongDateString(); ltBinusianEmail.Text = binusianData.BinusianEmail; pnlResult.Visible = true; oldPass = new BinusianSystem().getOldPassword(binusianData.BinusianID); copiedPass = FormsAuthentication.HashPasswordForStoringInConfigFile(oldPass, SystemConfiguration.Hash); defPass = "binus" + To2Digit(binusianData.BinusianBirthDate.Day.ToString()) + To2Digit(binusianData.BinusianBirthDate.Month.ToString()) + binusianData.BinusianBirthDate.Year.ToString(); defaultPass = FormsAuthentication.HashPasswordForStoringInConfigFile(defPass, SystemConfiguration.Hash); btnResetBinusianPassword.Attributes.Add("onclick", "return confirm('Are you sure you want to reset this binusian password?');"); } else { lblWarning.Text = "Binusian ID not found"; lblWarning.Visible = true; pnlResult.Visible = false; } } else { lblWarning.Text = "Please fill the Binusian ID first"; lblWarning.Visible = true;

L321

} } protected void btnResetBinusianPassword_Click(object sender, EventArgs e) { string userin = loginData.BinusianID; string binusianToReset = ltBinusianIdResult.Text; bool resetPass; resetPass = new BinusianSystem().UpdateBinusianPassword(binusianToReset, defaultPass, userin); if (resetPass) { DateTime dt = DateTime.Now; MailAddress to = new MailAddress(ltBinusianEmail.Text); MailAddress from = new MailAddress(Configurations.EmailFrom); MailMessage mailMessage = new MailMessage(from, to); //mailMessage.CC.Add(email); mailMessage.Subject = "[Binusmaya] Reset Password Service Requested By : " + binusianToReset; string body = "Password baru Anda adalah : " + defPass + "\r\n\r\n" + "Jangan lupa untuk mengganti password ini setelah berhasil melakukan login. \r\n" + "Atas perhatiannya kami ucapkan terima kasih.\r\n\r\n" + "Your new password is : " + defPass + "\r\n\r\n" + "Don't forget to change it after you succeed to login. Thank you for your attention.\r\n\r\n" + "Regards,\r\n" + "New BinusMaya HelpDesk"; mailMessage.Body = body; try { SmtpClient smtpClient = new SmtpClient(Configurations.SMTPServer); smtpClient.Send(mailMessage); } catch (Exception ex) { lblWarning.Text = "Error sending email. Please try again."; return; } Response.Redirect("ResetPassword.aspx"); } } protected void btnCopyBinusianPassword_Click(object sender, EventArgs e) { string userIn = loginData.BinusianID; string binusianToCopy = ltBinusianIdResult.Text; bool copyPass; copyPass = new BinusianSystem().UpdateBinusianPassword(binusianToCopy, copiedPass, userIn); if (copyPass) { Response.Redirect("ResetPassword.aspx"); } } } }

• AddByBinusianId.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web;

L322

using System.Web.UI; using System.Web.UI.WebControls; using BMv3Back.Business.Entities; using BMv3Back.CrossCutting.OperationalManagement; using BMv3Back.Business.ApplicationFacade; using BMv3Back.CrossCutting.Security; using UserManagement.CrossCutting.OptMgmt; using UserManagement.Bussiness.AppFacade; using UserManagement.Business.Entities; namespace BMv3Back.AccessApplication { public partial class AddByBinusianId : SecurePage//System.Web.UI.Page { #region privilege private Int32 _moduleId; public Int32 ModuleId { get { return _moduleId; } set { _moduleId = value; } } private string _loginId; public string LoginId { get { return _loginId; } set { _loginId = value; } } private string _viewAccess; public string ViewAccess { get { return _viewAccess; } set { _viewAccess = value; } } private string _addAccess; public string AddAccess { get { return _addAccess; } set { _addAccess = value; } } private string _editAccess; public string EditAccess { get { return _editAccess; } set { _editAccess = value; } } private string _deleteAccess; public string DeleteAccess { get { return _deleteAccess; } set { _deleteAccess = value; } } private string _printAccess; public string PrintAccess { get { return _printAccess; } set { _printAccess = value; } } private string _sendAccess; public string SendAccess { get { return _sendAccess; } set { _sendAccess = value; }

L323

} private string _uploadAccess; public string UploadAccess { get { return _uploadAccess; } set { _uploadAccess = value; } } private string _dowloadAccess; public string DowloadAccess { get { return _dowloadAccess; } set { _dowloadAccess = value; } } #endregion #region loadPrivilegeData public void LoadAccess() { string accessidlogin = new AccessModuleSystem().getAccesIDGrouporUser(1, LoginId); List<ModuleData> moduleNowData = new ModuleSystem().GetDetailModuleAccessData(new WebConfiguration().AreaId, new WebConfiguration().GAId, new WebConfiguration().AppId, ModuleId, accessidlogin); List<PriviledgeData> allAccessAvailable = new AccessModuleSystem().LoadPriviledge(); List<AccessModuleData> userAccessData = new PriviledgeBMv3().LoadAccess(Convert.ToInt32(moduleNowData[0].Priviledge.ToString().Trim()), allAccessAvailable); foreach (AccessModuleData userAccessDataDetail in userAccessData) { if (userAccessDataDetail.AllowPrivilegeName == "View" && userAccessDataDetail.AllowAccess == 0) { ViewAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Add" && userAccessDataDetail.AllowAccess == 0) { AddAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Edit" && userAccessDataDetail.AllowAccess == 0) { EditAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Delete" && userAccessDataDetail.AllowAccess == 0) { DeleteAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Print" && userAccessDataDetail.AllowAccess == 0) { PrintAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Send" && userAccessDataDetail.AllowAccess == 0) { SendAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Upload" && userAccessDataDetail.AllowAccess == 0) { UploadAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Download" && userAccessDataDetail.AllowAccess == 0) {

L324

DowloadAccess = "false"; } } } #endregion #region loadpage public void LoadPage() { #region set privilege ViewAccess = "true"; AddAccess = "true"; EditAccess = "true"; DeleteAccess = "true"; PrintAccess = "true"; SendAccess = "true"; UploadAccess = "true"; DowloadAccess = "true"; #endregion string tmpModuleId = ""; tmpModuleId = HttpUtility.HtmlDecode(Rijndael.Decrypt(Request.QueryString["mid"].ToString().Trim(), WebConfiguration.EncryptionKey)); try { ModuleId = Convert.ToInt32(tmpModuleId); } catch (Exception ex) { ModuleId = 0; } if (Session["uid"] != null) { LoginId = Session["uid"].ToString(); } } #endregion #region ViewState protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } } protected string msapplicationid { get { return Convert.ToString(ViewState["msapplicationid"]); } set { ViewState["msapplicationid"] = value; } } protected int isEdit { get

L325

{ return Convert.ToInt32(ViewState["isEdit"]); } set { ViewState["isEdit"] = value; } } protected int isView { get { return Convert.ToInt32(ViewState["isView"]); } set { ViewState["isView"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } if (Request.QueryString["appid"] != null) { msapplicationid = Convert.ToString(Rijndael.Decrypt(Request.QueryString["appid"])); } if (Request.QueryString["isedit"] != null) { isEdit = Convert.ToInt32(Request.QueryString["isedit"]); } if (Request.QueryString["isview"] != null) { isView = Convert.ToInt32(Request.QueryString["isview"]); } } #endregion protected void ShowData() { List<BinusianData> _list = new AccessSystem().GetAccessBinusianIdOfMsApplicationId(msapplicationid, Configurations.PagingSumPerPage, CurrPage); if (_list.Count == 0) { ucPagingControl.Visible = false; rptBinusianHasAccess.Visible = false; } else { ucPagingControl.Visible = true; rptBinusianHasAccess.Visible = true; rptBinusianHasAccess.DataSource = _list; rptBinusianHasAccess.DataBind(); } }

L326

#region Paging private void FillPaging() { int countPage = new AccessSystem().GetAccessBinusianIdOfMsApplicationIdCount(msapplicationid); int sumPage = 1; if (countPage % Configurations.PagingSumPerPage == 0) { sumPage = countPage / Configurations.PagingSumPerPage; } else { sumPage = countPage / Configurations.PagingSumPerPage + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); } #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } private static string binusianid ;

L327

protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { binusianid = ((BinusianData)Session["UserData"]).BinusianID.Trim(); SaveViewStates(); LoadPage(); LoadAccess(); if (AddAccess == "false") { btnSubmit.Visible = false; } else { btnSubmit.Visible = true; } string appname = Rijndael.Decrypt(Request.QueryString["appname"].ToString()); litAppName.Text = appname; SaveViewStates(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; FillPaging(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; ShowData(); } else { ucPagingControl.DataBind(); } } protected void rptBinusianHasAccess_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName.ToString() == "Delete") { bool success = new AccessSystem().DeleteBinusianIdFromAccessMsApp(msapplicationid, e.CommandArgument.ToString().Trim(), binusianid); if (success) { Response.Redirect("AddByBinusianId.aspx?isEdit=1&appname=" + Request.QueryString["appname"].ToString() +"&appid=" + HttpUtility.UrlEncode(Rijndael.Encrypt(msapplicationid)) + "&mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"])); } } } protected void rptBinusianHasAccess_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { BinusianData _data = (BinusianData)e.Item.DataItem; Literal litBinusianId = (Literal)e.Item.FindControl("litBinusianId"); Literal litName = (Literal)e.Item.FindControl("litName"); LinkButton lnkDelete = (LinkButton)e.Item.FindControl("lnkDelete");

L328

litBinusianId.Text = _data.BinusianID; litName.Text = _data.BinusianName; lnkDelete.CommandName = "Delete"; lnkDelete.CommandArgument = litBinusianId.Text; lnkDelete.Attributes.Add("onclick", "return confirm('Are you sure want to delete this record of data?');"); if (DeleteAccess == "false") { lnkDelete.Visible = false; } else { lnkDelete.Visible = true; } } } protected void btnSubmit_Click(object sender, EventArgs e) { lblError.Text = ""; bool success = false; try { success = new AccessSystem().InsertListBinusianIdIntoTRAddApplicationAccess(msapplicationid, txtAddBinusian.Text.Trim(), binusianid); } catch (Exception ex) { success = false; lblError.Text = "Please Check Again Your Data, Binusian Id Must Be 10 Digits and Lecturer Id Must Be 5 digits"; } if (success) { Response.Redirect("AddByBinusianId.aspx?isEdit=1&appname=" + Request.QueryString["appname"].ToString() + "&appid=" + HttpUtility.UrlEncode(Rijndael.Encrypt(msapplicationid)) + "&mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"])); } } } }

• AddByStatus.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BMv3Back.Business.Entities; using BMv3Back.CrossCutting.OperationalManagement; using BMv3Back.Business.ApplicationFacade; using BMv3Back.CrossCutting.Security; using UserManagement.CrossCutting.OptMgmt; using UserManagement.Bussiness.AppFacade; using UserManagement.Business.Entities; using Infragistics.WebUI.UltraWebGrid; using System.Data; namespace BMv3Back.AccessApplication { public partial class AddByStatus : SecurePage

L329

{ #region privilege private Int32 _moduleId; public Int32 ModuleId { get { return _moduleId; } set { _moduleId = value; } } private string _loginId; public string LoginId { get { return _loginId; } set { _loginId = value; } } private string _viewAccess; public string ViewAccess { get { return _viewAccess; } set { _viewAccess = value; } } private string _addAccess; public string AddAccess { get { return _addAccess; } set { _addAccess = value; } } private string _editAccess; public string EditAccess { get { return _editAccess; } set { _editAccess = value; } } private string _deleteAccess; public string DeleteAccess { get { return _deleteAccess; } set { _deleteAccess = value; } } private string _printAccess; public string PrintAccess { get { return _printAccess; } set { _printAccess = value; } } private string _sendAccess; public string SendAccess { get { return _sendAccess; } set { _sendAccess = value; } } private string _uploadAccess; public string UploadAccess { get { return _uploadAccess; } set { _uploadAccess = value; } } private string _dowloadAccess; public string DowloadAccess {

L330

get { return _dowloadAccess; } set { _dowloadAccess = value; } } #endregion #region loadPrivilegeData public void LoadAccess() { string accessidlogin = new AccessModuleSystem().getAccesIDGrouporUser(1, LoginId); List<ModuleData> moduleNowData = new ModuleSystem().GetDetailModuleAccessData(new WebConfiguration().AreaId, new WebConfiguration().GAId, new WebConfiguration().AppId, ModuleId, accessidlogin); List<PriviledgeData> allAccessAvailable = new AccessModuleSystem().LoadPriviledge(); List<AccessModuleData> userAccessData = new PriviledgeBMv3().LoadAccess(Convert.ToInt32(moduleNowData[0].Priviledge.ToString().Trim()), allAccessAvailable); foreach (AccessModuleData userAccessDataDetail in userAccessData) { if (userAccessDataDetail.AllowPrivilegeName == "View" && userAccessDataDetail.AllowAccess == 0) { ViewAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Add" && userAccessDataDetail.AllowAccess == 0) { AddAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Edit" && userAccessDataDetail.AllowAccess == 0) { EditAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Delete" && userAccessDataDetail.AllowAccess == 0) { DeleteAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Print" && userAccessDataDetail.AllowAccess == 0) { PrintAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Send" && userAccessDataDetail.AllowAccess == 0) { SendAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Upload" && userAccessDataDetail.AllowAccess == 0) { UploadAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Download" && userAccessDataDetail.AllowAccess == 0) { DowloadAccess = "false"; } } } #endregion #region loadpage public void LoadPage() { #region set privilege

L331

ViewAccess = "true"; AddAccess = "true"; EditAccess = "true"; DeleteAccess = "true"; PrintAccess = "true"; SendAccess = "true"; UploadAccess = "true"; DowloadAccess = "true"; #endregion string tmpModuleId = ""; tmpModuleId = HttpUtility.HtmlDecode(Rijndael.Decrypt(Request.QueryString["mid"].ToString().Trim(), WebConfiguration.EncryptionKey)); try { ModuleId = Convert.ToInt32(tmpModuleId); } catch (Exception ex) { ModuleId = 0; } if (Session["uid"] != null) { LoginId = Session["uid"].ToString(); } } #endregion #region ViewState protected string msapplicationid { get { return Convert.ToString(ViewState["msapplicationid"]); } set { ViewState["msapplicationid"] = value; } } protected int isEdit { get { return Convert.ToInt32(ViewState["isEdit"]); } set { ViewState["isEdit"] = value; } } protected int isView { get { return Convert.ToInt32(ViewState["isView"]); } set { ViewState["isView"] = value; } } private void SaveViewStates() {

L332

if (Request.QueryString["appid"] != null) { msapplicationid = Convert.ToString(Rijndael.Decrypt(Request.QueryString["appid"])); } if (Request.QueryString["isedit"] != null) { isEdit = Convert.ToInt32(Request.QueryString["isedit"]); } if (Request.QueryString["isview"] != null) { isView = Convert.ToInt32(Request.QueryString["isview"]); } } #endregion private static string binusianid; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { binusianid = ((BinusianData)Session["UserData"]).BinusianID.Trim(); LoadPage(); LoadAccess(); SaveViewStates(); string appname = Rijndael.Decrypt(Request.QueryString["appname"].ToString().Trim()); litAppName.Text = appname; ddlStatusAktif.Items.Add(new ListItem("A", "A")); ddlStatusAktif.Items.Add(new ListItem("L", "L")); DataSet dataSetSource = new DataSet(); dataSetSource = new AccessSystem().GetAllStatusGabunganWithDataSet(); uwgStatusBinusian.DataSource = dataSetSource; uwgStatusBinusian.DataBind(); if (AddAccess == "false") { btnSubmit.Visible = false; } else { btnSubmit.Visible = true; } if (msapplicationid != null) { if (isView == 1) { uwgStatusBinusian.Bands[0].Columns[2].AllowUpdate = Infragistics.WebUI.UltraWebGrid.AllowUpdate.No; btnSubmit.Visible = false; } else { btnSubmit.Visible = true; uwgStatusBinusian.Bands[0].Columns[2].AllowUpdate = Infragistics.WebUI.UltraWebGrid.AllowUpdate.Yes; } int i = 0; List<string> _liststatus = new AccessSystem().GetAccessStatusBinusianOfMsApplicationId(msapplicationid, ddlStatusAktif.SelectedItem.Value); foreach (UltraGridRow row in uwgStatusBinusian.Rows) { if (_liststatus.Count == i) { break;

L333

} if (_liststatus[i].Trim() == row.Cells[0].Text) { row.Cells[2].Value = true; i++; } } } } } protected void uwgStatusBinusian_InitializeLayout(object sender, LayoutEventArgs e) { e.Layout.Bands[0].Columns[0].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[0].Width = 50; e.Layout.Bands[0].Columns[0].Key = "KdStatus"; e.Layout.Bands[0].Columns[0].Hidden = true; e.Layout.Bands[0].Columns[1].Header.Caption = "Binusian Status"; e.Layout.Bands[0].Columns[1].CellStyle.Wrap = true; e.Layout.Bands[0].Columns[1].Width = 250; e.Layout.Bands[0].Columns.Add("Check", "Check"); e.Layout.Bands[0].Columns[2].Type = Infragistics.WebUI.UltraWebGrid.ColumnType.CheckBox; e.Layout.Bands[0].Columns[2].AllowUpdate = Infragistics.WebUI.UltraWebGrid.AllowUpdate.Yes; //e.Layout.Bands[0].Columns[2].DefaultValue = false; e.Layout.Bands[0].Columns[2].Width = 50; } protected void btnSubmit_Click(object sender, EventArgs e) { foreach (UltraGridRow row in uwgStatusBinusian.Rows) { int ischeck = 0; bool check = Convert.ToBoolean(row.Cells[2].Value); if (check == true) { ischeck = 1; } bool success = new AccessSystem().insertStatusBinusianIntoAccessMsApp(msapplicationid, row.Cells[0].Text.Trim(), ischeck, binusianid, ddlStatusAktif.SelectedItem.Value); } Response.Redirect("~/AccessApplication/ApplicationByStatus.aspx?mid=" + HttpUtility.UrlEncode(Request.QueryString["mid"])); } protected void ddlStatusAktif_SelectedIndexChanged(object sender, EventArgs e) { int i = 0; List<string> _liststatus = new AccessSystem().GetAccessStatusBinusianOfMsApplicationId(msapplicationid, ddlStatusAktif.SelectedItem.Value); foreach (UltraGridRow row in uwgStatusBinusian.Rows) { row.Cells[2].Value = false; } foreach (UltraGridRow row in uwgStatusBinusian.Rows)

L334

{ if (_liststatus.Count == i) { break; } if (_liststatus[i].Trim() == row.Cells[0].Text) { row.Cells[2].Value = true; i++; } } } } }

• ApplicationByBinusian.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BMv3Back.Business.Entities; using BMv3Back.CrossCutting.OperationalManagement; using BMv3Back.Business.ApplicationFacade; using BMv3Back.CrossCutting.Security; using UserManagement.CrossCutting.OptMgmt; using UserManagement.Bussiness.AppFacade; using UserManagement.Business.Entities; namespace BMv3Back.AccessApplication { public partial class ApplicationByBinusian : SecurePage //System.Web.UI.Page { #region privilege private Int32 _moduleId; public Int32 ModuleId { get { return _moduleId; } set { _moduleId = value; } } private string _loginId; public string LoginId { get { return _loginId; } set { _loginId = value; } } private string _viewAccess; public string ViewAccess { get { return _viewAccess; } set { _viewAccess = value; } } private string _addAccess; public string AddAccess { get { return _addAccess; } set { _addAccess = value; } } private string _editAccess; public string EditAccess

L335

{ get { return _editAccess; } set { _editAccess = value; } } private string _deleteAccess; public string DeleteAccess { get { return _deleteAccess; } set { _deleteAccess = value; } } private string _printAccess; public string PrintAccess { get { return _printAccess; } set { _printAccess = value; } } private string _sendAccess; public string SendAccess { get { return _sendAccess; } set { _sendAccess = value; } } private string _uploadAccess; public string UploadAccess { get { return _uploadAccess; } set { _uploadAccess = value; } } private string _dowloadAccess; public string DowloadAccess { get { return _dowloadAccess; } set { _dowloadAccess = value; } } #endregion #region loadPrivilegeData public void LoadAccess() { string accessidlogin = new AccessModuleSystem().getAccesIDGrouporUser(1, LoginId); List<ModuleData> moduleNowData = new ModuleSystem().GetDetailModuleAccessData(new WebConfiguration().AreaId, new WebConfiguration().GAId, new WebConfiguration().AppId, ModuleId, accessidlogin); List<PriviledgeData> allAccessAvailable = new AccessModuleSystem().LoadPriviledge(); List<AccessModuleData> userAccessData = new PriviledgeBMv3().LoadAccess(Convert.ToInt32(moduleNowData[0].Priviledge.ToString().Trim()), allAccessAvailable); foreach (AccessModuleData userAccessDataDetail in userAccessData) { if (userAccessDataDetail.AllowPrivilegeName == "View" && userAccessDataDetail.AllowAccess == 0) { ViewAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Add" && userAccessDataDetail.AllowAccess == 0) { AddAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Edit" && userAccessDataDetail.AllowAccess == 0) { EditAccess = "false"; }

L336

if (userAccessDataDetail.AllowPrivilegeName == "Delete" && userAccessDataDetail.AllowAccess == 0) { DeleteAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Print" && userAccessDataDetail.AllowAccess == 0) { PrintAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Send" && userAccessDataDetail.AllowAccess == 0) { SendAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Upload" && userAccessDataDetail.AllowAccess == 0) { UploadAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Download" && userAccessDataDetail.AllowAccess == 0) { DowloadAccess = "false"; } } } #endregion #region loadpage public void LoadPage() { #region set privilege ViewAccess = "true"; AddAccess = "true"; EditAccess = "true"; DeleteAccess = "true"; PrintAccess = "true"; SendAccess = "true"; UploadAccess = "true"; DowloadAccess = "true"; #endregion string tmpModuleId = ""; tmpModuleId = HttpUtility.HtmlDecode(Rijndael.Decrypt(Request.QueryString["mid"].ToString().Trim(), WebConfiguration.EncryptionKey)); try { ModuleId = Convert.ToInt32(tmpModuleId); } catch (Exception ex) { ModuleId = 0; } if (Session["uid"] != null) { LoginId = Session["uid"].ToString(); } } #endregion protected int CurrPage

L337

{ get { return Convert.ToInt32(ViewState["CurrPage"]); } set { ViewState["CurrPage"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } } protected void ShowData() { List<BMv3Back.Business.Entities.ApplicationData> applicationData = new BMv3Back.Business.ApplicationFacade.ApplicationSystem().GetApplicationListPaging(Configurations.PagingSumPerPage, CurrPage); if (applicationData.Count == 0) { ucPagingControl.Visible = false; rptAppList.Visible = false; } else { ucPagingControl.Visible = true; rptAppList.Visible = true; rptAppList.DataSource = applicationData; rptAppList.DataBind(); } } #region Paging private void FillPaging() { int countPage = new BMv3Back.Business.ApplicationFacade.ApplicationSystem().GetApplicationListCount(); int sumPage = 1; if (countPage % Configurations.PagingSumPerPage == 0) { sumPage = countPage / Configurations.PagingSumPerPage; } else { sumPage = countPage / Configurations.PagingSumPerPage + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); }

L338

#endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } private LoginData loginData { get { return (LoginData)Session[SessionNameFactory.LoginData]; } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LoadPage(); LoadAccess(); SaveViewStates(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; FillPaging(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; ShowData(); } else

L339

{ ucPagingControl.DataBind(); } } protected void rptAppList_itemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { BMv3Back.Business.Entities.ApplicationData applicationData = (BMv3Back.Business.Entities.ApplicationData)e.Item.DataItem; HiddenField valAppID = (HiddenField)e.Item.FindControl("valAppID"); Literal ltAppName = (Literal)e.Item.FindControl("ltAppName"); //Literal ltAppBackEnd = (Literal)e.Item.FindControl("ltAppBackEnd"); //Literal ltAppCreatorID = (Literal)e.Item.FindControl("ltAppCreatorID"); LinkButton lnkEdit = (LinkButton)e.Item.FindControl("lnkEdit"); LinkButton lnkView = (LinkButton)e.Item.FindControl("lnkView"); valAppID.Value = applicationData.ApplicationID; ltAppName.Text = applicationData.ApplicationName; /*if(applicationData.ApplicationBackend == "0") { ltAppBackEnd.Text = "No"; } else if (applicationData.ApplicationBackend == "1") { ltAppBackEnd.Text = "Yes"; } ltAppCreatorID.Text = applicationData.ApplicationCreatorID;*/ if (EditAccess != "false") { lnkEdit.Visible = true; } else { lnkEdit.Visible = false; } lnkEdit.CommandName = "EditDetail"; lnkEdit.CommandArgument = ltAppName.Text.Trim(); lnkView.CommandName = "View"; lnkView.CommandArgument = ltAppName.Text.Trim(); } } protected void rptAppList_itemCommand(object source, RepeaterCommandEventArgs e) { int p = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["mid"].ToString())); if (e.CommandName.ToString() == "EditDetail") { HiddenField valAppID = (HiddenField)e.Item.FindControl("valAppID"); Response.Redirect("AddByBinusianId.aspx?isEdit=1&appid=" + HttpUtility.UrlEncode(Rijndael.Encrypt(valAppID.Value)) + "&appname=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.CommandArgument.ToString())) + "&mid=" + HttpUtility.UrlEncode(Rijndael.Encrypt(p.ToString().Trim(), WebConfiguration.EncryptionKey))); } if (e.CommandName.ToString() == "View") { HiddenField valAppID = (HiddenField)e.Item.FindControl("valAppID"); Response.Redirect("AddByBinusianId.aspx?IsView=1&appid=" + HttpUtility.UrlEncode(Rijndael.Encrypt(valAppID.Value)) + "&appname=" +

L340

HttpUtility.UrlEncode(Rijndael.Encrypt(e.CommandArgument.ToString())) + "&mid=" + HttpUtility.UrlEncode(Rijndael.Encrypt(p.ToString().Trim(), WebConfiguration.EncryptionKey))); } } } }

• ApplicationByStatus.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BMv3Back.Business.Entities; using BMv3Back.CrossCutting.OperationalManagement; using BMv3Back.Business.ApplicationFacade; using BMv3Back.CrossCutting.Security; using UserManagement.CrossCutting.OptMgmt; using UserManagement.Bussiness.AppFacade; using UserManagement.Business.Entities; namespace BMv3Back.AccessApplication { public partial class ApplicationByStatus : SecurePage { #region privilege private Int32 _moduleId; public Int32 ModuleId { get { return _moduleId; } set { _moduleId = value; } } private string _loginId; public string LoginId { get { return _loginId; } set { _loginId = value; } } private string _viewAccess; public string ViewAccess { get { return _viewAccess; } set { _viewAccess = value; } } private string _addAccess; public string AddAccess { get { return _addAccess; } set { _addAccess = value; } } private string _editAccess; public string EditAccess { get { return _editAccess; } set { _editAccess = value; } } private string _deleteAccess; public string DeleteAccess

L341

{ get { return _deleteAccess; } set { _deleteAccess = value; } } private string _printAccess; public string PrintAccess { get { return _printAccess; } set { _printAccess = value; } } private string _sendAccess; public string SendAccess { get { return _sendAccess; } set { _sendAccess = value; } } private string _uploadAccess; public string UploadAccess { get { return _uploadAccess; } set { _uploadAccess = value; } } private string _dowloadAccess; public string DowloadAccess { get { return _dowloadAccess; } set { _dowloadAccess = value; } } #endregion #region loadPrivilegeData public void LoadAccess() { string accessidlogin = new AccessModuleSystem().getAccesIDGrouporUser(1, LoginId); List<ModuleData> moduleNowData = new ModuleSystem().GetDetailModuleAccessData(new WebConfiguration().AreaId, new WebConfiguration().GAId, new WebConfiguration().AppId, ModuleId, accessidlogin); List<PriviledgeData> allAccessAvailable = new AccessModuleSystem().LoadPriviledge(); List<AccessModuleData> userAccessData = new PriviledgeBMv3().LoadAccess(Convert.ToInt32(moduleNowData[0].Priviledge.ToString().Trim()), allAccessAvailable); foreach (AccessModuleData userAccessDataDetail in userAccessData) { if (userAccessDataDetail.AllowPrivilegeName == "View" && userAccessDataDetail.AllowAccess == 0) { ViewAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Add" && userAccessDataDetail.AllowAccess == 0) { AddAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Edit" && userAccessDataDetail.AllowAccess == 0) { EditAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Delete" && userAccessDataDetail.AllowAccess == 0) { DeleteAccess = "false"; }

L342

if (userAccessDataDetail.AllowPrivilegeName == "Print" && userAccessDataDetail.AllowAccess == 0) { PrintAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Send" && userAccessDataDetail.AllowAccess == 0) { SendAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Upload" && userAccessDataDetail.AllowAccess == 0) { UploadAccess = "false"; } if (userAccessDataDetail.AllowPrivilegeName == "Download" && userAccessDataDetail.AllowAccess == 0) { DowloadAccess = "false"; } } } #endregion #region loadpage public void LoadPage() { #region set privilege ViewAccess = "true"; AddAccess = "true"; EditAccess = "true"; DeleteAccess = "true"; PrintAccess = "true"; SendAccess = "true"; UploadAccess = "true"; DowloadAccess = "true"; #endregion string tmpModuleId = ""; tmpModuleId = HttpUtility.HtmlDecode(Rijndael.Decrypt(Request.QueryString["mid"].ToString().Trim(), WebConfiguration.EncryptionKey)); try { ModuleId = Convert.ToInt32(tmpModuleId); } catch (Exception ex) { ModuleId = 0; } if (Session["uid"] != null) { LoginId = Session["uid"].ToString(); } } #endregion protected int CurrPage { get { return Convert.ToInt32(ViewState["CurrPage"]); } set

L343

{ ViewState["CurrPage"] = value; } } private void SaveViewStates() { if (Request.QueryString["pg"] != null) { CurrPage = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["pg"])); } else { CurrPage = (ucPagingControl.CurrentPage == 0) ? 1 : 0; } } protected void ShowData() { List<BMv3Back.Business.Entities.ApplicationData> applicationData = new BMv3Back.Business.ApplicationFacade.ApplicationSystem().GetApplicationListPaging(Configurations.PagingSumPerPage, CurrPage); if (applicationData.Count == 0) { ucPagingControl.Visible = false; rptAppList.Visible = false; } else { ucPagingControl.Visible = true; rptAppList.Visible = true; rptAppList.DataSource = applicationData; rptAppList.DataBind(); } } #region Paging private void FillPaging() { int countPage = new BMv3Back.Business.ApplicationFacade.ApplicationSystem().GetApplicationListCount(); int sumPage = 1; if (countPage % Configurations.PagingSumPerPage == 0) { sumPage = countPage / Configurations.PagingSumPerPage; } else { sumPage = countPage / Configurations.PagingSumPerPage + 1; } ucPagingControl.SumPage = sumPage; ucPagingControl.Clear(); ucPagingControl.DataBind(); } #endregion public void LinkPaging_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton;

L344

if (linkButton.ID == Convert.ToInt32(NavigationName.First).ToString()) { ucPagingControl.CurrentPage = 1; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Last).ToString()) { ucPagingControl.CurrentPage = ucPagingControl.SumPage; } else if (linkButton.ID == Convert.ToInt32(NavigationName.Next).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock + 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage + 1); } else if (linkButton.ID == Convert.ToInt32(NavigationName.Prev).ToString()) { // ucPagingControl.CurrentPageBlock = ucPagingControl.CurrentPageBlock - 1; ucPagingControl.CurrentPage = (ucPagingControl.CurrentPage - 1); } else { ucPagingControl.CurrentPage = Convert.ToInt32(linkButton.ID); } CurrPage = ucPagingControl.CurrentPage; ShowData(); FillPaging(); } private LoginData loginData { get { return (LoginData)Session[SessionNameFactory.LoginData]; } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LoadPage(); LoadAccess(); SaveViewStates(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; FillPaging(); ucPagingControl.CurrentPage = CurrPage; // ucPagingControl.CurrentPageBlock = CurrPage; ShowData(); } else { ucPagingControl.DataBind(); } }

L345

protected void rptAppList_itemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { BMv3Back.Business.Entities.ApplicationData applicationData = (BMv3Back.Business.Entities.ApplicationData)e.Item.DataItem; HiddenField valAppID = (HiddenField)e.Item.FindControl("valAppID"); Literal ltAppName = (Literal)e.Item.FindControl("ltAppName"); //Literal ltAppBackEnd = (Literal)e.Item.FindControl("ltAppBackEnd"); //Literal ltAppCreatorID = (Literal)e.Item.FindControl("ltAppCreatorID"); LinkButton lnkEdit = (LinkButton)e.Item.FindControl("lnkEdit"); LinkButton lnkView = (LinkButton)e.Item.FindControl("lnkView"); valAppID.Value = applicationData.ApplicationID; ltAppName.Text = applicationData.ApplicationName; /*if(applicationData.ApplicationBackend == "0") { ltAppBackEnd.Text = "No"; } else if (applicationData.ApplicationBackend == "1") { ltAppBackEnd.Text = "Yes"; } ltAppCreatorID.Text = applicationData.ApplicationCreatorID;*/ if (EditAccess != "false") { lnkEdit.Visible = true; } else { lnkEdit.Visible = false; } lnkEdit.CommandName = "EditDetail"; lnkEdit.CommandArgument = ltAppName.Text.Trim(); lnkView.CommandName = "View"; lnkView.CommandArgument = ltAppName.Text.Trim(); } } protected void rptAppList_itemCommand(object source, RepeaterCommandEventArgs e) { int p = Convert.ToInt32(Rijndael.Decrypt(Request.QueryString["mid"].ToString())); if (e.CommandName.ToString() == "EditDetail") { HiddenField valAppID = (HiddenField)e.Item.FindControl("valAppID"); Response.Redirect("AddByStatus.aspx?isEdit=1&appid=" + HttpUtility.UrlEncode(Rijndael.Encrypt(valAppID.Value)) + "&appname=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.CommandArgument.ToString())) + "&mid=" + HttpUtility.UrlEncode(Rijndael.Encrypt(p.ToString().Trim(), WebConfiguration.EncryptionKey))); } if (e.CommandName.ToString() == "View") { HiddenField valAppID = (HiddenField)e.Item.FindControl("valAppID"); Response.Redirect("AddByStatus.aspx?IsView=1&appid=" + HttpUtility.UrlEncode(Rijndael.Encrypt(valAppID.Value)) + "&appname=" + HttpUtility.UrlEncode(Rijndael.Encrypt(e.CommandArgument.ToString())) + "&mid=" + HttpUtility.UrlEncode(Rijndael.Encrypt(p.ToString().Trim(), WebConfiguration.EncryptionKey))); } } } }


Recommended