protected string UploadFile(FileUpload upload, string dirKey) { string saveFileName = ""; if (upload.HasFile) { string sourceDir = DirUtil.GetUploadDir(dirKey); string newFile = CStringUtil.GetNewFileName(upload.FileName); saveFileName = sourceDir + newFile; // 물리파일 전체 경로 string physicalPath = CConst.DIR_ROOT_IMAGE_PATH + saveFileName; // 디렉토리 존재 유무 검사 후 디렉토리 생성 DirUtil.MakeDir(CConst.DIR_ROOT_IMAGE_PATH + sourceDir); // 파일 저장 upload.SaveAs(physicalPath); string fileUrl = CConst.DOMAIN_IMAGE + saveFileName; //string fileUrl = DirUtil.CopyRemoteServer(sourceDir, newFile); if (CStringUtil.IsNullOrEmpty(fileUrl)) { // 실패한 경우에 파일 명 공백 saveFileName = ""; } else { saveFileName = fileUrl; } } return(saveFileName); }
/// <summary> /// 데이터 삭제 /// </summary> private void RemoveData() { if (CStringUtil.IsNullOrEmpty(ProdCd) == false) { StringBuilder param = new StringBuilder(); param.Append(LANG_CD); param.Append(CConst.DB_PARAM_DELIMITER).Append(ProdCd); string[] result = ExecuteQueryResult(3206, param.ToString()); if (result == null) { ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox("시스템 오류가 발생 했습니다.")); } else if (result[0].Equals("00") == false) { // 삭제 실패 ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox(result[1])); } } else { ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox("입력모드에서는 지원하지 않습니다.")); } }
/// <summary> /// ID에 해당하는 매뉴 권한을 가져온다. /// </summary> /// <param name="adminId"></param> /// <returns></returns> private List <string> GetMenuAuth(string adminId) { List <string> list = null; if (CStringUtil.IsNullOrEmpty(adminId) == false) { StringBuilder param = new StringBuilder(); param.Append(adminId); DataSet ds = GetDataSet(3001, param.ToString()); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { list = new List <string>(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { list.Add(ds.Tables[0].Rows[i]["MENU_NO"].ToString()); } } else { ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox("접근 권한이 없습니다.")); Response.Redirect("index.aspx"); } } else { ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox("접근 권한이 없습니다.")); Response.Redirect("index.aspx"); } return(list); }
/// <summary> /// 데이터를 저장한다. (추가 or 수정) /// </summary> private void SaveData() { string img1 = CStringUtil.IsNullOrEmpty(upload_path_01.Value) == false?UploadFile(upload_01, "DIR_PROMOTION") : ""; string catalog = CStringUtil.IsNullOrEmpty(upload_path_02.Value) == false?UploadFile(upload_02, "DIR_PROMOTION") : ""; //string menual = CStringUtil.IsNullOrEmpty(upload_path_file.Value) == false ? UploadFile(upload_file, "DIR_PROMOTION") : ""; StringBuilder param = new StringBuilder(); param.Append(LANG_CD); // 언어코드 param.Append(CConst.DB_PARAM_DELIMITER).Append(ttl.Value); param.Append(CConst.DB_PARAM_DELIMITER).Append(intro.Value); param.Append(CConst.DB_PARAM_DELIMITER).Append(hdnContent.Value); param.Append(CConst.DB_PARAM_DELIMITER).Append(Session["admin_id"]); param.Append(CConst.DB_PARAM_DELIMITER).Append(img1); param.Append(CConst.DB_PARAM_DELIMITER).Append(catalog); string[] result = null; string prodCd = string.Empty; if (CStringUtil.IsNullOrEmpty(ProdCd) == false) { // 수정 모드 - prodcd 추가 param.Append(CConst.DB_PARAM_DELIMITER).Append(ProdCd); result = ExecuteQueryResult(3215, param.ToString()); prodCd = ProdCd; } else { // 입력 모드 result = ExecuteQueryResult(3214, param.ToString()); if (result != null && result.Length == 3) { prodCd = result[2]; } } if (result == null) { ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox("시스템 오류가 발생 했습니다.")); } else if (result[0].Equals("00") == false) { // 입력 or 수정 실패 ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox(result[1])); } else { // 이어서 태그 입력 AddTag(prodCd); } }
// 이미지 파일을 서버에 저장하고 저장한 정보를 클라이언트에 보내줌. protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { HttpFileCollection uploadedFiles = Request.Files; string callback_func = Request.Form["callback_func"]; // 다수의 파일을 다운로드 하여 파일을 저장함 for (int j = 0; j < uploadedFiles.Count; j++) { HttpPostedFile userPostedFile = uploadedFiles[j]; // 파일 내용이 있을경우 if (userPostedFile.ContentLength > 0) { string sourceDir = DirUtil.GetUploadDir("DIR_SMARTEDITOR"); string newFile = CStringUtil.GetNewFileName(new FileInfo(userPostedFile.FileName).Name); string saveFileName = sourceDir + newFile; // 물리파일 전체 경로 string physicalPath = CConst.DIR_ROOT_IMAGE_PATH + saveFileName; //logger.Debug("physicalPath:" + physicalPath); // 디렉토리 존재 유무 검사 후 디렉토리 생성 DirUtil.MakeDir(CConst.DIR_ROOT_IMAGE_PATH + sourceDir); // 파일 저장 userPostedFile.SaveAs(physicalPath); string fileUrl = saveFileName; if (CStringUtil.IsNullOrEmpty(fileUrl)) { // 실패한 경우에 파일 명 공백 saveFileName = ""; } else { saveFileName = fileUrl; } // 클라이언트에 저장한 파일 정보를 보내 줌 string returnUrl = string.Format("callback.html?callback_func={0}&bNewLine=true&sFileName={1}&sFileURL={2}", callback_func, newFile, fileUrl); Response.Redirect(returnUrl); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "", "alert('첨부파일 등록중 에러발생');", true); } } } }
/// <summary> /// 데이터 조회 /// </summary> private void SearchData() { if (CStringUtil.IsNullOrEmpty(Seq) == false) { StringBuilder param = new StringBuilder(); param.Append(Seq); SetDataList(3518, param.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { HttpFileCollection uploadedFiles = Request.Files; // 다수의 파일을 다운로드 하여 파일을 저장함 for (int j = 0; j < uploadedFiles.Count; j++) { HttpPostedFile userPostedFile = uploadedFiles[j]; // 파일 내용이 있을경우 if (userPostedFile.ContentLength > 0) { string sourceDir = DirUtil.GetUploadDir("DIR_RECRUITMENT_USER"); string newFile = CStringUtil.GetNewFileName(userPostedFile.FileName); if (newFile.Contains(@"\")) { string[] arr_newfile = newFile.Split(new char[] { '\\' }); newFile = arr_newfile[arr_newfile.Length - 1]; } string saveFileName = sourceDir + newFile; // 물리파일 전체 경로 string physicalPath = CConst.DIR_ROOT_IMAGE_PATH + saveFileName; // 디렉토리 존재 유무 검사 후 디렉토리 생성 DirUtil.MakeDir(CConst.DIR_ROOT_IMAGE_PATH + sourceDir); // 파일 저장 userPostedFile.SaveAs(physicalPath); string fileUrl = saveFileName; if (CStringUtil.IsNullOrEmpty(fileUrl)) { // 실패한 경우에 파일 명 공백 saveFileName = ""; } else { saveFileName = fileUrl; } //CXmlMaker xmlMaker = new CXmlMaker(); //xmlMaker.StartXml(); //xmlMaker.Tag("file_path", saveFileName); Response.Write(saveFileName); Response.Flush(); Response.End(); } } } }
/// <summary> /// Top 네비 상단 사용자 이름 /// </summary> /// <returns></returns> protected string GetUserName() { string result = (string)Session["admin_nm"]; if (CStringUtil.IsNullOrEmpty(result)) { // session null이면 session이 만료되었거나 서버 재시작이 있었기 때문에 logout시킴 Logout(); } return(result); }
/// <summary> /// 데이터 조회 /// </summary> private void SearchData() { if (CStringUtil.IsNullOrEmpty(ProdCd) == false) { StringBuilder param = new StringBuilder(); param.Append(LANG_CD); param.Append(CConst.DB_PARAM_DELIMITER).Append(ProdCd); // DataSet타입으로 Set SetDataTableList(3203, param.ToString()); } }
/// <summary> /// 데이터를 저장한다. (추가 or 수정) /// </summary> private void SaveData() { StringBuilder param = new StringBuilder(); param.Append(rcm_ttl.Value); param.Append(CConst.DB_PARAM_DELIMITER).Append(StartDate); param.Append(CConst.DB_PARAM_DELIMITER).Append(EndDate); param.Append(CConst.DB_PARAM_DELIMITER).Append(rcm_cd_reg.Value); param.Append(CConst.DB_PARAM_DELIMITER).Append(Request["duty_no"]); param.Append(CConst.DB_PARAM_DELIMITER).Append(Session["admin_id"].ToString()); string[] result = null; if (CStringUtil.IsNullOrEmpty(Seq) == false && Seq.Equals("0") == false) { // 수정모드 - SEQ 파라미터로 판단 param.Append(CConst.DB_PARAM_DELIMITER).Append(Seq); result = ExecuteQueryResult(3525, param.ToString()); if (result != null && result.Length == 3) { param.Length = 0; param.Append(Seq); ExecuteQueryResult(3527, param.ToString()); SaveRcmCode(Seq); } } else { // 입력 모드 result = ExecuteQueryResult(3523, param.ToString()); if (result != null && result.Length == 3) { string reg_seq_no = result[2]; SaveRcmCode(reg_seq_no); } } if (result == null) { ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox("시스템 오류가 발생 했습니다.")); } else if (result[0].Equals("00") == false) { // 입력 or 수정 실패 ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox(result[1])); } }
/// <summary> /// 데이터 조회 /// </summary> private void SearchData() { if (CStringUtil.IsNullOrEmpty(Seq) == false) { StringBuilder param = new StringBuilder(); param.Append(Seq); SetDataList(3623, param.ToString()); lang_cd.Value = GetData(0, "LANG_CD"); } }
protected string GetFileName(string path, int len) { string filename = CStringUtil.GetOrgFileName(path); if (CStringUtil.IsNullOrEmpty(filename) == false && Encoding.Default.GetByteCount(filename) > len) { byte[] buf = Encoding.Default.GetBytes(filename); filename = Encoding.Default.GetString(buf, 0, len) + "..."; buf = null; } return(filename); }
/// <summary> /// 데이터 체크 /// </summary> private void CheckData() { if (CStringUtil.IsNullOrEmpty(lastDate) == false) { int diff = CDateUtil.GetDiffDate(lastDate, CDateUtil.getYYYYMMDDHHMMSS()); if (diff >= CConst.MAX_DATA_FILE_TIME) { // MAX_DATA_FILE_TIME(분) 이상 데이터를 못가져오고 있는 경우: 커넥션을 다시 맺음(서버접속 및 로그인) ReConnection(); } } }
/// <summary> /// 글자수 제한(len)이 있는 줄단위 정보 출력 by 줄번호, 컬럼명 /// </summary> /// <param name="rowNum">줄번호</param> /// <param name="colName">컬럼명</param> /// <param name="len">제한길이</param> /// <returns>데이터</returns> protected string GetData(int rowNum, string colName, int len) { string data = GetData(rowNum, colName); if (CStringUtil.IsNullOrEmpty(data) == false && Encoding.Default.GetByteCount(data) > len) { byte[] buf = Encoding.Default.GetBytes(data); data = Encoding.Default.GetString(buf, 0, len) + "..."; buf = null; } return(data); }
/// <summary> /// 데이터를 저장한다. (추가 or 수정) /// </summary> private void SaveData() { string img1 = CStringUtil.IsNullOrEmpty(upload_path_01.Value) == false?UploadFile(upload_01, "DIR_PROMOTION") : ""; string img2 = CStringUtil.IsNullOrEmpty(upload_path_02.Value) == false?UploadFile(upload_02, "DIR_PROMOTION") : ""; string img3 = CStringUtil.IsNullOrEmpty(upload_path_03.Value) == false?UploadFile(upload_03, "DIR_PROMOTION") : ""; string img4 = CStringUtil.IsNullOrEmpty(upload_path_04.Value) == false?UploadFile(upload_04, "DIR_PROMOTION") : ""; string img5 = CStringUtil.IsNullOrEmpty(upload_path_05.Value) == false?UploadFile(upload_05, "DIR_PROMOTION") : ""; StringBuilder param = new StringBuilder(); param.Append(writerNm.Value); param.Append(CConst.DB_PARAM_DELIMITER).Append(txtTitle.Value); param.Append(CConst.DB_PARAM_DELIMITER).Append(hdnContent.Value); param.Append(CConst.DB_PARAM_DELIMITER).Append("admin"); param.Append(CConst.DB_PARAM_DELIMITER).Append(img1); param.Append(CConst.DB_PARAM_DELIMITER).Append(img2); param.Append(CConst.DB_PARAM_DELIMITER).Append(img3); param.Append(CConst.DB_PARAM_DELIMITER).Append(img4); param.Append(CConst.DB_PARAM_DELIMITER).Append(img5); param.Append(CConst.DB_PARAM_DELIMITER).Append(mv_path_story.Value); param.Append(CConst.DB_PARAM_DELIMITER).Append(reg_date.Value); string[] result = null; if (CStringUtil.IsNullOrEmpty(Seq) == false) { // 수정모드 - SEQ 파라미터로 판단 param.Append(CConst.DB_PARAM_DELIMITER).Append(Seq); result = ExecuteQueryResult(3225, param.ToString()); } else { // 입력 모드 result = ExecuteQueryResult(3224, param.ToString()); } if (result == null) { ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox("시스템 오류가 발생 했습니다.")); } else if (result[0].Equals("00") == false) { // 입력 or 수정 실패 ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox(result[1])); } }
private void SaveData() { if (CStringUtil.IsNullOrEmpty(Upr_catg_no) == false) { string repFile = CStringUtil.IsNullOrEmpty(path_value_01.Value) == false?UploadFile(file_01, "DIR_PRODUCT") : ""; string repFileEng = CStringUtil.IsNullOrEmpty(path_value_02.Value) == false?UploadFile(file_02, "DIR_PRODUCT") : ""; string[] result = null; if (CStringUtil.IsNullOrEmpty(repFile) == false) { StringBuilder param = new StringBuilder(); param.Append(Upr_catg_no); param.Append(CConst.DB_PARAM_DELIMITER).Append("KOR"); param.Append(CConst.DB_PARAM_DELIMITER).Append(repFile); param.Append(CConst.DB_PARAM_DELIMITER).Append(Session["admin_id"]); result = ExecuteQueryResult(3232, param.ToString()); } if (CStringUtil.IsNullOrEmpty(repFileEng) == false) { StringBuilder param = new StringBuilder(); param.Append(Upr_catg_no); param.Append(CConst.DB_PARAM_DELIMITER).Append("ENG"); param.Append(CConst.DB_PARAM_DELIMITER).Append(repFileEng); param.Append(CConst.DB_PARAM_DELIMITER).Append(Session["admin_id"]); result = ExecuteQueryResult(3232, param.ToString()); } if (result == null) { CWebUtil.jsAlertAndRedirect(this, "시스템 오류가 발생 했습니다.", "pdt_catalog_list.aspx?upr_catg_no=" + Upr_catg_no); } else if (result[0].Equals("00") == false) { CWebUtil.jsAlertAndRedirect(this, result[1], "pdt_catalog_list.aspx?upr_catg_no=" + Upr_catg_no); } else { Response.Redirect("pdt_catalog_list.aspx?upr_catg_no=" + Upr_catg_no); } } else { CWebUtil.jsAlertAndRedirect(this, "카테고리가 선택되지 않았습니다.", "pdt_catalog_list.aspx?upr_catg_no=" + Upr_catg_no); } }
/// <summary> /// 데이터를 저장한다. (추가 or 수정) param.Append(CConst.DB_PARAM_DELIMITER).Append(hdnContent.Value.Replace("|", "|")); /// </summary> private void SaveData() { string IMG_TITLE = CStringUtil.IsNullOrEmpty(IMG_TITLE_VALUE.Value) == false?UploadFile(IMG_TITLE_TEXT, "DIR_EVENT") : ""; IMG_TITLE = CStringUtil.IsNullOrEmpty(IMG_TITLE) == true ? IMG_TITLE_VALUE.Value : IMG_TITLE; string IS_SHOW = IS_SHOW_Y.Checked ? "Y" : "N"; StringBuilder param = new StringBuilder(); // WRITER_ID.Value = (string)Session["admin_id"]; param.Append(" ").Append("'").Append(WRITER_ID.Value).Append("'"); param.Append(",'").Append(EVT_TTL.Value).Append("'"); param.Append(",'").Append(START_DATE).Append("'"); param.Append(",'").Append(END_DATE).Append("'"); param.Append(",'").Append(IMG_TITLE).Append("'"); param.Append(",'").Append(CONT_T.Value).Append("'"); param.Append(",'").Append(CONT_B.Value).Append("'"); param.Append(",'").Append(IS_SHOW).Append("'"); param.Append(",'").Append(ITEMS.Value).Append("'"); string[] result = null; if (CStringUtil.IsNullOrEmpty(Seq) == false) { // 수정모드 - SEQ 파라미터로 판단 param.Append(",").Append(Seq); System.Diagnostics.Debug.WriteLine("1 proc_nm:" + "USP_ADMIN_4000_EVT_EVENT_DETAIL_U" + param.ToString()); result = ExecuteQueryResult("USP_ADMIN_4000_EVT_EVENT_DETAIL_U" + param.ToString()); } else { // 입력 모드 System.Diagnostics.Debug.WriteLine("1 proc_nm:" + "USP_ADMIN_4000_EVT_EVENT_DETAIL_I" + param.ToString()); result = ExecuteQueryResult("USP_ADMIN_4000_EVT_EVENT_DETAIL_I" + param.ToString()); } if (result == null) { ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox("시스템 오류가 발생 했습니다.")); } else if (result[0].Equals("00") == false) { // 입력 or 수정 실패 ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox(result[1])); } }
protected void btnDel_Click1(object sender, EventArgs e) { StringBuilder param = new StringBuilder(); param.Append(" ").Append(Seq); //WRITER_ID.Value = (string)Session["admin_id"]; if (CStringUtil.IsNullOrEmpty(Seq) == false) { System.Diagnostics.Debug.WriteLine("1 proc_nm:" + "USP_ADMIN_4000_EVT_EVENT_DETAIL_U" + param.ToString()); ExecuteQueryResult("USP_ADMIN_4000_EVT_EVENT_DETAIL_D" + param.ToString()); Response.Redirect("./event_list.aspx"); } }
/// <summary> /// 데이터 조회 /// </summary> private void SearchData() { if (CStringUtil.IsNullOrEmpty(Seq) == false) { StringBuilder param = new StringBuilder(); param.Append(" ").Append(Seq); // 데이터 카운트 조회 String proc_nm = "USP_ADMIN_4000_EVT_EVENT_DETAIL_S"; System.Diagnostics.Debug.WriteLine("1 proc_nm:" + proc_nm + param.ToString()); DataSet ds = GetDataSet(proc_nm + param.ToString()); this.SetDataRow(ds); // by renamaster } }
/// <summary> /// 글자수 제한(len)이 있는 줄단위 정보 출력 by 줄번호, 컬럼명 /// </summary> /// <param name="rowNum">줄번호</param> /// <param name="colName">컬럼명</param> /// <param name="len">제한길이</param> /// <returns>데이터</returns> protected string GetData(int rowNum, string colName, int len) { string data = GetData(rowNum, colName); if (CStringUtil.IsNullOrEmpty(data) == false && Encoding.Default.GetByteCount(data) > len) { // 성능에 영향은 있으나 아래 방식으로 처리함 data = CStringUtil.StringTransfer(data, len); // 이전 로직 주석 //byte[] buf = Encoding.Default.GetBytes(data); //data = Encoding.Default.GetString(buf, 0, len) + "..."; //buf = null; } return(data); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (CStringUtil.IsNullOrEmpty(RegSeqNo)) { CWebUtil.jsAlertAndRedirect(this, "잘못된 경로로 진입하였습니다.", "/recruit/job_guide_list.aspx"); } SearchData(); if (CStringUtil.IsNullOrEmpty(GetData(0, "IS_PROCESSING")) || GetData(0, "IS_PROCESSING").Equals("N")) { CWebUtil.jsAlertAndRedirect(this, "채용완료된 공고이거나 없는 채용공고 입니다.", "/recruit/job_guide_list.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (CStringUtil.IsNullOrEmpty(DutyNo) == false && "S".Equals(CRUD)) { SetDetail(); } else if (CStringUtil.IsNullOrEmpty(DutyNo) == false && "D".Equals(CRUD)) { DelData(); } SearchData(); SetControls(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (CStringUtil.IsNullOrEmpty(VCatgNo) == false && "S".Equals(CRUD)) { // 수정 모드일때, 버튼 텍스트 수정으로 변경 hSaveMode.Value = "U"; SearchDetail(); } else if (CStringUtil.IsNullOrEmpty(VCatgNo) == false && "D".Equals(CRUD)) { RemoveData(); } SearchData(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (CStringUtil.IsNullOrEmpty(AdminId) == false && "S".Equals(CRUD)) { // 관리자 수정 모드일때, 동적으로 readonly 속성 추가 sys_insert_member_id.Attributes.Add("readonly", "readonly"); SetDetailAdmin(); } else if (CStringUtil.IsNullOrEmpty(AdminId) == false && "D".Equals(CRUD)) { RemoveAdminData(AdminId); } SearchData(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (CStringUtil.IsNullOrEmpty(DutyNo) == false && "S".Equals(CRUD)) { // 수정 모드일때, 동적으로 readonly 속성 추가 duty_no.Attributes.Add("readonly", "readonly"); SetDetail(); } else if (CStringUtil.IsNullOrEmpty(DutyNo) == false && "D".Equals(CRUD)) { DelData(); } SearchData(); } }
private void SetControls() { DataSet ds = GetDataSet(3811, null); upr_duty_no.Items.Add(new ListItem("선택", "")); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { upr_duty_no.Items.Add(new ListItem(ds.Tables[0].Rows[i]["DUTY_NM"].ToString(), ds.Tables[0].Rows[i]["DUTY_NO"].ToString())); if (CStringUtil.IsNullOrEmpty(m_upr_duty_no) == false && m_upr_duty_no.Equals(ds.Tables[0].Rows[i]["DUTY_NO"].ToString())) { upr_duty_no.SelectedIndex = i + 1; } } } }
/// <summary> /// 로그인 /// </summary> private void GetLogin() { string password = string.Empty; if (CStringUtil.IsNullOrEmpty(admin_pw.Value) == false) { string password_enc = CSecureUtil.Encrypt(admin_pw.Value); //System.Diagnostics.Trace.WriteLine(password_enc); StringBuilder param = new StringBuilder(); param.Append(admin_id.Value); param.Append(CConst.DB_PARAM_DELIMITER).Append(admin_pw.Value); param.Append(CConst.DB_PARAM_DELIMITER).Append(password_enc); SetDataList(3000, param.ToString()); if (CStringUtil.IsNullOrEmpty(GetData(0, 0)) == false) { // 로그인 설정 및 시작 메뉴 URL을 가져온다. string startupUrl = SetLoginInfo(); if (CStringUtil.IsNullOrEmpty(startupUrl)) { ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox("접근 권한이 없습니다.")); } else { Response.Redirect(startupUrl); } } else { ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox("아이디 또는 비밀번호가 다릅니다.")); } } else { ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox("비밀번호가 입력되지 않았습니다.")); } }
/// <summary> /// 관리자 정보 삭제 /// </summary> private void RemoveAdminData(string adminId) { StringBuilder param = new StringBuilder(); param.Append(AdminId); string[] result = ExecuteQueryResult(3804, param.ToString()); if (result == null) { // 삭제 실패 - 코드 자체가 안오는 경우 ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox("시스템 오류가 발생하였습니다.")); } else if (result != null && CStringUtil.IsNullOrEmpty(result[0]).Equals("00") == false) { // 삭제 실패 ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox(result[1])); } Response.Redirect("./order_list.aspx"); }
protected string UploadFile(FileUpload upload, string dirKey) { string saveFileName = ""; if (upload.HasFile) { string sourceDir = DirUtil.GetUploadDir(dirKey); string newFile = GetNewFileName(upload.FileName); saveFileName = sourceDir + newFile.Replace(" ", ""); // 공백은 제거 // 물리파일 전체 경로 string physicalPath = CConst.DIR_ROOT_IMAGE_PATH + saveFileName; // 디렉토리 존재 유무 검사 후 디렉토리 생성 DirUtil.MakeDir(CConst.DIR_ROOT_IMAGE_PATH + sourceDir); // 파일 저장 upload.SaveAs(physicalPath); string fileUrl = saveFileName; //string fileUrl = DirUtil.CopyRemoteServer(sourceDir, newFile); if (CStringUtil.IsNullOrEmpty(fileUrl)) { // 실패한 경우에 파일 명 공백 saveFileName = ""; } else { saveFileName = fileUrl; } } else { System.Diagnostics.Debug.WriteLine("upload.HasFile:" + upload.HasFile); } return(saveFileName); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // check validation if (CStringUtil.IsNullOrEmpty(SupportNo)) { CWebUtil.jsAlertAndRedirect(this, "잘못된 경로로 진입하였습니다.", "/recruit/result_list.aspx"); } SearchData(); if (CStringUtil.IsNullOrEmpty(GetData(0, 0, "IS_PROCESSING")) || GetData(0, 0, "IS_PROCESSING").Equals("N")) { CWebUtil.jsAlertAndRedirect(this, "채용완료된 공고이거나 없는 채용공고 입니다.", "/recruit/result_list.aspx"); } SetControls(); InitControls(); } }