/// <summary> /// /// </summary> /// <param name="visitDataInfo"></param> /// <returns></returns> private String getComsState(VisitDataInfo obj) { String state = ""; if (obj.ApprovalState == 2) { if (obj.VisitorDataInfoList[0].InTime.Equals("-") && obj.VisitorDataInfoList[0].OutTime.Equals("-")) { state = "Hoàn thành phê duyệt (결재 완료)"; } else { state = "Ra cổng (출문)"; if (obj.VisitorDataInfoList[0].OutTime.Equals("-")) { state = "Vào cổng (입문)"; } if (obj.VisitorDataInfoList[0].InTime.Equals("-")) { state = "Đồng ý (승인)"; } } } return(state); }
/// <summary> /// 결재 상태 state process (0 : 결재 신청 대기중 , 1 : 결재중 , 2 : 결재 완료) /// </summary> /// <param name="visitDataInfo"></param> /// <returns></returns> public String getApproveStringKOR(VisitDataInfo visitDataInfo) { String approveString = ""; if (visitDataInfo.ApprovalState == 0) { approveString = "Lưu tạm thời (임시저장)"; } else if (visitDataInfo.ApprovalState == 1) { approveString = "Đang gửi phê duyệt (결재 상신 중)"; } else if (visitDataInfo.ApprovalState == 2) { approveString = getComsState(visitDataInfo); } else if (visitDataInfo.ApprovalState == 3) { approveString = "Trả lại (반려)"; } else if (visitDataInfo.ApprovalState == 4) { } return(approveString); }
protected void Page_Load(object sender, EventArgs e) { // 로그인 체크 check login EmployeeInfo loginEmployee = new EmployeeInfo(); loginEmployee = (EmployeeInfo)Session["loginMember"]; if (loginEmployee == null) { Response.Redirect("~/login.aspx", true); } employeeCode = loginEmployee.Upnid; VisitData bllVisitData = new VisitData(); VisitorData bllVisitorData = new VisitorData(); VisitDataInfo visitDataInfo = new VisitDataInfo(); VisitorDataInfo visitorDataInfo = new VisitorDataInfo(); visitDataInfo = bllVisitData.selectVisitData(Request.QueryString["visitDataCode"]); // 내방객 정보 삭제 xóa thông tin khách đến thăm List <VisitorDataInfo> list = bllVisitorData.selectVisitorDataList(Request.QueryString["visitDataCode"]); for (int i = 0; i < list.Count; i++) { VisitorDataInfo subVisitor = (VisitorDataInfo)list[i]; int resultDel = bllVisitorData.deleteVisitorData(subVisitor); } // 첨부 파일 삭제 xóa file đính kèm if (!String.IsNullOrEmpty(visitDataInfo.UserFile1)) { bllVisitData.DeleteUserFile(Request.QueryString["visitDataCode"], "1", bllVisitData.GetFileName(visitDataInfo.UserFile1)); } if (!String.IsNullOrEmpty(visitDataInfo.UserFile1)) { bllVisitData.DeleteUserFile(Request.QueryString["visitDataCode"], "2", bllVisitData.GetFileName(visitDataInfo.UserFile3)); } if (!String.IsNullOrEmpty(visitDataInfo.UserFile1)) { bllVisitData.DeleteUserFile(Request.QueryString["visitDataCode"], "3", bllVisitData.GetFileName(visitDataInfo.UserFile3)); } // 내방 정보 삭제 xóa thông tin đến thăm int result = bllVisitData.deleteVisitData(visitDataInfo); // 결재코드 code phê duyệt doc_code = visitDataInfo.ElecApproveCode; Response.Redirect("listVisit.aspx", true); }
protected void Page_Load(object sender, EventArgs e) { VisitData bll = new VisitData(); VisitDataInfo visitDataInfo = bll.selectVisitData(Request.QueryString["visitDataCode"]); VisitorData bllVisitorData = new VisitorData(); VisitorDataInfo visitorDataInfo = bllVisitorData.selectVisitorData(Request.QueryString["visitorDataCode"]); lblRegDate.Text = visitDataInfo.RegDate.ToString(); lblApproveTime.Text = visitDataInfo.ApproveTime.ToString(); lblINTime.Text = visitorDataInfo.InTime; lblOutTime.Text = visitorDataInfo.OutTime; }
protected void GridViewExcel_RowDataBound1(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { VisitDataInfo obj = (VisitDataInfo)e.Row.DataItem; e.Row.Cells[0].Text = obj.OfficeInfo.OfficeName; e.Row.Cells[1].Text = obj.VisitorDataInfoList[0].VisitDate; e.Row.Cells[2].Text = obj.VisitorDataInfoList[0].VisitorInfo.VisitorName; //e.Row.Cells[3].Text = obj.VisitorDataInfoList[0].VisitorInfo.VisitorRegNumber1 + " - " + obj.VisitorDataInfoList[0].VisitorInfo.VisitorRegNumber2; e.Row.Cells[3].Text = obj.VisitorDataInfoList[0].VisitorInfo.VisitorRegNumber1; e.Row.Cells[4].Text = obj.VisitorDataInfoList[0].VisitorInfo.VisitorPhone1 + " " + obj.VisitorDataInfoList[0].VisitorInfo.VisitorPhone2 + " " + obj.VisitorDataInfoList[0].VisitorInfo.VisitorPhone3; e.Row.Cells[5].Text = obj.VisitorDataInfoList[0].CompanyInfo.CompanyName; e.Row.Cells[6].Text = obj.CarDataInfo.CodeName; e.Row.Cells[7].Text = obj.CarDataInfo.Header + " " + obj.CarDataInfo.Number; e.Row.Cells[8].Text = obj.VisitObjectInfo.VisitObjectName; e.Row.Cells[9].Text = obj.VisitObjectContents; e.Row.Cells[10].Text = obj.VisitorDataInfoList[0].InTime; e.Row.Cells[11].Text = obj.VisitorDataInfoList[0].OutTime; e.Row.Cells[12].Text = obj.ReqEmployeeInfo.DisplayName; e.Row.Cells[13].Text = obj.ReqEmployeeInfo.Upnid; e.Row.Cells[14].Text = obj.ReqEmployeeInfo.Title_name; e.Row.Cells[15].Text = obj.ReqEmployeeInfo.Dep_name; e.Row.Cells[16].Text = obj.ReqEmployeeInfo.MobilePhoneNumber; e.Row.Cells[17].Text = obj.InterviewEmployeeInfo.DisplayName; e.Row.Cells[18].Text = obj.InterviewEmployeeInfo.Upnid; VisitData bll = new VisitData(); // 상태 String approveString = bll.getApproveStringKOR(obj); e.Row.Cells[19].Text = approveString; e.Row.Cells[20].Text = obj.InSecurityEmployeeInfo.DisplayName; e.Row.Cells[21].Text = obj.OutSecurityEmployeeInfo.DisplayName; for (int i = 0; i < e.Row.Cells.Count; i++) { if (i < 13) { e.Row.Cells[i].Attributes.Add("onclick", "window.location='visitDataView.aspx?visitDataCode=" + obj.VisitDataCode + "';"); e.Row.Cells[i].Attributes.Add("style", "cursor:hand;"); } } e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#C0C0C0'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFFFFF'"); } }
protected void Page_Load(object sender, EventArgs e) { // 로그인 체크 EmployeeInfo loginEmployee = new EmployeeInfo(); loginEmployee = (EmployeeInfo)Session["loginMember"]; if (loginEmployee == null) { Response.Redirect("~/login.aspx", true); } // 내방 보안 요원 Employee bllEmployee = new Employee(); if (loginEmployee.ManagerLevel < 2) { Response.Redirect("~/login.aspx", true); } VisitDataInfo visitDataInfo = bll.selectVisitData(Request.QueryString["visitDataCode"]); // 임직원 정보 보이기 lblDepartment.Text = visitDataInfo.ReqEmployeeInfo.Dep_name; lblUpnid.Text = visitDataInfo.ReqEmployeeInfo.Upnid; lblOfficeName.Text = visitDataInfo.OfficeInfo.OfficeName; lblDisplayName.Text = visitDataInfo.ReqEmployeeInfo.DisplayName; lblTitle.Text = visitDataInfo.ReqEmployeeInfo.Title_name; lblPhone.Text = visitDataInfo.ReqEmployeeInfo.MobilePhoneNumber; // 내방 정보 보이기 lblVisitObjectName.Text = visitDataInfo.VisitObjectInfo.VisitObjectName; lblVisitObjectContents.Text = visitDataInfo.VisitObjectContents; lblInterviewUserName.Text = visitDataInfo.InterviewEmployeeInfo.DisplayName; lblOfficeNameDetail.Text = visitDataInfo.OfficeInfo.OfficeName + " " + visitDataInfo.OfficeContents; lblCarNumber.Text = visitDataInfo.CarDataInfo.Header + " " + visitDataInfo.CarDataInfo.Number; }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { VisitDataInfo obj = (VisitDataInfo)e.Row.DataItem; e.Row.Cells[1].Text = obj.VisitorDataInfoList[0].VisitDate; // 예약일 ngày hẹn e.Row.Cells[2].Text = obj.VisitorDataInfoList[0].VisitorInfo.VisitorName; // 내방객 이름 tên khách đến thăm e.Row.Cells[3].Text = obj.VisitorDataInfoList[0].CompanyInfo.CompanyName; // 회사명 tên công ty e.Row.Cells[4].Text = obj.VisitorDataInfoList[0].VisitorInfo.VisitorPhone1 + "-" + obj.VisitorDataInfoList[0].VisitorInfo.VisitorPhone2 + "-" + obj.VisitorDataInfoList[0].VisitorInfo.VisitorPhone3; // 전화번호 sđt e.Row.Cells[5].Text = obj.ReqEmployeeInfo.Dep_name; // 신청부서 bộ phận đăng ký e.Row.Cells[6].Text = obj.ReqEmployeeInfo.DisplayName; // 신청자 người đăng ký e.Row.Cells[7].Text = obj.InterviewEmployeeInfo.DisplayName; // 접견자 người đón tiếp e.Row.Cells[8].Text = obj.VisitObjectInfo.VisitObjectName; // 방문목적 mục đích đến e.Row.Cells[9].Text = obj.CarDataInfo.Header + " " + obj.CarDataInfo.Number; // 차량번호 số xe e.Row.Cells[10].Text = bll.getApproveStringKOR(obj); //// 결재 상태 trạng thái phê duyệt String approveString = bll.getApproveStringKOR(obj); // 결재 상신중일 경우 결재 상태 보기 xem trạng thái phê duyệt khi gửi phê duyệt if (obj.ApprovalState == 1) { e.Row.Cells[10].Text = "<a href=\"#;\" onclick=\"showApproveStatus('" + obj.ElecApproveCode + "')\">" + approveString + "</a>"; } else { e.Row.Cells[10].Text = approveString; } // 반려 일 경우 삭제 xóa trường hợp hoàn lại if (obj.ApprovalState == 3) { e.Row.Cells[12].Text = "<a href='#;' onclick=\"javascript:confirmDelete('deleteVisit.aspx?visitDataCode=" + obj.VisitDataCode + "');\">"; e.Row.Cells[12].Text += "<img src='/COMS/images/icon/delete.gif'></a>"; } // 임시저장일 경우 수정과 삭제 보이기 sửu và xóa trường hợp lưu tạm thời if (obj.ApprovalState == 0) { e.Row.Cells[11].Text = "<a href='inputVisit.aspx?visitDataCode=" + obj.VisitDataCode + "&mode=modify'>"; e.Row.Cells[11].Text += "<img src='/COMS/images/icon/edit.gif'></a>"; e.Row.Cells[12].Text = "<a href='#;' onclick=\"javascript:confirmDelete('deleteVisit.aspx?visitDataCode=" + obj.VisitDataCode + "');\">"; e.Row.Cells[12].Text += "<img src='/COMS/images/icon/delete.gif'></a>"; } // 링크 걸기 for (int i = 0; i < e.Row.Cells.Count; i++) { if (i < 10) { e.Row.Cells[i].Attributes.Add("onclick", "window.location='viewVisitManager.aspx?visitDataCode=" + obj.VisitDataCode + "&visitorDataCode=" + obj.VisitorDataInfoList[0].VisitorDataCode + "';"); e.Row.Cells[i].Attributes.Add("style", "cursor:hand;"); } } e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#C0C0C0'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFFFFF'"); } }
public int deleteVisitData(VisitDataInfo visitData) { return(dal.deleteVisitData(visitData)); }
public int insertVisitData(VisitDataInfo visitData) { return(dal.insertVisitData(visitData)); }
public int updateVisitData(VisitDataInfo visitData) { return(dal.updateVisitData(visitData)); }
protected void Page_Load(object sender, EventArgs e) { // 로그인 체크 check login if (this.Context.User.Identity.Name == null) { Response.Redirect("~/login.aspx", true); } EmployeeInfo loginEmployee = new EmployeeInfo(); Employee bllEmployee = new Employee(); loginEmployee = bllEmployee.selectEmployee(this.Context.User.Identity.Name); loginEmploeeDepartmentName = loginEmployee.Dep_name; loginEmploeeDisplayName = loginEmployee.DisplayName; loginEmployeeUpnid = loginEmployee.Upnid; loginEmployeeTitle = loginEmployee.Title_name; VisitDataInfo visitDataInfo = bll.selectVisitData(Request.QueryString["visitDataCode"]); VisitorDataInfo visitorDataInfo = bllVisitorData.selectVisitorData(Request.QueryString["visitorDataCode"]); // 임직원 정보 보이기 xem nhân viên lblDepartment.Text = visitDataInfo.ReqEmployeeInfo.Dep_name; lblUpnid.Text = visitDataInfo.ReqEmployeeInfo.Upnid; lblOfficeName.Text = visitDataInfo.ReqEmployeeInfo.OfficeName; lblDisplayName.Text = visitDataInfo.ReqEmployeeInfo.DisplayName; lblTitle.Text = visitDataInfo.ReqEmployeeInfo.Title_name; lblPhone.Text = visitDataInfo.ReqEmployeeInfo.MobilePhoneNumber; // 입문 출문 시간 보이기 (보안실 or Admin) thời gian vào/ ra (bảo an, admin) // 보안 요원 체크 check yêu cầu bảo an if (loginEmployee.ManagerLevel < 0) { pnlSecurity.Visible = false; } else { pnlSecurity.Visible = true; } // 내방 정보 보이기 xem thông tin khách thăm lblVisitObjectName.Text = visitDataInfo.VisitObjectInfo.VisitObjectName; lblVisitObjectContents.Text = visitDataInfo.VisitObjectContents; lblInterviewUserName.Text = visitDataInfo.InterviewEmployeeInfo.DisplayName; // 결재 코드 elecApproveCode = visitDataInfo.ElecApproveCode; // 결재라인 가져오기 HtmlGenericControl body = Master.FindControl("body") as HtmlGenericControl; if (body != null) { body.Attributes["onload"] = ShowApproveLine(); } lblOfficeNameDetail.Text = visitDataInfo.OfficeInfo.OfficeName + " " + visitDataInfo.OfficeContents; lblCarNumber.Text = visitDataInfo.CarDataInfo.Header + " " + visitDataInfo.CarDataInfo.Number + " " + visitDataInfo.CarDataInfo.CarCode; //// 내방객의 입문 시간 //if (String.IsNullOrEmpty(visitorDataInfo.InTime)) lblInTime.Text = ""; //else lblInTime.Text = visitorDataInfo.InTime.ToString(); lblInTime.Text = visitorDataInfo.InTime; //// 내방객의 출문 시간이 없다면 //if (visitDataInfo.OutTime.Year == 1) lblOutTime.Text = ""; //else lblOutTime.Text = visitDataInfo.OutTime.ToString(); lblOutTime.Text = visitorDataInfo.OutTime; // 첨부 파일 정보 thông tin tệp đính kèm if (!String.IsNullOrEmpty(visitDataInfo.UserFile1)) { String[] arrUserFile1 = visitDataInfo.UserFile1.Split('|'); lblUserFile1.Text = "<a href='" + ConfigurationManager.AppSettings["fileOpenPath"] + "/" + arrUserFile1[0] + "' target='_blank'>" + arrUserFile1[0] + "</a>"; } if (!String.IsNullOrEmpty(visitDataInfo.UserFile2)) { String[] arrUserFile2 = visitDataInfo.UserFile2.Split('|'); lblUserFile2.Text = "<a href='" + ConfigurationManager.AppSettings["fileOpenPath"] + "/" + arrUserFile2[0] + "' target='_blank'>" + arrUserFile2[0] + "</a>"; } if (!String.IsNullOrEmpty(visitDataInfo.UserFile3)) { String[] arrUserFile3 = visitDataInfo.UserFile3.Split('|'); lblUserFile3.Text = "<a href='" + ConfigurationManager.AppSettings["fileOpenPath"] + "/" + arrUserFile3[0] + "' target='_blank'>" + arrUserFile3[0] + "</a>"; } // 결재 상신 전이라면 if (visitDataInfo.ApprovalState == 0) { // 결재라인 변경 이미지 btnElecApproveLine.Visible = true; // 결재 상신 버튼 btnApproveStart.Visible = true; } else { btnApproveStart.Visible = false; btnElecApproveLine.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { // 로그인 체크 check login EmployeeInfo loginEmployee = new EmployeeInfo(); loginEmployee = (EmployeeInfo)Session["loginMember"]; if (loginEmployee == null) { Response.Redirect("~/login.aspx", true); } if (loginEmployee.ManagerLevel < 1) { Response.Redirect("~/login.aspx", true); } String code = "0"; String[] selectCheckList = Request.Form.GetValues("selectCheck"); String[] cardNoList = Request.Form.GetValues("cardNo"); String[] cardNoList2 = new String[selectCheckList.Length]; int k = 0; for (int i = 0; i < cardNoList.Length; i++) { if (!cardNoList[i].Equals("")) { cardNoList2[k] = cardNoList[i]; k++; } } VisitDataInfo checkVisitData = new VisitDataInfo(); VisitDataInfo oldVisitDataInfo = new VisitDataInfo(); VisitorDataInfo visitorDataInfo = new VisitorDataInfo(); VisitData bllVisitData = new VisitData(); VisitorData bllVisitorData = new VisitorData(); int visitDataCode; // 내방 코드 visit code bool checkToday = false; // 금일날짜 내방 정보중 출문미처리 된 내역 //chi tiết thông tin khách thăm chưa được xử lý ra cổng ngày hôm nay // 금일날짜 내방 정보중 출문미처리 된 내역 확인 // kiểm tra chi tiết thông tin khách thăm chưa được xử lý ra cổng ngày hôm nay for (int i = 0; i < selectCheckList.Length; i++) { //내방객 내방내역 정보 가져오기(visitorCode 가져오기 위함) // mang theo thông tin chi tiết khách thăm visitorDataInfo = bllVisitorData.selectVisitorData(selectCheckList[i]); // 금일날짜 내방 정보중 출문미처리 된 내역 //chi tiết thông tin khách thăm chưa được xử lý ra cổng ngày hôm nay checkToday = bllVisitorData.checkTodayVisitorData(visitorDataInfo.VisitorInfo.VisitorCode.ToString()); if (checkToday == true) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", HanaMicron.COMS.Utility.JavaScriptBuilder.alert(visitorDataInfo.VisitorInfo.VisitorName + " đã hoàn thành vào cổng (님은 현재 입문처리 된 상태 입니다).", "longVisitDataList.aspx")); //Page.RegisterStartupScript("alert", JavaScriptBuilder.alert(visitorDataInfo.VisitorInfo.VisitorName + " 님은 현재 입문처리 된 상태 입니다.", "longVisitDataList.aspx")); } } if (checkToday == false) { for (int i = 0; i < selectCheckList.Length; i++) { code = "0"; //내방객 내방내역 정보 가져오기 // mang theo thông tin chi tiết khách thăm visitorDataInfo = bllVisitorData.selectVisitorData(selectCheckList[i]); //내방정보 longVisitDataCode 오늘날짜 있는지 확인. checkVisitData = bllVisitData.checkLongVisitDataCode(visitorDataInfo.VisitDataCode.ToString(), code); //내방정보가 없을때 등록 đăng ký khi không có thông tin khách thăm if (checkVisitData.VisitDataCode == 0) { code = "1"; oldVisitDataInfo = bllVisitData.checkLongVisitDataCode(visitorDataInfo.VisitDataCode.ToString(), code); oldVisitDataInfo.VisitFlag = 2; oldVisitDataInfo.ApprovalState = 2; oldVisitDataInfo.StartDate = oldVisitDataInfo.StartDate.Substring(0, 10); oldVisitDataInfo.EndDate = oldVisitDataInfo.EndDate.Substring(0, 10); oldVisitDataInfo.LongVisitDataCode = oldVisitDataInfo.VisitDataCode; int resultCode = bllVisitData.insertVisitData(oldVisitDataInfo); // 마지막 입력된 visitDataCode 값 가져오기 visitDataCode = bllVisitData.selectMaxCode(); visitorDataInfo.VisitDataCode = visitDataCode; } else { visitorDataInfo.VisitDataCode = checkVisitData.VisitDataCode; } visitorDataInfo.VisitDate = DateTime.Today.ToString("yyyy.MM.dd"); bllVisitorData.insertVisitorData(visitorDataInfo); // 마지막 입력된 visitorDataCode 값 가져오기 visitorDataInfo.VisitorDataCode = bllVisitorData.selectMaxVisitorDataCode(); visitorDataInfo.CardNo = cardNoList2[i]; bllVisitorData.updateInTime(visitorDataInfo); } Response.Redirect("visitDataList.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { // 로그인 체크 EmployeeInfo loginEmployee = new EmployeeInfo(); loginEmployee = (EmployeeInfo)Session["loginMember"]; if (loginEmployee == null) { Response.Redirect("~/login.aspx", true); } if (Page.IsPostBack) { VisitDataInfo visitDataInfo = new VisitDataInfo(); visitDataInfo.VisitObjectInfo = new VisitObjectInfo(); visitDataInfo.ReqEmployeeInfo = new EmployeeInfo(); visitDataInfo.InterviewEmployeeInfo = new EmployeeInfo(); visitDataInfo.InSecurityEmployeeInfo = new EmployeeInfo(); visitDataInfo.OutSecurityEmployeeInfo = new EmployeeInfo(); visitDataInfo.CarDataInfo = new CarDataInfo(); visitDataInfo.OfficeInfo = new OfficeInfo(); visitDataInfo.VisitorDataInfoList = new List <VisitorDataInfo>(); #region 일 업로드 // upload file //String userFileMimeType1 = String.Empty; //String userFileMimeType2 = String.Empty; //String userFileMimeType3 = String.Empty; //String userFileName1 = String.Empty; //String userFileName2 = String.Empty; //String userFileName3 = String.Empty; //String userFileByte1 = String.Empty; //String userFileByte2 = String.Empty; //String userFileByte3 = String.Empty; //String userFileDBName1 = String.Empty; //String userFileDBName2 = String.Empty; //String userFileDBName3 = String.Empty; //String separator = "|"; //String fileUploadDir = ConfigurationManager.AppSettings["fileUploadPath"]; //string[] arrFileName; //string ext; //if (userFile1.HasFile) //{ // arrFileName = userFile1.FileName.Split('.'); // ext=arrFileName[arrFileName.Length - 1].ToLower(); // userFileName1 = HanaMicron.COMS.Utility.StringUtil.ReplaceSpecial(userFile1.FileName.Replace("."+ext,"")) + "." + ext; // String savePath1 = fileUploadDir + "\\" + (userFileName1); // userFileMimeType1 = userFile1.PostedFile.ContentType; // userFileByte1 = userFile1.PostedFile.ContentLength.ToString(); // userFile1.SaveAs(savePath1); // userFileDBName1 = userFileName1 + separator + userFileMimeType1 + separator + userFileByte1; //} //if (userFile2.HasFile) //{ // arrFileName = userFile2.FileName.Split('.'); // ext = arrFileName[arrFileName.Length - 1].ToLower(); // userFileName2 = HanaMicron.COMS.Utility.StringUtil.ReplaceSpecial(userFile2.FileName.Replace("." + ext, "")) + "." + ext; // userFileMimeType2 = userFile2.PostedFile.ContentType; // userFileByte2 = userFile2.PostedFile.ContentLength.ToString(); // String savePath2 = fileUploadDir + "\\" + userFileName2; // userFile2.SaveAs(savePath2); // userFileDBName2 = userFileName2 + separator + userFileMimeType2 + separator + userFileByte2; //} //if (userFile3.HasFile) //{ // arrFileName = userFile3.FileName.Split('.'); // ext = arrFileName[arrFileName.Length - 1].ToLower(); // userFileName3 = HanaMicron.COMS.Utility.StringUtil.ReplaceSpecial(userFile3.FileName.Replace("." + ext, "")) + "." + ext; // userFileMimeType3 = userFile3.PostedFile.ContentType; // userFileByte3 = userFile3.PostedFile.ContentLength.ToString(); // String savePath3 = fileUploadDir + "\\" + userFileName3; // userFile3.SaveAs(savePath3); // userFileDBName3 = userFileName3 + separator + userFileMimeType3 + separator + userFileByte3; //} #endregion #region 객체 만들기 //tạo Object // 수정하기 전에 보존 되어야 할 정보를 위해서 이전 Record 를 가져온다.// Để bảo quản thông tin, trước khi sửa phải mang theo Record trước đó if (!String.IsNullOrEmpty(Request.QueryString["visitDataCode"])) { visitDataInfo = bllVisitData.selectVisitData(Request.QueryString["visitDataCode"]); } visitDataInfo.ReqEmployeeInfo.Upnid = loginEmployee.Upnid; visitDataInfo.InterviewEmployeeInfo.Upnid = Request["upnid"]; visitDataInfo.VisitObjectInfo.VisitObjectCode = Convert.ToInt32(DropDownList1.SelectedValue); visitDataInfo.VisitObjectContents = Request["visitObjectContents"]; visitDataInfo.OfficeInfo.OfficeCode = Convert.ToInt32(DropDownList2.SelectedValue); visitDataInfo.OfficeContents = txtOfficeContents.Text; visitDataInfo.ElecApproveCode = Request["elecApproveCode"]; //string test = Request.Form["longVisit"]; if (Request.Form["longVisit"] == "1") { visitDataInfo.VisitFlag = 1; //if (longVisit.Checked==true) visitDataInfo.VisitFlag = 1; visitDataInfo.StartDate = txtStartDate.Text; visitDataInfo.EndDate = txtEndDate.Text; } else // 장기 내방이 아니면 시작일,종료일 데이터 입력 안되게 // Nếu không phải khách đến thăm dài hạn thì không thể nhập ngày bắt đầu, ngày kết thúc { visitDataInfo.VisitFlag = 0; visitDataInfo.StartDate = String.Empty; visitDataInfo.EndDate = String.Empty; } if (String.IsNullOrEmpty(Request["carCode"])) { visitDataInfo.CarDataInfo.CarCode = 0; } else { visitDataInfo.CarDataInfo.CarCode = Convert.ToInt32(Request["carCode"]); } #endregion #region 저장 //save int visitDataCode; // 내방 코드 visit code // 수정 sửa if (Request.QueryString["mode"].Equals("modify")) { //visitDataInfo.InTime =new DateTime(); //visitDataInfo.OutTime = new DateTime(); visitDataInfo.VisitDataCode = Convert.ToInt32(Request.QueryString["visitDataCode"]); //if (!String.IsNullOrEmpty(userFileName1)) visitDataInfo.UserFile1 = userFileDBName1; //if (!String.IsNullOrEmpty(userFileName2)) visitDataInfo.UserFile2 = userFileDBName2; //if (!String.IsNullOrEmpty(userFileName3)) visitDataInfo.UserFile3 = userFileDBName3; bllVisitData.updateVisitData(visitDataInfo); visitDataCode = Convert.ToInt32(Request.QueryString["visitDataCode"]); // 이전에 저장된 내방객 정보 삭제 // xóa thông tin khách đến thăm được lưu trữ trước đây List <VisitorDataInfo> list = bllVisitorData.selectVisitorDataList(Request.QueryString["visitDataCode"]); for (int i = 0; i < list.Count; i++) { int resultDel = bllVisitorData.deleteVisitorData((VisitorDataInfo)list[i]); } } // 추가 thêm else { //visitDataInfo.UserFile1 = userFileDBName1; //visitDataInfo.UserFile2 = userFileDBName2; //visitDataInfo.UserFile3 = userFileDBName3; int resultCode = bllVisitData.insertVisitData(visitDataInfo); visitDataCode = bllVisitData.selectMaxCode(); } #endregion #region 내방객 정보 넣기 // Thêm thông tin khách đến thăm int freepassCount = 0; int flag; String reqVisitorCode = Request["visitorCode"]; String[] arrVisitorCode = reqVisitorCode.Split(','); for (int i = 0; i < arrVisitorCode.Length; i++) { //VisitorDataInfo visitorDataInfo = new VisitorDataInfo(); visitorDataInfo.VisitorInfo = new VisitorInfo(); if (!String.IsNullOrEmpty(arrVisitorCode[i])) { visitorDataInfo.VisitDataCode = visitDataCode; visitorDataInfo.VisitorInfo.VisitorCode = Convert.ToInt32(arrVisitorCode[i]); // 장기내방이면 내방일을 장기내방 시작일로 넣음. // Nếu là khách đến thăm dài hạn thì thêm ngày bắt đầu thăm dài hạn if (Request.Form["longVisit"] == "1") { visitorDataInfo.VisitDate = txtStartDate.Text; } else { visitorDataInfo.VisitDate = Request.Form["visitDate"]; } // 내방객 중에 Free pass 내방객이 있는지 확인 Trong những khách đến thăm, Kiểm tra xem khách đến thăm có hay không có Free pass bool existsFree = bllVisitor.existsFreepassVisitor(visitorDataInfo.VisitorInfo.VisitorCode); if (existsFree == true) { freepassCount++; } bllVisitorData.insertVisitorData(visitorDataInfo); } } #endregion // 장기 내방을 제외하고 단기 또는 Freepass는 VisitFlag 수정 // Ngoại trừ khách thăm dài hạn, Sửa VisitFlag của khách thăm ngắn hạn hoặc Freepass if (visitDataInfo.VisitFlag != 1) { // Freepass 인원이 한명이라도 있으면 visitFlag = 5 // cho dù chỉ có 1 người là Freepass thì visitFlag = 5 if (freepassCount > 0) { flag = 5; bllVisitData.updateVisitData(visitDataCode, flag); } // Freepass 인원이 한명이라도 있으면 visitFlag = 0 (일반인원으로 모두 수정했을때를 예상하여) cho dù chỉ có 1 người là Freepass thì visitFlag = 0 (dự đoán Khi đã sửa tất cả khách thường) else { flag = 0; bllVisitData.updateVisitData(visitDataCode, flag); } } List <VisitorDataInfo> visitorList = bllVisitorData.selectVisitorDataList(visitDataCode.ToString()); Response.Redirect("viewVisitManager.aspx?visitDataCode=" + visitDataCode + "&visitorDataCode=" + visitorList[0].VisitorDataCode, true); } else { #region 수정 or 신규등록 정보 보이기 // sửa hoặc đăng ký thông tin mới if (Request.QueryString["mode"].Equals("modify")) { VisitDataInfo visitData = bllVisitData.selectVisitData(Request.QueryString["visitDataCode"]); interviewUserCode = visitData.InterviewEmployeeInfo.Upnid; interviewUserName = visitData.InterviewEmployeeInfo.DisplayName; officeContents = visitData.OfficeContents; carCode = visitData.CarDataInfo.CarCode.ToString(); carNumber = visitData.CarDataInfo.Header + visitData.CarDataInfo.Number; visitObjectContents = visitData.VisitObjectContents; txtOfficeContents.Text = visitData.OfficeContents; DropDownList1.SelectedValue = visitData.VisitObjectInfo.VisitObjectCode.ToString(); DropDownList2.SelectedValue = visitData.OfficeInfo.OfficeCode.ToString(); if (visitData.VisitFlag == 1) { check = "1"; txtStartDate.Text = visitData.StartDate.Substring(0, 10); txtEndDate.Text = visitData.EndDate.Substring(0, 10); } else //장기내방이 아니면 시작일,종료일(1800-01-01) 안나오게.. // nếu không phải khách đến thăm dài hạn thì không hiển thị ngày bắt đầu, ngày kết thúc { txtStartDate.Text = ""; txtEndDate.Text = ""; } //else longVisit.Checked = false; //if (visitData.VisitFlag == 1) longVisit.Checked = true; //else longVisit.Checked = false; List <VisitorDataInfo> visitorList = bllVisitorData.selectVisitorDataList(visitData.VisitDataCode.ToString()); for (int i = 0; i < visitorList.Count; i++) { VisitorDataInfo subVisitor = (VisitorDataInfo)visitorList[i]; reqVisitData = subVisitor.VisitDate; arrVisitorList += "visitorCode[" + i + "]='" + subVisitor.VisitorInfo.VisitorCode + "';\n"; //arrVisitorList += "visitorRegNumber[" + i + "]='" + subVisitor.VisitorInfo.VisitorRegNumber1 + "-" + subVisitor.VisitorInfo.VisitorRegNumber2 + "';\n"; arrVisitorList += "visitorRegNumber[" + i + "]='" + subVisitor.VisitorInfo.VisitorRegNumber1 + "';\n"; arrVisitorList += "visitorPassportNumber[" + i + "]='" + subVisitor.VisitorInfo.VisitorPassportNumber + "';\n"; arrVisitorList += "visitorName[" + i + "]='" + subVisitor.VisitorInfo.VisitorName + "';\n"; arrVisitorList += "companyName[" + i + "]='" + subVisitor.CompanyInfo.CompanyName + "';\n"; arrVisitorList += "phone[" + i + "]='" + subVisitor.VisitorInfo.VisitorPhone1 + "-" + subVisitor.VisitorInfo.VisitorPhone2 + "-" + subVisitor.VisitorInfo.VisitorPhone3 + "';\n"; } displayCellCount = visitorList.Count.ToString(); // 결재 코드 code phê duyệt approveDocCode = visitData.ElecApproveCode; //첨부 파일 đính kèm file //if (!String.IsNullOrEmpty(visitData.UserFile1)) //{ // lblUserFile1.Text = "<a href='" + ConfigurationManager.AppSettings["fileOpenPath"] + "/" + bllVisitData.GetFileName(visitData.UserFile1) + "' target='_blank'>" + bllVisitData.GetFileName(visitData.UserFile1) + "</a>"; // lblUserFile1.Text += "<a href='#;' onclick=\"confirmMove('Có chắc chắn xóa không? 정말로 삭제하시겠습니까?','userFileDelete.aspx?visitDataCode=" + visitData.VisitDataCode + "&fileNumber=1&fileName=" + HttpUtility.UrlEncode(bllVisitData.GetFileName(visitData.UserFile1)) + "',document.dummy)\"><img src='../../images/icon/fileDelete.gif' align='absmiddle'></a>"; //} //if (!String.IsNullOrEmpty(visitData.UserFile2)) //{ // String[] arrUserFile2 = visitData.UserFile2.Split('|'); // lblUserFile2.Text = "<a href='" + ConfigurationManager.AppSettings["fileOpenPath"] + "/" + bllVisitData.GetFileName(visitData.UserFile2) + "' target='_blank'>" + bllVisitData.GetFileName(visitData.UserFile2) + "</a>"; // lblUserFile2.Text += "<a href='#;' onclick=\"confirmMove('Có chắc chắn xóa không? 정말로 삭제하시겠습니까?','userFileDelete.aspx?visitDataCode=" + visitData.VisitDataCode + "&fileNumber=2&fileName=" + HttpUtility.UrlEncode(bllVisitData.GetFileName(visitData.UserFile2)) + "',document.dummy)\"><img src='../../images/icon/fileDelete.gif' align='absmiddle'></a>"; //} //if (!String.IsNullOrEmpty(visitData.UserFile3)) //{ // String[] arrUserFile3 = visitData.UserFile3.Split('|'); // lblUserFile3.Text = "<a href='" + ConfigurationManager.AppSettings["fileOpenPath"] + "/" + bllVisitData.GetFileName(visitData.UserFile3) + "' target='_blank'>" + bllVisitData.GetFileName(visitData.UserFile3) + "</a>"; // lblUserFile3.Text += "<a href='#;' onclick=\"confirmMove('Có chắc chắn xóa không? 정말로 삭제하시겠습니까?','userFileDelete.aspx?visitDataCode=" + visitData.VisitDataCode + "&fileNumber=3&fileName=" + HttpUtility.UrlEncode(bllVisitData.GetFileName(visitData.UserFile3)) + "',document.dummy)\"><img src='../../images/icon/fileDelete.gif' align='absmiddle'></a>"; //} } // 신규 등록하기 đăng ký mới else { // 신규 결재 코드 가져오기 mang theo code phê duyết mới approveDocCode = bllVisitData.GetNewApproveCode(); } #endregion #region 임직원 정보 보이기 // xem thông tin nhân viên loginEmploeeDisplayName = loginEmployee.DisplayName; loginEmploeeDepartmentName = loginEmployee.Dep_name; loginEmployeeUpnid = loginEmployee.Upnid; loginEmployeeTitle = loginEmployee.Title_name; lblDepartment.Text = loginEmployee.Dep_name; lblUpnid.Text = loginEmployee.Upnid; lblOfficeName.Text = loginEmployee.OfficeName; lblDisplayName.Text = loginEmployee.DisplayName; lblTitle.Text = loginEmployee.Title_name; lblPhone.Text = loginEmployee.MobilePhoneNumber; #endregion } }
protected void Page_Load(object sender, EventArgs e) { // 로그인 체크 EmployeeInfo loginEmployee = new EmployeeInfo(); loginEmployee = (EmployeeInfo)Session["loginMember"]; if (loginEmployee == null) { Response.Redirect("~/login.aspx", true); } loginEmploeeDepartmentName = loginEmployee.Dep_name; loginEmploeeDisplayName = loginEmployee.DisplayName; loginEmployeeUpnid = loginEmployee.Upnid; VisitData bll = new VisitData(); VisitDataInfo obj = bll.selectVisitData(Request["visitDataCode"]); elecApproveContents = bll.MakeElecApproveContents(obj); form_code = ConfigurationManager.AppSettings["elecApproveFormCode"]; doc_term = "1"; sec_level = "M"; user_id = loginEmployee.Upnid; user_Title = loginEmployee.Title_name; user_depName = loginEmployee.Dep_name; user_name = loginEmployee.DisplayName; attach_flag = "0"; String[] arrUserFileNames; String ext; Char separator = '|'; if (!String.IsNullOrEmpty(obj.UserFile1)) { //A [b].doc:Ab.doc:doc:application/msword: 210432 /** * arrUserFile1[0] : 파일명 * arrUserFile1[1] : MimeType * arrUserFile1[2] : 파일 사이즈 (바이트) */ String[] arrUserFile1 = obj.UserFile1.Split(separator); arrUserFileNames = arrUserFile1[0].Split('.'); ext = arrUserFileNames[arrUserFileNames.Length - 1].ToLower(); attach_str += arrUserFile1[0] + ":" + arrUserFile1[0] + ":" + ext + ":" + arrUserFile1[1] + ":" + arrUserFile1[2] + ";"; attach_flag = "1"; } if (!String.IsNullOrEmpty(obj.UserFile2)) { //A [b].doc:Ab.doc:doc:application/msword: 210432 /** * arrUserFile1[0] : 파일명 * arrUserFile1[1] : MimeType * arrUserFile1[2] : 파일 사이즈 (바이트) */ String[] arrUserFile2 = obj.UserFile2.Split(separator); arrUserFileNames = arrUserFile2[0].Split('.'); ext = arrUserFileNames[arrUserFileNames.Length - 1].ToLower(); attach_str += arrUserFile2[0] + ":" + arrUserFile2[0] + ":" + ext + ":" + arrUserFile2[1] + ":" + arrUserFile2[2] + ";"; attach_flag = "1"; } if (!String.IsNullOrEmpty(obj.UserFile3)) { //A [b].doc:Ab.doc:doc:application/msword: 210432 /** * arrUserFile1[0] : 파일명 * arrUserFile1[1] : MimeType * arrUserFile1[2] : 파일 사이즈 (바이트) */ String[] arrUserFile3 = obj.UserFile3.Split(separator); arrUserFileNames = arrUserFile3[0].Split('.'); ext = arrUserFileNames[arrUserFileNames.Length - 1].ToLower(); attach_str += arrUserFile3[0] + ":" + arrUserFile3[0] + ":" + ext + ":" + arrUserFile3[1] + ":" + arrUserFile3[2] + ";"; attach_flag = "1"; } bll.updateApprove(Request["visitDataCode"], "1", ""); }
protected void Page_Load(object sender, EventArgs e) { // 로그인 체크 check login if (this.Context.User.Identity.Name == null) { Response.Redirect("~/login.aspx", true); } EmployeeInfo loginEmployee = new EmployeeInfo(); Employee bllEmployee = new Employee(); loginEmployee = bllEmployee.selectEmployee(this.Context.User.Identity.Name); loginEmploeeDepartmentName = loginEmployee.Dep_name; loginEmploeeDisplayName = loginEmployee.DisplayName; loginEmployeeUpnid = loginEmployee.Upnid; loginEmployeeTitle = loginEmployee.Title_name; VisitDataInfo visitDataInfo = bll.selectVisitData(Request.QueryString["visitDataCode"]); VisitorDataInfo visitorDataInfo = bllVisitorData.selectVisitorData(Request.QueryString["visitorDataCode"]); visit = visitDataInfo.VisitFlag; //결재정보의 기안제목 tiêu đề dự thảo của thông tin phê duyệt //if (visitDataInfo.VisitFlag == 1 || visitDataInfo.VisitFlag == 2 ) if (visitDataInfo.VisitFlag == 1) { title = "[Đăng ký thăm dài hạn (장기내방신청)]"; // 장기내방 기간 표시 lblLongVisit.Text = visitDataInfo.StartDate.Substring(0, 10) + " ~ " + visitDataInfo.EndDate.Substring(0, 10); } else { title = "[Đăng ký khách thăm (내방신청)]"; } // 결재정보의 기안제목에서 로그인사용자에서 신청자로 변경 (2009.08.27 임종우) // thay đổi tài liệu đăng ký ở login người dùng của tiêu đề dự thảo thông tin phê duyệt reqEmploeeDisplayName = visitDataInfo.ReqEmployeeInfo.DisplayName; // 임직원 정보 보이기 xem thông tin nhân viên lblDepartment.Text = visitDataInfo.ReqEmployeeInfo.Dep_name; lblUpnid.Text = visitDataInfo.ReqEmployeeInfo.Upnid; lblOfficeName.Text = visitDataInfo.ReqEmployeeInfo.OfficeName; lblDisplayName.Text = visitDataInfo.ReqEmployeeInfo.DisplayName; lblTitle.Text = visitDataInfo.ReqEmployeeInfo.Title_name; lblPhone.Text = visitDataInfo.ReqEmployeeInfo.MobilePhoneNumber; // 입문 출문 시간 보이기 (보안실 or Admin) xem thời gian đến, đi ( bảo an & admin) // 보안 요원 체크 check yêu cầu bảo an if (loginEmployee.ManagerLevel < 0) { pnlSecurity.Visible = false; } else { pnlSecurity.Visible = true; } // 내방 정보 보이기 xem thông tin khách thăm lblVisitObjectName.Text = visitDataInfo.VisitObjectInfo.VisitObjectName; lblVisitObjectContents.Text = visitDataInfo.VisitObjectContents; lblInterviewUserName.Text = visitDataInfo.InterviewEmployeeInfo.DisplayName; // 결재 코드 code phê duyệt elecApproveCode = visitDataInfo.ElecApproveCode; // 결재라인 가져오기 //HtmlGenericControl body = Master.FindControl("body") as HtmlGenericControl; //if (body != null) body.Attributes["onload"] = ShowApproveLine(); lblOfficeNameDetail.Text = visitDataInfo.OfficeInfo.OfficeName + " " + visitDataInfo.OfficeContents; lblCarNumber.Text = visitDataInfo.CarDataInfo.Header + " " + visitDataInfo.CarDataInfo.Number; //// 내방객의 입문 시간 //if (String.IsNullOrEmpty(visitorDataInfo.InTime)) lblInTime.Text = ""; //else lblInTime.Text = visitorDataInfo.InTime.ToString(); lblInTime.Text = visitorDataInfo.InTime; //// 내방객의 출문 시간이 없다면 //if (visitDataInfo.OutTime.Year == 1) lblOutTime.Text = ""; //else lblOutTime.Text = visitDataInfo.OutTime.ToString(); lblOutTime.Text = visitorDataInfo.OutTime; //// 첨부 파일 정보 thông tin tệp đính kèm //if (!String.IsNullOrEmpty(visitDataInfo.UserFile1)) //{ // String[] arrUserFile1 = visitDataInfo.UserFile1.Split('|'); // lblUserFile1.Text = "<a href='" + ConfigurationManager.AppSettings["fileOpenPath"] + "/" + arrUserFile1[0] + "' target='_blank'>" + arrUserFile1[0] + "</a>"; //} //if (!String.IsNullOrEmpty(visitDataInfo.UserFile2)) //{ // String[] arrUserFile2 = visitDataInfo.UserFile2.Split('|'); // lblUserFile2.Text = "<a href='" + ConfigurationManager.AppSettings["fileOpenPath"] + "/" + arrUserFile2[0] + "' target='_blank'>" + arrUserFile2[0] + "</a>"; //} //if (!String.IsNullOrEmpty(visitDataInfo.UserFile3)) //{ // String[] arrUserFile3 = visitDataInfo.UserFile3.Split('|'); // lblUserFile3.Text = "<a href='" + ConfigurationManager.AppSettings["fileOpenPath"] + "/" + arrUserFile3[0] + "' target='_blank'>" + arrUserFile3[0] + "</a>"; //} // 결재 상신 전이라면 if (visitDataInfo.ApprovalState == 0) { // 결재라인 변경 이미지 thay đổi ảnh đường phê duyệt btnElecApproveLine.Visible = true; // 결재 상신 버튼 nút bấm gửi phê duyệt btnApproveStart.Visible = true; // 결재 상태 보기 xem trạng thái phê duyệt btnElectStatus.Visible = false; } else { //김민우 - 결재 상태 보기 잠시 막음 //btnElectStatus.Visible = true; btnElectStatus.Visible = false; btnApproveStart.Visible = false; btnElecApproveLine.Visible = false; } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GridView1_RowDataBound1(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { VisitDataInfo obj = (VisitDataInfo)e.Row.DataItem; e.Row.Cells[0].Text = "<input type='checkbox' name='selectCheck' value='" + obj.VisitorDataInfoList[0].VisitorDataCode + "'>"; //e.Row.Cells[0].Text = obj.VisitorDataInfoList[0].VisitDate; e.Row.Cells[1].Text = obj.StartDate.Substring(0, 10) + " ~ " + obj.EndDate.Substring(0, 10); e.Row.Cells[2].Text = obj.VisitorDataInfoList[0].VisitorInfo.VisitorName; if (String.IsNullOrEmpty(obj.VisitorDataInfoList[0].VisitorInfo.VisitorPassportNumber)) { //e.Row.Cells[3].Text = obj.VisitorDataInfoList[0].VisitorInfo.VisitorRegNumber1 + "-" + obj.VisitorDataInfoList[0].VisitorInfo.VisitorRegNumber2.Substring(0, 4) + "***"; e.Row.Cells[3].Text = obj.VisitorDataInfoList[0].VisitorInfo.VisitorRegNumber1; } else { e.Row.Cells[3].Text = obj.VisitorDataInfoList[0].VisitorInfo.VisitorPassportNumber; } e.Row.Cells[4].Text = obj.VisitorDataInfoList[0].CompanyInfo.CompanyName; e.Row.Cells[5].Text = obj.ReqEmployeeInfo.Dep_name; e.Row.Cells[6].Text = obj.InterviewEmployeeInfo.DisplayName; e.Row.Cells[7].Text = obj.CarDataInfo.Header + " " + obj.CarDataInfo.Number; e.Row.Cells[8].Text = obj.VisitObjectInfo.VisitObjectName; e.Row.Cells[9].Text = obj.VisitorDataInfoList[0].VisitorInfo.VisitorPhone1 + "-" + obj.VisitorDataInfoList[0].VisitorInfo.VisitorPhone2 + "-" + obj.VisitorDataInfoList[0].VisitorInfo.VisitorPhone3; //e.Row.Cells[10].Text = obj.VisitorPhone1 + "-" + obj.VisitorPhone2 + "-" + obj.VisitorPhone3; VisitData bll = new VisitData(); // 상태 String approveString = bll.getApproveStringKOR(obj); e.Row.Cells[10].Text = approveString; if (obj.ApprovalState == 2) { if (approveString.Equals("hoàn thành phê duyệt 결재 완료") && obj.VisitorDataInfoList[0].VisitDate.Equals(DateTime.Now.ToString("yyyy.MM.dd"))) { e.Row.Cells[11].Text = "<a href='#;' onClick=\"javascript:confirmMove('입문 처리 하시겠습니까?','visitDatatimeUpdate.aspx?visitorDataCode=" + obj.VisitorDataInfoList[0].VisitorDataCode + "&mode=inTime&keyWord=" + ddlKeyWord.SelectedValue + "&key=" + HttpUtility.UrlEncode(txtKey.Text) + "&page=" + GridView1.PageIndex + "')\">"; e.Row.Cells[11].Text += "<span style=\"color:blue\">Hoàn thành vào cổng 입문 처리</span></a>"; } if (approveString.Equals("vào cổng 입문")) { e.Row.Cells[11].Text = "<a href='#;' onClick=\"javascript:confirmMove('출문 처리 하시겠습니까?','visitDatatimeUpdate.aspx?visitorDataCode=" + obj.VisitorDataInfoList[0].VisitorDataCode + "&mode=outTime&keyWord=" + ddlKeyWord.SelectedValue + "&key=" + HttpUtility.UrlEncode(txtKey.Text) + "&page=" + GridView1.PageIndex + "')\">"; e.Row.Cells[11].Text += "<span style=\"color:red\"> ra cổng 출문 처리</span></a>"; } if (approveString.Equals("ra cổng 출문")) { e.Row.Cells[11].Text = "<a href='#;' onClick=\"javascript:newWinByName('../visit/viewVisitTime.aspx?visitorDataCode=" + obj.VisitorDataInfoList[0].VisitorDataCode + "&visitDataCode=" + obj.VisitDataCode + "','viewTime','400','200')\">"; e.Row.Cells[11].Text += "xem thời gian, quá trình 경과 시간 보기</a>"; } } for (int i = 0; i < e.Row.Cells.Count; i++) { if (i > 0 & i < 11) { e.Row.Cells[i].Attributes.Add("onclick", "window.location='../visit/viewVisitManager.aspx?visitDataCode=" + obj.VisitDataCode + "&visitorDataCode=" + obj.VisitorDataInfoList[0].VisitorDataCode + "';"); e.Row.Cells[i].Attributes.Add("style", "cursor:hand;"); } } e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#C0C0C0'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFFFFF'"); } }
protected void btnApproveStart_Click(object sender, EventArgs e) { VisitDataInfo obj = bll.selectVisitData(Request.QueryString["visitDataCode"]); String elecApproveContents = bll.MakeElecApproveContents(obj); }
/// <summary> /// 전자결재 용 HTML 만들기 /// </summary> /// <param name="obj"></param> /// <returns></returns> public String MakeElecApproveContents(VisitDataInfo obj) { StringBuilder str = new StringBuilder(); str.Append(@" <table width='100%' cellpadding='6' cellspacing='1' style='background-color:#CCCCCC'> <tr> <td colspan='6' class='contents_title' style='background-color:#FFFFFF'> <img src='http://house.hmicron.com/COMS/images/basic/icon_02.gif' alt='icon' style='vertical-align:middle'> Thông tin khách thăm (내방 정보) </td> </tr> <tr> <td style='background-color:#F5F5F5'> Mục đích đến (방문 목적) </td> <td style='background-color:#FFFFFF'>" + obj.VisitObjectInfo.VisitObjectName + @"</td> <td style='background-color:#F5F5F5'> Chi tiết mục đích (세부 목적) </td> <td style='background-color:#FFFFFF'>" + obj.VisitObjectContents + @"</td> </tr> <tr> <td style='background-color:#F5F5F5'> Người gặp (접견자) </td> <td style='background-color:#FFFFFF'>" + obj.InterviewEmployeeInfo.DisplayName + @"</td> <td style='background-color:#F5F5F5'> Đại điểm gặp (접견장소) </td> <td style='background-color:#FFFFFF'>" + obj.OfficeInfo.OfficeName + " " + obj.OfficeContents + @"</td> </tr> <tr> <td style='background-color:#F5F5F5'> Số xe (차량 번호) </td> <td style='background-color:#FFFFFF' colspan='3'>" + obj.CarDataInfo.Header + " " + obj.CarDataInfo.Number + " " + obj.CarDataInfo.CodeName + @"</td> </tr> " ); // 장기 내방이면 내방기간 표시 if (obj.VisitFlag == 1) { str.Append(@" <tr> <td style='background-color:#F5F5F5'> Thời hạn khách thăm dài hạn (장기내방 기간) </td> <td style='background-color:#FFFFFF' colspan='3'>" + obj.StartDate.Substring(0, 10) + " ~ " + obj.EndDate.Substring(0, 10) + @"</td> </tr> "); } str.Append(@" </table> <br /> "); str.Append(@" <table cellspacing='0' cellpadding='4' rules='all' border='1' style='background-color:White;border-color:#3366CC;border-width:1px;border-style:None;width:100%;border-collapse:collapse;'> <tr style='color:#CCCCFF;background-color:#003399;'> <td align='center' scope='col'>성명</td><td align='center' colspan='2' scope='col'>Ngày, tháng, năm sinh (생년월일)</td> <td align='center' scope='col'>업체명</td><td align='center' colspan='3' scope='col'>Liên lạc (연락처)</td>"); // 단기 내방이면 또는 Free pass 이면 방문일 표시 if (obj.VisitFlag == 0 || obj.VisitFlag == 5) { str.Append(@"<td align='center' scope='col'>Ngày đến (방문일)</td>"); } str.Append("</tr>"); VisitorData bllVisitorData = new VisitorData(); List <VisitorDataInfo> list = bllVisitorData.selectVisitorDataList(obj.VisitDataCode.ToString()); foreach (VisitorDataInfo subObj in list) { str.Append(@" <tr style='color:#003399;background-color:White;'> <td align='center'>" + subObj.VisitorInfo.VisitorName + @"</td>"); if (String.IsNullOrEmpty(subObj.VisitorInfo.VisitorPassportNumber)) { //str.Append(@"<td align='center' colspan='2'>" + subObj.VisitorInfo.VisitorRegNumber1 + " - " + subObj.VisitorInfo.VisitorRegNumber2.Substring(0, 4) + "***" + @"</td>"); str.Append(@"<td align='center' colspan='2'>" + subObj.VisitorInfo.VisitorRegNumber1 + @"</td>"); } else { str.Append(@"<td align='center' colspan='2'>" + subObj.VisitorInfo.VisitorPassportNumber + @"</td>"); } str.Append(@" <td align='center'>" + subObj.CompanyInfo.CompanyName + @"</td> <td align='center' colspan='3'>" + subObj.VisitorInfo.VisitorPhone1 + "-" + subObj.VisitorInfo.VisitorPhone2 + "-" + subObj.VisitorInfo.VisitorPhone3 + @"</td>"); // 단기 내방 또는 Free pass 이면 방문일 표시 if (obj.VisitFlag == 0 || obj.VisitFlag == 5) { str.Append(@"<td align='center'>" + subObj.VisitDate + @"</td>"); } str.Append("</tr>"); } str.Append("</table>"); return(str.ToString()); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GridView1_RowDataBound1(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { VisitDataInfo obj = (VisitDataInfo)e.Row.DataItem; e.Row.Cells[0].Text = obj.VisitorDataInfoList[0].VisitDate; e.Row.Cells[1].Text = obj.VisitorDataInfoList[0].VisitorInfo.VisitorName; if (String.IsNullOrEmpty(obj.VisitorDataInfoList[0].VisitorInfo.VisitorPassportNumber)) { //e.Row.Cells[2].Text = obj.VisitorDataInfoList[0].VisitorInfo.VisitorRegNumber1 + "-" + obj.VisitorDataInfoList[0].VisitorInfo.VisitorRegNumber2.Substring(0, 4) + "***"; e.Row.Cells[2].Text = obj.VisitorDataInfoList[0].VisitorInfo.VisitorRegNumber1; } else { e.Row.Cells[2].Text = obj.VisitorDataInfoList[0].VisitorInfo.VisitorPassportNumber; } e.Row.Cells[3].Text = obj.VisitorDataInfoList[0].CompanyInfo.CompanyName; e.Row.Cells[4].Text = obj.ReqEmployeeInfo.Dep_name; e.Row.Cells[5].Text = obj.InterviewEmployeeInfo.DisplayName; e.Row.Cells[6].Text = obj.CarDataInfo.Header + " " + obj.CarDataInfo.Number; e.Row.Cells[7].Text = obj.VisitObjectInfo.VisitObjectName; e.Row.Cells[8].Text = obj.VisitorDataInfoList[0].VisitorInfo.VisitorPhone1 + "-" + obj.VisitorDataInfoList[0].VisitorInfo.VisitorPhone2 + "-" + obj.VisitorDataInfoList[0].VisitorInfo.VisitorPhone3; //e.Row.Cells[10].Text = obj.VisitorPhone1 + "-" + obj.VisitorPhone2 + "-" + obj.VisitorPhone3; VisitData bll = new VisitData(); // 상태 trạng thái/ tình trạng String approveString = bll.getApproveStringKOR(obj); e.Row.Cells[9].Text = approveString; // 2019-07-15-임종우 : ESD 교육 이수 처리 //xử lý hoàn thành đào tạo ESD if (obj.VisitorDataInfoList[0].VisitorInfo.EsdFlag == "N") { e.Row.Cells[10].Text = "<a href='#;' onClick=\"javascript:confirmMove('Bạn có muốn xử lý hoàn thành đạo tạo không ? (교육 이수 처리 하시겠습니까?)','/COMS/main/security/visitDatatimeUpdate.aspx?visitorCode=" + obj.VisitorDataInfoList[0].VisitorInfo.VisitorCode + "&mode=esdTime&keyWord=" + ddlKeyWord.SelectedValue + "&key=" + HttpUtility.UrlEncode(txtKey.Text) + "&page=" + GridView1.PageIndex + "')\">"; e.Row.Cells[10].Text += "<span style=\"color:red\">No</span></a>"; } else { e.Row.Cells[10].Text = "Yes"; } if (obj.ApprovalState == 2) { if (approveString.Equals("Hoàn thành phê duyệt (결재 완료)") && obj.VisitorDataInfoList[0].VisitDate.Equals(DateTime.Now.ToString("yyyy.MM.dd"))) { //2012-02-25-김민우: 입문 처리 시 card no. 를 입력 받도록 수정 //e.Row.Cells[10].Text = "<a href='#;' onClick=\"javascript:confirmMove('Bạn có muốn xử lý vào cổng không ? (입문 처리 하시겠습니까?)','visitDatatimeUpdate.aspx?visitorDataCode=" + obj.VisitorDataInfoList[0].VisitorDataCode + "&mode=inTime&keyWord=" + ddlKeyWord.SelectedValue + "&key=" + HttpUtility.UrlEncode(txtKey.Text) + "&page=" + GridView1.PageIndex + "')\">"; //e.Row.Cells[10].Text += "<span style=\"color:blue\">Xử lý vào cổng (입문 처리)</span></a>"; if (obj.VisitorDataInfoList[0].VisitorInfo.EsdFlag == "N") { e.Row.Cells[11].Text = "<span style=\"color:blue\"> Kiểm tra hoàn thành ESD (ESD 이수 확인)</span></a>"; } else { e.Row.Cells[11].Text = "<a href='#;' onClick=\"javascript:newWinByName('../security/visitorCardNo.aspx?visitorDataCode=" + obj.VisitorDataInfoList[0].VisitorDataCode + "&mode=inTime&keyWord=" + ddlKeyWord.SelectedValue + "&key=" + HttpUtility.UrlEncode(txtKey.Text) + "&page=" + GridView1.PageIndex + "','CardNo','1000','300')\">"; e.Row.Cells[11].Text += "<span style=\"color:blue\">Xử lý vào cổng (입문 처리)</span></a>"; } } if (approveString.Equals("Vào cổng (입문)")) { e.Row.Cells[11].Text = "<a href='#;' onClick=\"javascript:confirmMove('Bạn có muốn xử lý ra cổng không (출문 처리 하시겠습니까)?','visitDatatimeUpdate.aspx?visitorDataCode=" + obj.VisitorDataInfoList[0].VisitorDataCode + "&mode=outTime&keyWord=" + ddlKeyWord.SelectedValue + "&key=" + HttpUtility.UrlEncode(txtKey.Text) + "&page=" + GridView1.PageIndex + "')\">"; e.Row.Cells[11].Text += "<span style=\"color:red\">Xử lý ra cổng (출문 처리)</span></a>"; } if (approveString.Equals("Ra cổng (출문)")) { e.Row.Cells[11].Text = "<a href='#;' onClick=\"javascript:newWinByName('../visit/viewVisitTime.aspx?visitorDataCode=" + obj.VisitorDataInfoList[0].VisitorDataCode + "&visitDataCode=" + obj.VisitDataCode + "','viewTime','400','200')\">"; e.Row.Cells[11].Text += "Xem thời gian tiến hành (경과 시간 보기)</a>"; } } for (int i = 0; i < e.Row.Cells.Count; i++) { if (i < 10) { e.Row.Cells[i].Attributes.Add("onclick", "window.location='/COMS/main/visit/viewVisitManager.aspx?visitDataCode=" + obj.VisitDataCode + "&visitorDataCode=" + obj.VisitorDataInfoList[0].VisitorDataCode + "';"); e.Row.Cells[i].Attributes.Add("style", "cursor:hand;"); } } if (obj.VisitFlag == 5) { e.Row.Attributes.Add("style", "background-color:#FFF7A2;"); e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#C0C0C0'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFF7A2'"); } else { e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#C0C0C0'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFFFFF'"); } } }
public String elecApproveType; //전자결재 타입(반출:takeOut,내방:visit,보안카드:secCard) loại phê duyệt điện tử () protected void Page_Load(object sender, EventArgs e) { // 로그인 체크 check login EmployeeInfo loginEmployee = new EmployeeInfo(); loginEmployee = (EmployeeInfo)Session["loginMember"]; if (loginEmployee == null) { Response.Redirect("~/login.aspx", true); } loginEmploeeDepartmentName = loginEmployee.Dep_name; loginEmploeeDisplayName = loginEmployee.DisplayName; loginEmployeeUpnid = loginEmployee.Upnid; // 전자결재 타입 elecApproveType = Request.QueryString["elecApproveType"]; VisitData bll = new VisitData(); VisitDataInfo obj = new VisitDataInfo(); TakeOutData bllTakeOut = new TakeOutData(); TakeOutDataInfo takeOutData = new TakeOutDataInfo(); SecCardData bllSecCard = new SecCardData(); SecCardDataInfo secCardData = new SecCardDataInfo(); if (elecApproveType.Equals("visit")) // 내방 부분 phần visit { obj = bll.selectVisitData(Request["visitDataCode"]); if (obj.VisitFlag == 1) { doc_title = "[Đăng ký khách thăm dài hạn] ([장기내방신청])"; } else { doc_title = "Đăng ký khách thăm ([내방신청])"; } elecApproveContents = bll.MakeElecApproveContents(obj); //내방 전자결재 web.config에 등록된 카테고리 코드. 전자결재 Legacy 연동시 사용함. elecCategoryCode = ConfigurationManager.AppSettings["elecCategoryCode"]; } else if (elecApproveType.Equals("secCard")) // 반출 부분 { secCardData = bllSecCard.selectSecCardData(Request["secCardDataCode"]); doc_title = "[Mẫu đăng ký ra/vào (Card Reader)] ([출입(카드리더기)등록 신청서])"; elecApproveContents = bllSecCard.MakeElecApproveContents(secCardData); //반출 전자결재 web.config에 등록된 카테고리 코드. 전자결재 Legacy 연동시 사용함. elecCategoryCode = ConfigurationManager.AppSettings["elecCategoryCodeAll"]; bllSecCard.updateApprove(secCardData.ElecApproveCode, "1", ""); } else // 반출 부분 { takeOutData = bllTakeOut.selectTakeOutData(Request["takeOutDataCode"]); doc_title = "[Đăng ký mang ra] ([반출신청])"; elecApproveContents = bllTakeOut.MakeElecApproveContentsTakeOut(takeOutData); //반출 전자결재 web.config에 등록된 카테고리 코드. 전자결재 Legacy 연동시 사용함. elecCategoryCode = ConfigurationManager.AppSettings["elecCategoryCodeTakeOut"]; } form_code = ConfigurationManager.AppSettings["elecApproveFormCode"]; doc_term = "1"; sec_level = "M"; user_id = loginEmployee.Upnid; user_Title = loginEmployee.Title_name; user_depName = loginEmployee.Dep_name; user_name = loginEmployee.DisplayName; attach_flag = "0"; if (elecApproveType.Equals("visit")) //내방부분 { if (!String.IsNullOrEmpty(obj.UserFile1)) { attach_str += MakeFileString(obj.UserFile1) + ";"; attach_flag = "1"; } if (!String.IsNullOrEmpty(obj.UserFile2)) { attach_str += MakeFileString(obj.UserFile2) + ";"; attach_flag = "1"; } if (!String.IsNullOrEmpty(obj.UserFile3)) { attach_str += MakeFileString(obj.UserFile3) + ";"; attach_flag = "1"; } bll.updateApprove(Request["visitDataCode"], "1", ""); } else //반출 부분 { if (!String.IsNullOrEmpty(takeOutData.UserFile1)) { attach_str += MakeFileString(takeOutData.UserFile1) + ";"; attach_flag = "1"; } if (!String.IsNullOrEmpty(takeOutData.UserFile2)) { attach_str += MakeFileString(takeOutData.UserFile2) + ";"; attach_flag = "1"; } if (!String.IsNullOrEmpty(takeOutData.UserFile3)) { attach_str += MakeFileString(takeOutData.UserFile3) + ";"; attach_flag = "1"; } bllTakeOut.updateApprove(Request["takeOutDataCode"], "1", ""); } }