protected void Page_Load(object sender, EventArgs e) { loginPerson = PersonnelSystem.GetPersonnelSystem(this).LoginPerson; if (!IsPostBack) { //int yearMin = DatabaseManager.ExecuteInt("select EXTRACT(YEAR FROM PS_INWORK_DATE)+543 from ps_person where ps_citizen_id = '" + loginPerson.PS_CITIZEN_ID + "'") + 543; //DateTime CurrentYear = DateTime.Today.AddYears(+543); int minDateInwork = DatabaseManager.ExecuteInt("SELECT EXTRACT(YEAR FROM PS_INWORK_DATE)+543 FROM PS_PERSON WHERE PS_CITIZEN_ID = '" + loginPerson.PS_CITIZEN_ID + "'"); int currentYear = Util.BudgetYear() + 543; //int yearMin = DatabaseManager.ExecuteInt("SELECT MIN(EXTRACT(YEAR FROM FROM_DATE)) FROM LEV_DATA") + 543; //int yearMax = DatabaseManager.ExecuteInt("SELECT MAX(EXTRACT(YEAR FROM FROM_DATE)) FROM LEV_DATA") + 543; for (int i = minDateInwork; i <= currentYear; ++i) { DropDownList1.Items.Add(new System.Web.UI.WebControls.ListItem("" + i, "" + i)); } DropDownList1.SelectedValue = "" + (Util.BudgetYear() + 543); ddlView.Items.Add(new ListItem("แสดงทั้งหมด", "1")); ddlView.Items.Add(new ListItem("แสดงเฉพาะภายในวิทยาเขต", "2")); ddlView.Items.Add(new ListItem("แสดงเฉพาะภายใน สำนัก / สถาบัน / คณะ", "3")); ddlView.Items.Add(new ListItem("แสดงเฉพาะภายใน กอง / สำนักงานเลขา / ภาควิชา", "4")); ddlView.Items.Add(new ListItem("แสดงเฉพาะภายใน งาน / ฝ่าย", "5")); ddlView.Items.Add(new ListItem("แสดงเฉพาะตนเอง", "6")); ddlSelfView.Items.Add(new ListItem("แสดงการลาทั้งหมด", "1")); ddlSelfView.Items.Add(new ListItem("แสดงตามรหัสการลา", "2")); } }
protected void Page_Load(object sender, EventArgs e) { BindData(); if (!IsPostBack) { txtBudget.Attributes.Add("onkeypress", "return allowOnlyNumber(this);"); } using (OracleConnection conn = Util.OC()) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); Person PP = ps.LoginPerson; using (OracleCommand cmd = new OracleCommand("select PERSON_NAME,PERSON_LASTNAME from tb_person where citizen_id = '" + PP.CitizenID + "'", conn)) { using (OracleDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { txtName.Text = reader.IsDBNull(0) ? "" : reader.GetString(0); txtLastName.Text = reader.IsDBNull(1) ? "" : reader.GetString(1); } } } } }
protected void lbuBack_Click(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); Person loginPerson = ps.LoginPerson; int count = 0; using (OracleConnection con = new OracleConnection(DatabaseManager.CONNECTION_STRING)) { con.Open(); using (OracleCommand com = new OracleCommand("SELECT COUNT(LEAVE_ID) FROM LEV_LEAVE WHERE CMD_HIGH_ID = '" + loginPerson.PS_CITIZEN_ID + "' AND LEV_LEAVE.STATE_ID = 3", con)) { using (OracleDataReader reader = com.ExecuteReader()) { while (reader.Read()) { count = int.Parse(reader.GetValue(0).ToString()); } } } } if (count == 0) { error_area.InnerHtml = "ไม่มีรายการที่ท่านต้องอนุมัติ"; } else { error_area.InnerHtml = "กรุณาเลือกรายการที่ต้องอนุมัติ"; } //error_area.Attributes["class"] = "alert alert_info"; error_area.Attributes["class"] = null; error_area.InnerHtml = ""; MultiView1.ActiveViewIndex = 0; }
protected void Page_Load(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); loginPerson = ps.LoginPerson; Citizen_id = DatabaseManager.ExecuteString("SELECT PS_CITIZEN_ID FROM PS_PERSON WHERE PS_CITIZEN_ID = '" + MyCrypto.GetDecryptedQueryString(Request.QueryString["id"].ToString()) + "'"); QueryString = DatabaseManager.GetPerson(Citizen_id); if (loginPerson.PERSON_ROLE_ID != "2") { Server.Transfer("NoPermission.aspx"); } if (Request.QueryString["id"] == null) { Response.Redirect("ListPerson-ADMIN.aspx"); } if (!IsPostBack) { if (QueryString.PS_STAFFTYPE_ID == "1" || QueryString.PS_STAFFTYPE_ID == "5") { BindPosition(); } } }
private void fBack() { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); Person loginPerson = ps.LoginPerson; int count = 0; OracleConnection.ClearAllPools(); using (OracleConnection con = new OracleConnection(DatabaseManager.CONNECTION_STRING)) { con.Open(); using (OracleCommand com = new OracleCommand("SELECT COUNT(LEAVE_ID) FROM LEV_LEAVE WHERE CMD_LOW_ID = '" + loginPerson.PS_CITIZEN_ID + "' AND LEV_LEAVE.STATE_ID = 1", con)) { using (OracleDataReader reader = com.ExecuteReader()) { while (reader.Read()) { count = int.Parse(reader.GetValue(0).ToString()); } } } } if (count == 0) { error_area.InnerHtml = "ไม่มีรายการที่ท่านต้องลงความเห็น"; } else { error_area.InnerHtml = "กรุณาเลือกรายการที่ต้องการลงความเห็น"; } //error_area.Attributes["class"] = "alert alert_info"; error_area.Attributes["class"] = null; error_area.InnerHtml = ""; MultiView1.ActiveViewIndex = 0; }
protected void Page_Load(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); Person loginPerson = ps.LoginPerson; if (loginPerson.PERSON_ROLE_ID != "2") { Server.Transfer("NoPermission.aspx"); } if (!IsPostBack) { SQLCampus(); using (OracleConnection con = new OracleConnection(DatabaseManager.CONNECTION_STRING)) { con.Open(); using (OracleCommand com = new OracleCommand("SELECT BOSS_NODE_ID, BOSS_NODE_NAME FROM TB_BOSS_NODE", con)) { using (OracleDataReader reader = com.ExecuteReader()) { while (reader.Read()) { ddlHighNode.Items.Add(new ListItem(reader.GetInt32(0) + " | " + reader.GetString(1), reader.GetInt32(0) + "")); } } } } } BindTable(); }
private void ReadSelectID() { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); UOC_STAFF loginPerson = ps.LoginPerson; using (OracleConnection con = new OracleConnection(DatabaseManager.CONNECTION_STRING)) { con.Open(); using (OracleCommand com = new OracleCommand("SELECT CITIZEN_ID,(SELECT UNIV_NAME_TH FROM REF_UNIV WHERE REF_UNIV.UNIV_ID = UOC_STAFF.UNIV_ID) UNIV_NAME,(SELECT FULLNAME FROM REF_PREFIX_NAME WHERE UOC_STAFF.PREFIX_NAME = REF_PREFIX_NAME.PREFIX_NAME_ID) PREFIX_NAME,STF_FNAME,STF_LNAME,(SELECT GENDER_NAME FROM REF_GENDER WHERE REF_GENDER.GENDER_ID = UOC_STAFF.GENDER_ID) GENDER_NAME,BIRTHDAY,HOMEADD,MOO,STREET,(SELECT PROVINCE_NAME_TH FROM REF_PROVINCE WHERE REF_PROVINCE.PROVINCE_ID = UOC_STAFF.PROVINCE_ID) PROVINCE_NAME,(SELECT DISTRICT_NAME_TH FROM REF_DISTRICT WHERE REF_DISTRICT.DISTRICT_ID = UOC_STAFF.DISTRICT_ID) DISTRICT_NAME,(SELECT SUB_DISTRICT_NAME_TH FROM REF_SUB_DISTRICT WHERE REF_SUB_DISTRICT.SUB_DISTRICT_ID = UOC_STAFF.SUB_DISTRICT_ID) SUB_DISTRICT_NAME,TELEPHONE,ZIPCODE,(SELECT NATION_NAME_ENG FROM REF_NATION WHERE REF_NATION.NATION_ID = UOC_STAFF.NATION_ID) NATION_NAME,(SELECT STAFFTYPE_NAME FROM REF_STAFFTYPE WHERE REF_STAFFTYPE.STAFFTYPE_ID = UOC_STAFF.STAFFTYPE_ID) STAFFTYPE_NAME,(SELECT TIME_CONTACT_NAME FROM REF_TIME_CONTACT WHERE REF_TIME_CONTACT.TIME_CONTACT_ID = UOC_STAFF.TIME_CONTACT_ID) TIME_CONTACT_NAME,(SELECT BUDGET_NAME FROM REF_BUDGET WHERE REF_BUDGET.BUDGET_ID = UOC_STAFF.BUDGET_ID) BUDGET_NAME,(SELECT SUBSTAFFTYPE_NAME FROM REF_SUBSTAFFTYPE WHERE REF_SUBSTAFFTYPE.SUBSTAFFTYPE_ID = UOC_STAFF.SUBSTAFFTYPE_ID) SUBSTAFFTYPE_NAME,(SELECT ADMIN_NAME FROM REF_ADMIN WHERE REF_ADMIN.ADMIN_ID = UOC_STAFF.ADMIN_POSITION_ID) ADMIN_POSITION_NAME,(SELECT POSITION_NAME_TH FROM REF_POSITION WHERE REF_POSITION.POSITION_ID = UOC_STAFF.POSITION_ID) POSITION_NAME,POSITION_WORK,(SELECT FAC_NAME FROM REF_FAC WHERE REF_FAC.FAC_ID = UOC_STAFF.DEPARTMENT_ID) DEPARTMENT_NAME,DATE_INWORK,DATE_START_THIS_U,SPECIAL_NAME,(SELECT ISCED_NAME FROM REF_ISCED WHERE REF_ISCED.ISCED_ID = UOC_STAFF.TEACH_ISCED_ID) TEACH_ISCED_NAME,(SELECT LEV_NAME_TH FROM REF_LEV WHERE REF_LEV.LEV_ID = UOC_STAFF.GRAD_LEV_ID) GRAD_LEV_NAME,GRAD_CURR,(SELECT ISCED_NAME FROM REF_ISCED WHERE REF_ISCED.ISCED_ID = UOC_STAFF.GRAD_ISCED_ID) GRAD_ISCED_NAME,(SELECT PROGRAM_NAME FROM REF_PROGRAM WHERE REF_PROGRAM.PROGRAM_ID_NEW = UOC_STAFF.GRAD_PROG) GRAD_PROG,GRAD_UNIV,(SELECT NATION_NAME_ENG FROM REF_NATION WHERE REF_NATION.NATION_ID = UOC_STAFF.GRAD_COUNTRY_ID) GRAD_COUNTRY_NAME,(SELECT DEFORM_NAME FROM REF_DEFORM WHERE REF_DEFORM.DEFORM_ID = UOC_STAFF.DEFORM_ID) DEFORM_NAME,SIT_NO,SALARY,POSITION_SALARY,(SELECT RELIGION_NAME_TH FROM REF_RELIGION WHERE REF_RELIGION.RELIGION_ID = UOC_STAFF.RELIGION_ID) RELIGION_NAME_TH,(SELECT MOVEMENT_TYPE_NAME FROM REF_MOVEMENT_TYPE WHERE REF_MOVEMENT_TYPE.MOVEMENT_TYPE_ID = UOC_STAFF.MOVEMENT_TYPE_ID) MOVEMENT_TYPE_NAME,MOVEMENT_DATE,DECORATION,RESULT1,PERCENT_SALARY1,RESULT2,PERCENT_SALARY2 FROM UOC_STAFF WHERE UOC_ID = '" + loginPerson.UOC_ID + "'", con)) { using (OracleDataReader reader = com.ExecuteReader()) { while (reader.Read()) { int i = 0; lbCitizenID.Text = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; lbUniv.Text = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; lbPrefixName.Text = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; lbName.Text = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; lbLastName.Text = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; lbGender.Text = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; lbBirthday.Text = reader.IsDBNull(i) ? "" : reader.GetDateTime(i).ToString("dd/MM/yyyy"); ++i; lbHomeAdd.Text = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; } } } } }
protected void btn1_Click(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); UOC_STAFF LoginPerson = ps.LoginPerson; if (FileUpload1.HasFile) { FileInfo fi = new FileInfo(FileUpload1.FileName); string fname = RandomFileName() + fi.Extension; FileUpload1.SaveAs(Server.MapPath("~/Upload/PersonImage/" + fname)); using (OracleConnection con = new OracleConnection(DatabaseManager.CONNECTION_STRING)) { con.Open(); using (OracleCommand com = new OracleCommand("INSERT INTO PS_PERSON_IMAGE (ID, CITIZEN_ID, URL, PRESENT) VALUES (PS_PERSON_IMAGE_SEQ.NEXTVAL, :CITIZEN_ID, :URL, :PRESENT)", con)) { com.Parameters.AddWithValue("CITIZEN_ID", LoginPerson.CITIZEN_ID); com.Parameters.AddWithValue("URL", fname); int v1 = 0; com.Parameters.AddWithValue("PRESENT", v1); com.ExecuteNonQuery(); } } } Page.Response.Redirect(Page.Request.Url.ToString(), true); }
protected void lbuUpdatePerson_Click(object sender, EventArgs e) { if (tbZipcode.Text.Length != 5) { MultiView1.ActiveViewIndex = 0; ScriptManager.GetCurrent(this.Page).SetFocus(this.tbZipcode); ChangeNotification("danger", "กรุณากรอกรหัสไปรษณีย์ให้ครบ 5 หลัก"); return; } PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); UOC_STAFF loginPerson = ps.LoginPerson; PS_PERSON person = new PS_PERSON(); person.HOMEADD = tbHomeAdd.Text; person.MOO = tbMoo.Text; person.STREET = tbStreet.Text; person.SUB_DISTRICT_ID = ddlSubDistrict.SelectedValue; person.DISTRICT_ID = ddlDistrict.SelectedValue; person.PROVINCE_ID = ddlProvince.SelectedValue; person.TELEPHONE = tbTelephone.Text; person.ZIPCODE = tbZipcode.Text; person.NATION_ID = ddlNation.SelectedValue; person.UOC_ID = loginPerson.UOC_ID; person.UPDATE_PERSON_USER(); INSERT_REQUEST(); MultiView1.ActiveViewIndex = 3; btnSelectView0.Visible = false; btnSelectView1.Visible = false; btnSelectView2.Visible = false; btnUpdatePerson.Visible = false; }
protected void Page_Load(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); Person loginPerson = ps.LoginPerson; if (loginPerson.PERSON_ROLE_ID != "2") { Server.Transfer("NoPermission.aspx"); } if (!IsPostBack) { int minDateProject = DatabaseManager.ExecuteInt("SELECT MIN(EXTRACT(YEAR FROM START_DATE)+543) FROM TB_PROJECT"); int currentYear = Util.BudgetYear() + 543; for (int i = minDateProject; i <= currentYear; ++i) { ddlYear.Items.Add(new System.Web.UI.WebControls.ListItem("" + i, "" + i)); } BindDDL(); ddlView.Items.Add(new ListItem("แสดงรายละเอียดข้อมูลของบุคลากร", "1")); ddlView.Items.Add(new ListItem("แสดงจำนวนข้อมูลรวมของบุคลากร", "2")); } if (ddlView.SelectedValue == "1") { BindToTable(); } else if (ddlView.SelectedValue == "2") { BindCountPerson(); } }
protected void lbuFinish_Click(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); Person pp = ps.LoginPerson; DatabaseManager.ExecuteNonQuery("UPDATE PS_PERSON SET PS_PASSWORD = '******' WHERE PS_CITIZEN_ID = '" + pp.CitizenID + "'"); }
protected void Page_Load(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); Person loginPerson = ps.LoginPerson; lbName.Text = loginPerson.FullName; lbPosition.Text = loginPerson.PositionName; lbPositionRank.Text = loginPerson.AdminPositionName; lbDepartment.Text = loginPerson.DepartmentName; int count_cmd_low = DatabaseManager.GetLeaveRequiredCountByCommanderLow(loginPerson.CitizenID); int count_cmd_high = DatabaseManager.GetLeaveRequiredCountByCommanderHigh(loginPerson.CitizenID); int count_finish = 0; using (OleDbConnection con = new OleDbConnection(DatabaseManager.CONNECTION_STRING)) { con.Open(); using (OleDbCommand com = new OleDbCommand("SELECT COUNT(LEAVE_ID) FROM LEV_LEAVE WHERE CITIZEN_ID = '" + loginPerson.CitizenID + "' AND LEV_LEAVE.STATE_ID = 5", con)) { using (OleDbDataReader reader = com.ExecuteReader()) { while (reader.Read()) { count_finish = int.Parse(reader.GetValue(0).ToString()); } } } } int count = count_cmd_low + count_cmd_high + count_finish; notification_area.InnerHtml = ""; if (count == 0) { notification_area.InnerHtml += "<div class='alert alert_info'>ไม่มีรายการแจ้งเตือนในขณะนี้</div>"; notification_area.InnerHtml += "<div><img src='Image/no-email.jpg' style='width: 100px;'/></div>"; } else { notification_area.InnerHtml += "<div class='alert alert_warning'>คุณมี <strong>" + count + "</strong> รายการแจ้งเตือน</div>"; if (count_cmd_low != 0) { notification_area.InnerHtml += "<div class='comment_left' style='margin-bottom: 20px;'></div>"; notification_area.InnerHtml += "<div class='comment_center'><img src='Image/Small/pencil_y.png' class='icon_left'/>คุณมี <strong>" + count_cmd_low + "</strong> รายการที่ต้องลงความเห็นการลา<br>"; notification_area.InnerHtml += "<a href='LeaveComment.aspx' class='button button_default'>ไปหน้าการลงความเห็น<img src='Image/Small/forward.png' class='icon_right' /></a>"; notification_area.InnerHtml += "</div>"; } if (count_cmd_high != 0) { notification_area.InnerHtml += "<div class='allow_left' style='margin-bottom: 20px;'></div>"; notification_area.InnerHtml += "<div class='allow_center'><img src='Image/Small/correct.png' class='icon_left'/>คุณมี " + count_cmd_high + " รายการที่ต้องอนุมัติการลา<br>"; notification_area.InnerHtml += "<a href='LeaveAllow.aspx' class='button button_default'>ไปหน้าการอนุมัติ<img src='Image/Small/forward.png' class='icon_right' /></a>"; notification_area.InnerHtml += "</div>"; } if (count_finish != 0) { notification_area.InnerHtml += "<div class='complete_left' style='margin-bottom: 20px;'></div>"; notification_area.InnerHtml += "<div class='complete_center'>คุณมี " + count_finish + " รายการที่สำเร็จ<br>"; notification_area.InnerHtml += "<a href='LeaveHistory.aspx' class='button button_default'>ไปหน้าสถานะ และ ประวัติการลา<img src='Image/Small/forward.png' class='icon_right' /></a>"; notification_area.InnerHtml += "</div>"; } } }
protected void Page_Init(object sender, EventArgs e) { if (PersonnelSystem.GetPersonnelSystem(this) == null) { Response.Redirect("Access.aspx"); return; } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["id"] == null) { Response.Redirect("ListRequest.aspx"); return; } PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); loginPerson = ps.LoginPerson; Citizen_id = DatabaseManager.ExecuteString("SELECT CITIZEN_ID FROM TB_REQUEST WHERE R_ID = '" + MyCrypto.GetDecryptedQueryString(Request.QueryString["id"].ToString()) + "'"); Person QueryString = DatabaseManager.GetPerson(Citizen_id); if (loginPerson.PERSON_ROLE_ID != "2") { Server.Transfer("NoPermission.aspx"); } if (!IsPostBack) { BindDDL(); ReadID(); ReadRequest(); } lbTitleID.Text = Util.IsBlank(QueryString.PS_TITLE_NAME) ? "-" : QueryString.PS_TITLE_NAME; lbFirstName.Text = Util.IsBlank(QueryString.PS_FIRSTNAME) ? "-" : QueryString.PS_FIRSTNAME; lbLastName.Text = Util.IsBlank(QueryString.PS_LASTNAME) ? "-" : QueryString.PS_LASTNAME; lbGenderID.Text = Util.IsBlank(QueryString.PS_GENDER_NAME) ? "-" : QueryString.PS_GENDER_NAME; lbBirthdayDate.Text = Util.IsBlank(QueryString.PS_BIRTHDAY_DATE.ToString()) ? "-" : QueryString.PS_BIRTHDAY_DATE.Value.ToLongDateString(); lbEmail.Text = Util.IsBlank(QueryString.PS_EMAIL) ? "-" : QueryString.PS_EMAIL; lbNationID.Text = Util.IsBlank(QueryString.PS_NATION_NAME) ? "-" : QueryString.PS_NATION_NAME; lbCampusID.Text = Util.IsBlank(QueryString.PS_CAMPUS_NAME) ? "-" : QueryString.PS_CAMPUS_NAME; lbFacultyID.Text = Util.IsBlank(QueryString.PS_FACULTY_NAME) ? "-" : QueryString.PS_FACULTY_NAME; lbDivisionID.Text = Util.IsBlank(QueryString.PS_DIVISION_NAME) ? "-" : QueryString.PS_DIVISION_NAME; lbWorkDivisionID.Text = Util.IsBlank(QueryString.PS_WORK_DIVISION_NAME) ? "-" : QueryString.PS_WORK_DIVISION_NAME; lbStafftypeID.Text = Util.IsBlank(QueryString.PS_STAFFTYPE_NAME) ? "-" : QueryString.PS_STAFFTYPE_NAME; lbTimeContactID.Text = Util.IsBlank(QueryString.PS_TIME_CONTACT_NAME) ? "-" : QueryString.PS_TIME_CONTACT_NAME; lbBudgetID.Text = Util.IsBlank(QueryString.PS_BUDGET_NAME) ? "-" : QueryString.PS_BUDGET_NAME; lbSubStafftypeID.Text = Util.IsBlank(QueryString.PS_SUBSTAFFTYPE_NAME) ? "-" : QueryString.PS_SUBSTAFFTYPE_NAME; lbAdminPosID.Text = Util.IsBlank(QueryString.PS_ADMIN_POS_NAME) ? "-" : QueryString.PS_ADMIN_POS_NAME; lbWorkPosID.Text = Util.IsBlank(QueryString.PS_WORK_POS_NAME) ? "-" : QueryString.PS_WORK_POS_NAME; lbDateInwork.Text = Util.IsBlank(QueryString.PS_INWORK_DATE.ToString()) ? "-" : QueryString.PS_INWORK_DATE.Value.ToLongDateString(); lbDateStartThisU.Text = Util.IsBlank(QueryString.PS_DATE_START_THIS_U.ToString()) ? "-" : QueryString.PS_DATE_START_THIS_U.Value.ToLongDateString(); lbSpecialName.Text = Util.IsBlank(QueryString.PS_SPECIAL_NAME) ? "-" : QueryString.PS_SPECIAL_NAME; lbTeachIscedID.Text = Util.IsBlank(QueryString.PS_TEACH_ISCED_NAME) ? "-" : QueryString.PS_TEACH_ISCED_NAME; lbGradLevID.Text = Util.IsBlank(QueryString.PS_GRAD_LEV_NAME) ? "-" : QueryString.PS_GRAD_LEV_NAME; lbGradCurr.Text = Util.IsBlank(QueryString.PS_GRAD_CURR) ? "-" : QueryString.PS_GRAD_CURR; lbGradIscedID.Text = Util.IsBlank(QueryString.PS_GRAD_ISCED_NAME) ? "-" : QueryString.PS_GRAD_ISCED_NAME; lbGradProgID.Text = Util.IsBlank(QueryString.PS_GRAD_PROG_NAME) ? "-" : QueryString.PS_GRAD_PROG_NAME; lbGradUniv.Text = Util.IsBlank(QueryString.PS_GRAD_UNIV) ? "-" : QueryString.PS_GRAD_UNIV; lbGradCountryID.Text = Util.IsBlank(QueryString.PS_GRAD_COUNTRY_NAME) ? "-" : QueryString.PS_GRAD_COUNTRY_NAME; lbDeformID.Text = Util.IsBlank(QueryString.PS_DEFORM_NAME) ? "-" : QueryString.PS_DEFORM_NAME; lbReligionID.Text = Util.IsBlank(QueryString.PS_RELIGION_NAME) ? "-" : QueryString.PS_RELIGION_NAME; }
protected void Page_Load(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); loginPerson = ps.LoginPerson; if (!IsPostBack) { ReadRequest(); } }
protected void BindData() { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); UOC_STAFF loginPerson = ps.LoginPerson; OracleConnection con = new OracleConnection(DatabaseManager.CONNECTION_STRING); OracleDataAdapter sda = new OracleDataAdapter("SELECT (SELECT STF_FNAME || ' ' || STF_LNAME FROM UOC_STAFF WHERE UOC_STAFF.UOC_ID = TB_PROJECT.UOC_ID) NAME, (SELECT CATEGORY_NAME FROM TB_PROJECT_CATEGORY WHERE TB_PROJECT_CATEGORY.CATEGORY_ID = TB_PROJECT.CATEGORY_ID) CATEGORY_ID, PROJECT_NAME, ADDRESS_PROJECT, PRO_ID FROM TB_PROJECT ORDER BY UOC_ID ASC", con); DataTable dt = new DataTable(); sda.Fill(dt); myRepeater.DataSource = dt; myRepeater.DataBind(); }
protected void BindData() { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); Person loginPerson = ps.LoginPerson; OracleConnection con = new OracleConnection(DatabaseManager.CONNECTION_STRING); OracleDataAdapter sda = new OracleDataAdapter("SELECT (SELECT PS_FIRSTNAME || ' ' || PS_LASTNAME FROM PS_PERSON WHERE PS_PERSON.PS_CITIZEN_ID = TB_PROJECT.CITIZEN_ID) NAME, (SELECT CATEGORY_NAME FROM TB_PROJECT_CATEGORY WHERE TB_PROJECT_CATEGORY.CATEGORY_ID = TB_PROJECT.CATEGORY_ID) CATEGORY_ID, PROJECT_NAME, ADDRESS_PROJECT, add_months(START_DATE,6516) || ' - ' || add_months(END_DATE,6516) DATEPROJECT, PRO_ID FROM TB_PROJECT WHERE CITIZEN_ID = '" + loginPerson.PS_CITIZEN_ID + "' ORDER BY START_DATE DESC", con); DataTable dt = new DataTable(); sda.Fill(dt); myRepeater.DataSource = dt; myRepeater.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); Person loginPerson = ps.LoginPerson; if (loginPerson.PERSON_ROLE_ID != "99") { Server.Transfer("NoPermission.aspx"); } lbSaveComplete.Visible = false; }
protected void Page_Load(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); Person loginPerson = ps.LoginPerson; if (loginPerson.PERSON_ROLE_ID != "2") { Server.Transfer("NoPermission.aspx"); } if (!IsPostBack) { SQLCampus(); } /*using (OracleCommand com = new OracleCommand("SELECT (SELECT URL FROM PS_PERSON_IMAGE WHERE PS_PERSON.PS_CITIZEN_ID = PS_PERSON_IMAGE.CITIZEN_ID AND PRESENT = 1) URL, PS_PERSON.PS_FN_TH || ' ' || PS_PERSON.PS_LN_TH NAME, PS_EMAIL FROM PS_PERSON", con)) { * using(OracleDataReader reader = com.ExecuteReader()) { * while(reader.Read()) { * Panel pm = new Panel(); * { * string imageURL = reader.IsDBNull(0) ? null : reader.GetString(0); * Panel p1 = new Panel(); * Image img = new Image(); * img.CssClass = "ps-ms-main-drop-profile-pic"; * if (imageURL != null) { * img.Attributes["src"] = "Upload/PersonImage/" + imageURL; * } else { * img.Attributes["src"] = "Image/no_image.png"; * } * p1.Controls.Add(img); * pm.Controls.Add(p1); * } * * { * Label lb = new Label(); * lb.Text = reader.GetString(1) + "<br />" + reader.GetString(2); * pm.Controls.Add(lb); * } * Panel1.Controls.Add(pm); * * } * } * }*/ if (Request.QueryString["q"] != null && Request.QueryString["t"] != null) { string q = Request.QueryString["q"]; string t = Request.QueryString["t"]; funcSearch(q, t); } }
protected void Page_Load(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); loginPerson = ps.LoginPerson; LoadCalendar(Table1, DateTime.Today); LoadCalendar(Table2, DateTime.Today.AddMonths(1)); if (!IsPostBack) { LoadAbsentLate(); } }
protected void Page_Load(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); loginPerson = ps.LoginPerson; if (!IsPostBack) { if (loginPerson.PERSON_ROLE_ID == "4") { divOfficer.Visible = true; divUser.Visible = false; lbuV2Export.Visible = false; int minDateInsigPerson = DatabaseManager.ExecuteInt("SELECT MIN(EXTRACT(YEAR FROM GET_DATE)+543) FROM TB_INSIG_PERSON"); int currentYear = Util.BudgetYear() + 543; for (int i = minDateInsigPerson; i <= currentYear; ++i) { ddlYear.Items.Add(new System.Web.UI.WebControls.ListItem("" + i, "" + i)); } DatabaseManager.BindDropDown(ddlPerson, "SELECT DISTINCT(PS_FIRSTNAME || ' ' || PS_LASTNAME) NAME,CITIZEN_ID FROM TB_INSIG_PERSON INNER JOIN PS_PERSON ON CITIZEN_ID = PS_CITIZEN_ID", "NAME", "CITIZEN_ID", "--กรุณาเลือก--"); DatabaseManager.BindDropDown(ddlCampus, "SELECT * FROM TB_CAMPUS", "CAMPUS_NAME", "CAMPUS_ID", "--กรุณาเลือก--"); ddlView.Items.Add(new ListItem("แสดงรายชื่อผู้ที่กำลังขอเครื่องราชฯ", "1")); ddlView.Items.Add(new ListItem("แสดงรายชื่อผู้ที่ได้รับเครื่องราชฯ", "2")); } else { string CheckNull = DatabaseManager.ExecuteString("SELECT COUNT(*) FROM TB_INSIG_PERSON WHERE CITIZEN_ID = '" + loginPerson.PS_CITIZEN_ID + "'"); if (CheckNull != "0") { divOfficer.Visible = false; divUser.Visible = true; lbFinish.Visible = false; Table table = loadReportSelf(); if (table == null) { return; } Panel2.Controls.Clear(); Panel2.Controls.Add(loadReportSelf()); } else { divUser.Visible = true; lbuV2Export.Visible = false; } } } }
protected void Page_Load(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); loginPerson = ps.LoginPerson; Notsuccess.Visible = true; success.Visible = false; if (!IsPostBack) { BindDDL(); } }
protected void Page_Load(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); loginPerson = ps.LoginPerson; FuncGVFinish(); FuncGVProcessing(); FuncGVHistory(); if (!IsPostBack) { } }
private void ReadSelectID() { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); UOC_STAFF loginPerson = ps.LoginPerson; using (OracleConnection con = new OracleConnection(DatabaseManager.CONNECTION_STRING)) { con.Open(); using (OracleCommand com = new OracleCommand("SELECT HOMEADD,MOO,STREET,PROVINCE_ID,DISTRICT_ID,SUB_DISTRICT_ID,TELEPHONE,ZIPCODE,NATION_ID,SPECIAL_NAME,TEACH_ISCED_ID,UNIV_ID,PREFIX_NAME,STF_FNAME,STF_LNAME FROM UOC_STAFF WHERE CITIZEN_ID = '" + loginPerson.CITIZEN_ID + "'", con)) { using (OracleDataReader reader = com.ExecuteReader()) { while (reader.Read()) { int i = 0; tbHomeAdd.Text = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; tbMoo.Text = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; tbStreet.Text = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; ddlProvince.SelectedValue = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; ddlDistrict.Items.Clear(); string s1 = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; DatabaseManager.BindDropDown(ddlDistrict, "SELECT * FROM REF_DISTRICT WHERE PROVINCE_ID = " + ddlProvince.SelectedValue, "DISTRICT_NAME_TH", "DISTRICT_ID", "--กรุณาเลือกอำเภอ--"); ddlDistrict.SelectedValue = s1; ddlSubDistrict.Items.Clear(); string s2 = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; DatabaseManager.BindDropDown(ddlSubDistrict, "SELECT * FROM REF_SUB_DISTRICT WHERE DISTRICT_ID = " + ddlDistrict.SelectedValue, "SUB_DISTRICT_NAME_TH", "SUB_DISTRICT_ID", "--กรุณาเลือกตำบล--"); ddlSubDistrict.SelectedValue = s2; tbTelephone.Text = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; tbZipcode.Text = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; ddlNation.SelectedValue = reader.IsDBNull(i) ? null : reader.GetString(i); ++i; lbSpecialName.Text = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; lbTeachISCED.Text = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; // ddlUniv.SelectedValue = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; ddlPrefixName.SelectedValue = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; tbName.Text = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; tbLastName.Text = reader.IsDBNull(i) ? "" : reader.GetString(i); ++i; } } } } }
//private List<DateTime> datetimeList; protected void Page_Load(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); pp = ps.LoginPerson; //datetimeList = DatabaseManager.GetLeaveDateTimeFromToDate(pp.CitizenID); LoadCalendar(Panel1, DateTime.Today); if (!IsPostBack) { DateTime dt = DateTime.Today; ddlMonth.SelectedValue = "" + dt.Month; tbYear.Text = "" + (dt.Year + 543); } }
protected void Page_Load(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); Person loginPerson = ps.LoginPerson; if (loginPerson.PERSON_ROLE_ID != "2") { Server.Transfer("NoPermission.aspx"); } if (!IsPostBack) { BindData(); } }
protected void Page_Load(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); Person loginPerson = ps.LoginPerson; string name = loginPerson.FirstNameAndLastName; LinkButton1.Text = "<img src='Image/Small/person.png'/>" + name; LinkButton10.Visible = true; int v1 = DatabaseManager.GetLeaveRequiredCountByCommanderLow(loginPerson.CitizenID); if (v1 != 0) { lbLeaveCommentCount.Text = "" + v1; lbLeaveCommentCount.Visible = true; } else { lbLeaveCommentCount.Text = ""; lbLeaveCommentCount.Visible = false; } int v2 = DatabaseManager.GetLeaveRequiredCountByCommanderHigh(loginPerson.CitizenID); if (v2 != 0) { lbLeaveAllowCount.Text = "" + v2; lbLeaveAllowCount.Visible = true; } else { lbLeaveAllowCount.Text = ""; lbLeaveAllowCount.Visible = false; } /*if(v1 + v2 == 0) { * lbN1.Text = "ไม่มีการแจ้งเตือนการลา"; * } else { * lbN1.Text = "คุณมี " + (v1 + v2) + " การแจ้งเตือนการลา"; * }*/ if (!IsPostBack) { DatabaseManager.AddCounter(); } }
protected void Page_Load(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); loginPerson = ps.LoginPerson; FuncGVFinish(); FuncGVProcessing(); FuncGVHistory(); FuncGVCH(); FuncLeaveClaim(); if (!IsPostBack) { lbuVS1.CssClass = "ps-tab-selected"; } }
protected void Page_Load(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); loginPerson = ps.LoginPerson; if (loginPerson.ST_LOGIN_ID == "0") { ShowOldPass.Visible = false; ShowNewPass.Visible = true; } else if (loginPerson.ST_LOGIN_ID == "1") { ShowOldPass.Visible = true; ShowNewPass.Visible = true; } }
protected void lbuFinish_Click(object sender, EventArgs e) { PersonnelSystem ps = PersonnelSystem.GetPersonnelSystem(this); Person pp = ps.LoginPerson; lbResult.Text = ""; if (loginPerson.ST_LOGIN_ID != "0") { if (tbOld.Text != DatabaseManager.ExecuteString("SELECT PS_PASSWORD FROM PS_PERSON WHERE PS_CITIZEN_ID = '" + pp.PS_CITIZEN_ID + "'")) { lbResult.Text = "รหัสผ่านเก่าไม่ถูกต้อง"; lbResult.ForeColor = System.Drawing.Color.Red; return; } } if (tbNew.Text == "" || tbNew2.Text == "") { lbResult.Text = "กรุณากรอกรหัสใหม่ให้ครบถ้วน"; lbResult.ForeColor = System.Drawing.Color.Red; return; } if (tbNew.Text != tbNew2.Text) { lbResult.Text = "รหัสผ่านใหม่ไม่ตรงกัน"; lbResult.ForeColor = System.Drawing.Color.Red; return; } if (tbNew.Text == tbOld.Text || tbNew2.Text == tbOld.Text) { lbResult.Text = "รหัสผ่านไม่ควรซ้ำรหัสผ่านเดิม"; lbResult.ForeColor = System.Drawing.Color.Red; return; } string source = tbNew.Text; using (MD5 md5Hash = MD5.Create()) { string hash = GetMd5Hash(md5Hash, source); DatabaseManager.ExecuteNonQuery("UPDATE PS_PERSON SET PS_PASSWORD = '******',ST_LOGIN_ID = 1 WHERE PS_CITIZEN_ID = '" + pp.PS_CITIZEN_ID + "'"); lbResult.Text = "เปลี่ยนรหัสผ่านสำเร็จ"; lbResult.ForeColor = System.Drawing.Color.Green; } }