private bool ServiceSelect(string sm) { switch (sm) { case "V": var Param1 = Request.Params["param1"].ToString(); var Param2 = Request.Params["param2"].ToString(); LANDCOMP.ExecuteSTP eSTP = new LANDCOMP.ExecuteSTP(); eSTP.Datas(); DataSet ds = new DataSet(); ds = eSTP.List13("P_PENLAP", Param1, Param2, "", "", "", "", "", "", "", "", "", "", ""); dt = ds.Tables[0]; Response.ContentType = "text/plain"; Response.Write(dt.Rows[0]["penlapNmrPen"].ToString() + "|"); // Response.Write(dt.Rows[0]["penlapDatess"].ToString() + "|"); //1 Response.Write(dt.Rows[0]["penlapTglukr"].ToString() + "|"); //2 Response.Write(dt.Rows[0]["penlapTglJdw"].ToString() + "|"); //3 Response.Write(dt.Rows[0]["praregNmrPra"].ToString() + "|"); //4 Response.Write(dt.Rows[0]["penlapKtngan"].ToString() + "|"); //5 Response.Write(dt.Rows[0]["penlapLanjut"].ToString() + "|"); //6 Response.Write(dt.Rows[0]["PenlapEkspsi"].ToString() + "|"); //7 Response.Write(dt.Rows[0]["penlapKeteks"].ToString() + "|"); //8 Response.Write(dt.Rows[0]["penlapUserid"].ToString() + "|"); //9 Response.Write(dt.Rows[0]["penlapUserdt"].ToString() + "|"); //10 Response.Write(dt.Rows[0]["penlapAssign"].ToString() + "|"); //11 Response.Write(dt.Rows[0]["praregNmrPra"].ToString() + "|"); //12 Response.Write(dt.Rows[0]["praregLokkab"].ToString() + "|"); //13 Response.Write(dt.Rows[0]["praregLokkec"].ToString() + "|"); //14 Response.Write(dt.Rows[0]["praregLokdes"].ToString() + "|"); //15 Response.Write(dt.Rows[0]["MidentNamass"].ToString() + "|"); //16 dt.Dispose(); Response.End(); Response.End(); return false; //return false; case "CRUD": Response.ContentType = "text/plain"; Response.Write(Save()); Response.End(); return false; case "df": Response.Clear(); string namafile = (Request.Params["filelama"] is object ? Request.Params["filelama"].ToString() : ""); String urlfile = (Request.Params["namafile"] is object ? Request.Params["namafile"].ToString() : ""); String randomfile = (Request.Params["random"] is object ? Request.Params["random"].ToString() : ""); string type = ""; switch (namafile.Substring(namafile.Length - 4)) { case ".htm": case ".html": type = "text/HTML"; break; case ".txt": type = "text/plain"; break; case ".doc": case ".docx": case ".rtf": type = "Application/msword"; break; case ".xls": case ".xlsx": type = "Application/msexcel"; break; case ".zip": case ".rar": type = "application/zip"; break; case ".pdf": type = "application/pdf"; break; case ".jpg": type = "image/JPG"; break; case ".pgn": type = "image/PNG"; break; case ".tif": type = "image/tif"; break; } Response.AddHeader("content-disposition", "attachment;filename=" + namafile + ""); Response.ContentType = type; Response.WriteFile(Server.MapPath(@"~/uploaddocument/" + Request.Params["namafile"].ToString().Replace("&", "&"))); Response.End(); return false; break; case "SavePic": Response.ContentType = "text/plain"; Response.Write(SaveUploadPengecekan()); Response.End(); return false; case "DOCpic": String path_pic = (HttpContext.Current.Request.Url.AbsolutePath).ToLower(); string IDPengecekan = Request.Params["IDPengecekan"].ToString(); string param1 = Request.Params["param1"].ToString(); LANDCOMP.ExecuteSTP eSTPx = new LANDCOMP.ExecuteSTP(); eSTPx.Datas(); DataSet dsx = new DataSet(); dsx = eSTPx.List5("P_PENLAP_D", param1, IDPengecekan, "", "", ""); dt = dsx.Tables[0]; Response.ContentType = "application/xhtml+xml"; Response.Write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); Response.Write("<rows>"); for (int i = 0; i < dt.Rows.Count; i++) { Random r = new Random(); Response.Write("<row id=\"" + (i + 1).ToString() + "\">"); Response.Write("<cell>" + (i + 1).ToString() + "</cell>"); Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["codessDescs1"].ToString()) + "</cell>"); Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["penlapKetera"].ToString()) + "</cell>"); Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["hdocumFiless"].ToString()) + "</cell>"); Response.Write("<cell>" + "Download^" + path_pic + "?sm=df&namafile=" + dt.Rows[i]["hdocumIdLink"].ToString() + "&filelama=" + dt.Rows[i]["hdocumFiless"].ToString() + "</cell>"); //Response.Write("<cell>" + "Delete^" + path_pic + "?sm=Deletepic&IDSOURCE=" + dt.Rows[i]["IDSource"].ToString() + "</cell>"); Response.Write("<cell>" + RemoveWhiteSpace("Delete^javascript:DeletePic(\"" + dt.Rows[i]["hdocumIdLink"].ToString()) + "\",\"" + IDPengecekan + "\");^_self" + "</cell>"); Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["hdocumIdSour"].ToString()) + "</cell>"); Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["hdocumIdLink"].ToString()) + "</cell>"); Response.Write("</row>"); } Response.Write("</rows>"); dt.Dispose(); Response.End(); return false; default: Response.ContentType = "text/plain"; Response.End(); return true; } }