private bool ServiceSelect(string sm)
    {
        switch (sm)
        {
            case "V":

                param1 = Request.Params["param1"].ToString();
                param2 = Request.Params["param2"].ToString();

                ALMIS.ExecuteSTP eSTP = new ALMIS.ExecuteSTP();
                eSTP.Datas();
                DataSet ds = new DataSet();
                ds = eSTP.List10("P_PREDOK", param1, param2, "", "", "", "", "", "", "", "");

                dt = ds.Tables[0];

                Response.ContentType = "text/plain";

                Response.Write(dt.Rows[0]["ClausrNmrClm"].ToString() + "|"); //0
                Response.Write(dt.Rows[0]["PredokNmrDok"].ToString() + "|"); //1
                Response.Write(dt.Rows[0]["ClausrNamass"].ToString() + "|"); //2
                Response.Write(dt.Rows[0]["ClausrLokKab"].ToString() + "|"); //3
                Response.Write(dt.Rows[0]["ClausrLokKec"].ToString() + "|"); //4
                Response.Write(dt.Rows[0]["ClausrLokDes"].ToString() + "|"); //5
                Response.Write(dt.Rows[0]["ClausrKodPer"].ToString() + "|"); //6
                Response.Write(dt.Rows[0]["PredokLanjut"].ToString() + "|"); //7
                dt.Dispose();

                Response.End();
                Response.End();
                return false;

            case "L":

                param1 = Request.Params["param1"].ToString();
                param2 = Request.Params["param2"].ToString();

                ALMIS.ExecuteSTP eSTP_SA = new ALMIS.ExecuteSTP();
                eSTP_SA.Datas();
                DataSet ds_SA = new DataSet();
                ds_SA = eSTP_SA.List9("P_PREDOK_D", param1, param2, "", "", "", "", "", "", "");

                dt = ds_SA.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>"); // Untuk Membuat Angka
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["PredokNmrPid"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace("Delete^javascript:Hapus(\"" + "DA" + "\",\"" + "D" + "\",\"" + dt.Rows[i]["PredokNmrPid"].ToString() + "\");^_self") + "</cell>");

                    Response.Write("</row>");
                }
                Response.Write("</rows>");
                dt.Dispose();

                Response.End();
                Response.End();

                return false;

            case "LP":

                var param1l = Request.Params["param1"].ToString();
                var param2l = Request.Params["param2"].ToString();

                ALMIS.ExecuteSTP eSTPx = new ALMIS.ExecuteSTP();
                eSTPx.Datas();
                DataSet dsx = new DataSet();
                dsx = eSTPx.List9("P_PREDOK_D", param1l, param2l, "", "", "", "", "", "", "");
                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]["pengtoNmrPid"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["MidentNamass"].ToString()) + "</cell>");

                    Response.Write("</row>");
                }

                Response.Write("</rows>");
                dt.Dispose();
                Response.End();

                return false;

            case "CRUD":
                Response.ContentType = "text/plain";
                Response.Write(CRUD());
                Response.End();
                return false;

            case "CRUD_D":
                Response.ContentType = "text/plain";
                Response.Write(CRUD_D());
                Response.End();
                return false;

            default:
                Response.ContentType = "text/plain";
                Response.End();
                return true;
        }
    }
    private bool ServiceSelect(string sm)
    {
        switch (sm)
        {
            case "V":

                var param1 = Request.Params["param1"].ToString();
                var param2 = Request.Params["param2"].ToString();

                ALMIS.ExecuteSTP eSTP = new ALMIS.ExecuteSTP();
                eSTP.Datas();
                DataSet ds = new DataSet();
                ds = eSTP.List11("P_USERSS", param1, param2, "", "", "", "", "", "", "", "","");
                dt = ds.Tables[0];

                Response.ContentType = "text/plain";
                Response.Write(dt.Rows[0]["UserssIDents"].ToString() + "|"); //0
                //Response.Write(dt.Rows[0]["UserssPasswd"].ToString() + "|"); //1
                Response.Write(dt.Rows[0]["UserssNamess"].ToString() + "|"); //2
                Response.Write(dt.Rows[0]["UserssGroups"].ToString() + "|"); //3
                Response.Write(dt.Rows[0]["UserrsActive"].ToString() + "|"); //4
                Response.Write(dt.Rows[0]["UserssEmails"].ToString() + "|"); //5

                dt.Dispose();

                Response.End();
                Response.End();
                return false;

            case "L":

                var param1L = Request.Params["param1"].ToString();
                var param2L = Request.Params["param2"].ToString();
                ALMIS.ExecuteSTP eSTP_L = new ALMIS.ExecuteSTP();
                eSTP_L.Datas();
                DataSet ds_L = new DataSet();
                ds_L = eSTP_L.List9("P_USRPRS", param1L, param2L, "", "", "", "", "", "", "");

                dt = ds_L.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>"); // Untuk Membuat Angka
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["perusaIdents"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["perusaNamass"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["UsrprsKeters"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace("Delete^javascript:Hapus(\"" + "ID" + "\",\"" + "DD" + "\",\"" + dt.Rows[i]["usrprsuserss"].ToString() + "\",\"" + dt.Rows[i]["perusaIdents"].ToString() + "\");^_self") + "</cell>");

                    Response.Write("</row>");
                }
                Response.Write("</rows>");
                dt.Dispose();

                Response.End();

                return false;

            case "CRUD":
                Response.ContentType = "text/plain";
                Response.Write(Save());
                Response.End();
                return false;

            case "ID":
                Response.ContentType = "text/plain";
                Response.Write(ID());
                Response.End();
                return false;

            default:
                Response.ContentType = "text/plain";
                Response.End();
                return true;
        }
    }
    private String CRUD_D()
    {
        if (Session["userid"] is object)
        {
            userid = Session["userid"].ToString();

        }

        param1 = Request.Params["param1"].ToString();
        param2 = Request.Params["param2"].ToString();
        param3 = Request.Params["param3"].ToString();
        param4 = Request.Params["param4"].ToString();
        param5 = Request.Params["param5"].ToString();
        param6 = Request.Params["param6"].ToString();
        param7 = Request.Params["param7"].ToString();
        param8 = Request.Params["param8"].ToString();
        param9 = Request.Params["param9"].ToString();

        String sql = "";
        String output = "";

        try
        {

            output = param1;

            if (output == "I" || output == "E" || output == "D")
            {
                ALMIS.ExecuteSTP eSTP = new ALMIS.ExecuteSTP();

                eSTP.Datas();
                DataSet ds = new DataSet();
                ds = eSTP.List9("P_PREDOK_D", "X", param2, "", param4, param5, "", "", "", "");
                dt = ds.Tables[0];
                if (output == "I")
                {
                    if (dt.Rows.Count > 0)
                    {

                        if (output == "I")
                            output = "noadd";

                        return output;
                    }
                }
                eSTP.Datas();
                eSTP.save9("P_PREDOK_D", param1, param2, param3, param4, param5, userid, param7, param8, param9);

                if (output == "I")
                    output = "ID";
                if (output == "D")
                    output = "DD";

                return output;
            }
            else
                output = "gagal";
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
            Response.End();
            return ex.Message;
        }

        return output;
    }
    private String ID()
    {
        if (Session["userid"] is object)
        {
            userid = Session["userid"].ToString();

        }

        String param1 = ""; if (Request.Params["param1"] is object) param1 = Request.Params["param1"].ToString();
        String param2 = ""; if (Request.Params["param2"] is object) param2 = Request.Params["param2"].ToString();
        String param3 = ""; if (Request.Params["param3"] is object) param3 = Request.Params["param3"].ToString();
        String param4 = ""; if (Request.Params["param4"] is object) param4 = Request.Params["param4"].ToString();
        String param5 = ""; if (Request.Params["param5"] is object) param5 = Request.Params["param5"].ToString();
        String param6 = ""; if (Request.Params["param6"] is object) param6 = Request.Params["param6"].ToString();
        String param7 = ""; if (Request.Params["param7"] is object) param7 = Request.Params["param7"].ToString();
        String param8 = ""; if (Request.Params["param8"] is object) param8 = Request.Params["param8"].ToString();
        String param9 = ""; if (Request.Params["param9"] is object) param9 = Request.Params["param9"].ToString();
        //String sql = "";
        String output = "";

        try
        {
            output = param1;

            if (output == "ID")
            {
                ALMIS.ExecuteSTP eSTP = new ALMIS.ExecuteSTP();
                eSTP.Datas();
                DataSet ds = new DataSet();
                ds = eSTP.List9("P_USRPRS", "X", param2, "", param4, "", userid, "", "", "");
                dt = ds.Tables[0];

                if (dt.Rows.Count > 0)
                {
                    output = "notambah";
                    return output;

                }

            }

            if ( output == "ID" || output == "DD" )
            {

                ALMIS.ExecuteSTP eSTP = new ALMIS.ExecuteSTP();
                eSTP.Datas();
                eSTP.save9("P_USRPRS", param1, param2, param3, param4, param5, userid, param7, param8, "0");
                return output;

            }

        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
            Response.End();
            return ex.Message;
        }

        return output;
    }
    private bool ServiceSelect(string sm)
    {
        switch (sm)
        {
            case "L":

                var param1L = Request.Params["param1"].ToString();

                ALMIS.ExecuteSTP eSTP_L = new ALMIS.ExecuteSTP();
                eSTP_L.Datas();
                DataSet ds_L = new DataSet();
                ds_L = eSTP_L.List9("P_PERUSA", param1L, "", "", "", "", "", "", "", "");

                dt = ds_L.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>"); // Untuk Membuat Angka
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["perusaIdents"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["perusaDatess"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["perusaNamass"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["perusaKeterg"].ToString()) + "</cell>");

                    if (groups.ToString() == "1")
                    {

                        Response.Write("<cell>" + RemoveWhiteSpace("View^MasterPerusahaanForm.aspx?rand=" + r.Next() + "&param1=V" + "&param2=" + dt.Rows[i]["perusaIdents"].ToString() + "") + "</cell>");
                        Response.Write("<cell>" + RemoveWhiteSpace("Edit^MasterPerusahaanForm.aspx?rand=" + r.Next() + "&param1=E" + "&param2=" + dt.Rows[i]["perusaIdents"].ToString() + "") + "</cell>");
                        Response.Write("<cell>" + RemoveWhiteSpace("Delete^MasterPerusahaanForm.aspx?rand=" + r.Next() + "&param1=D" + "&param2=" + dt.Rows[i]["perusaIdents"].ToString() + "") + "</cell>");
                    }

                    else
                    {
                        if (MasterPerusahaanView.ToString() == "1")
                        {
                            Response.Write("<cell>" + RemoveWhiteSpace("View^MasterPerusahaanForm.aspx?rand=" + r.Next() + "&param1=V" + "&param2=" + dt.Rows[i]["perusaIdents"].ToString() + "") + "</cell>");
                        }
                        if (MasterPerusahaanEdit.ToString() == "1")
                        {
                            Response.Write("<cell>" + RemoveWhiteSpace("View^MasterPerusahaanForm.aspx?rand=" + r.Next() + "&param1=E" + "&param2=" + dt.Rows[i]["perusaIdents"].ToString() + "") + "</cell>");
                        }
                        if (MasterPerusahaanDelete.ToString() == "1")
                        {
                            Response.Write("<cell>" + RemoveWhiteSpace("View^MasterPerusahaanForm.aspx?rand=" + r.Next() + "&param1=D" + "&param2=" + dt.Rows[i]["perusaIdents"].ToString() + "") + "</cell>");

                        }
                    }

                    Response.Write("</row>");
                }
                Response.Write("</rows>");
                dt.Dispose();

                Response.End();
                Response.End();

                return false;

            default:
                Response.ContentType = "text/plain";
                Response.End();
                return true;
        }
    }
    private bool ServiceSelect(string sm)
    {
        switch (sm)
        {
            case "V":
                var Param1 = Request.Params["param1"].ToString();
                var Param2 = Request.Params["param2"].ToString();
                ALMIS.ExecuteSTP eSTP = new ALMIS.ExecuteSTP();
                eSTP.Datas();
                DataSet ds = new DataSet();
                ds = eSTP.List9("P_GROUPS", Param1, Param2, "", "", "", "", "", "", "");

                    dt = ds.Tables[0];

                Response.ContentType = "text/plain";
                Response.Write(dt.Rows[0]["GroupIDents"].ToString() + "|"); //0
                Response.Write(dt.Rows[0]["GroupsNamess"].ToString() + "|"); //1
                Response.Write(dt.Rows[0]["GroupsLanjut"].ToString() + "|"); //2
                Response.Write(dt.Rows[0]["GroupsExcept"].ToString() + "|"); //3

                dt.Dispose();

                Response.End();
                Response.End();
                return false;

            //return false;

            case "CRUD":
                Response.ContentType = "text/plain";
                Response.Write(Save());
                Response.End();
                return false;

            default:
                Response.ContentType = "text/plain";
                Response.End();
                return true;
        }
    }
    private bool ServiceSelect(string sm)
    {
        switch (sm)
        {
            case "V":

                var Param1 = Request.Params["param1"].ToString();
                var Param2 = Request.Params["param2"].ToString();
                ALMIS.ExecuteSTP eSTP = new ALMIS.ExecuteSTP();
                eSTP.Datas();
                DataSet ds = new DataSet();
                ds = eSTP.List24("P_PENGTO", Param1, Param2, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");

                dt = ds.Tables[0];

                Response.ContentType = "text/plain";
                Response.Write(dt.Rows[0]["pengtoNmrPid"].ToString() + "|"); //0
                Response.Write(dt.Rows[0]["pengtoDatess"].ToString() + "|"); //1
                Response.Write(dt.Rows[0]["registNmrReg"].ToString() + "|"); //2
                Response.Write(dt.Rows[0]["pengtoTgljdw"].ToString() + "|"); //3
                Response.Write(dt.Rows[0]["MidentNamass"].ToString() + "|"); //4
                Response.Write(dt.Rows[0]["MidentIdents"].ToString() + "|"); //5
                Response.Write(dt.Rows[0]["MidentNmrHps"].ToString() + "|"); //6
                Response.Write(dt.Rows[0]["MidentAlamat"].ToString() + "|"); //7
                Response.Write(dt.Rows[0]["registDatess"].ToString() + "|"); //8
                Response.Write(dt.Rows[0]["pengtoKeteks"].ToString() + "|"); //9
                Response.Write(dt.Rows[0]["pengtoEkseps"].ToString() + "|"); //10
                Response.Write(dt.Rows[0]["pengtoTglpen"].ToString() + "|"); //11
                Response.Write(dt.Rows[0]["pengtoToLMss"].ToString() + "|"); //12
                Response.Write(dt.Rows[0]["pengtoToSurv"].ToString() + "|"); //13
                Response.Write(dt.Rows[0]["pengtoAppsur"].ToString() + "|"); //14
                Response.Write(dt.Rows[0]["pengtoAppTss"].ToString() + "|"); //15
                Response.Write(dt.Rows[0]["pengtoDiteri"].ToString() + "|"); //16
                Response.Write(dt.Rows[0]["pengtoKtergn"].ToString() + "|"); //17
                Response.Write(dt.Rows[0]["pengtoLanjut"].ToString() + "|"); //18
                Response.Write(dt.Rows[0]["pengtoOverlp"].ToString() + "|"); //19
                Response.Write(dt.Rows[0]["pengtoIdents"].ToString() + "|"); //20
                Response.Write(dt.Rows[0]["pengtoNamPLK"].ToString() + "|"); //21
                Response.Write(dt.Rows[0]["pengtoLuasPL"].ToString() + "|"); //22

                dt.Dispose();

                Response.End();
                Response.End();
                return false;

            //return false;

            case "CRUD":
                Response.ContentType = "text/plain";
                Response.Write(CRUD());
                Response.End();
                return false;

            case "ID":
                Response.ContentType = "text/plain";
                Response.Write(SaveDetail());
                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("&amp;", "&")));

                Response.End();
                return false;
                break;

            case "SavePic":
                Response.ContentType = "text/plain";
                Response.Write(SaveUploadGIFDUMP());
                Response.End();
                return false;

            case "DOCpic":

                String path_pic = (HttpContext.Current.Request.Url.AbsolutePath).ToLower();

                string IDREGISTRASI = Request.Params["IDREGISTRASI"].ToString();
                string param1 = Request.Params["param1"].ToString();

                ALMIS.ExecuteSTP eSTPx = new ALMIS.ExecuteSTP();
                eSTPx.Datas();
                DataSet dsx = new DataSet();
                dsx = eSTPx.List24("P_PENGTO", param1, IDREGISTRASI, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");

                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]["hdocumFiless"].ToString()) + "</cell>");

                    Response.Write("<cell>" + "Download^" + path_pic + "?sm=df&amp;namafile=" + dt.Rows[i]["hdocumIdLink"].ToString() + "&amp;filelama=" + dt.Rows[i]["hdocumFiless"].ToString() + "</cell>");
                    //Response.Write("<cell>" + "Delete^" + path_pic + "?sm=Deletepic&amp;IDSOURCE=" + dt.Rows[i]["IDSource"].ToString() + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace("Delete^javascript:DeletePic(\"" + dt.Rows[i]["hdocumIdLink"].ToString()) + "\",\"" + IDREGISTRASI + "\");^_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;

            case "SD":

                var param1SA = Request.Params["param1"].ToString();
                var param2SA = Request.Params["param2"].ToString();

                ALMIS.ExecuteSTP eSTP_SA = new ALMIS.ExecuteSTP();
                eSTP_SA.Datas();
                DataSet ds_SA = new DataSet();
                ds_SA = eSTP_SA.List9("P_PENGTO_D", param1SA, param2SA, "", "", "", "", "", "", "");

                dt = ds_SA.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>"); // Untuk Membuat Angka
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["pengtoNamPlk"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["pengtoLuaPlk"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["pengtoStatus"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["pengtoIdents"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["pengtoSequen"].ToString()) + "</cell>");

                    Response.Write("</row>");
                }
                Response.Write("</rows>");
                dt.Dispose();

                Response.End();

                return false;
            default:
                Response.ContentType = "text/plain";
                Response.End();
                return true;

        }
    }
    private bool ServiceSelect(string sm)
    {
        switch (sm)
        {
            case "V": // Untuk Menampilkan Data Form Registrasi

                var Param1 = Request.Params["param1"].ToString();
                var Param2 = Request.Params["param2"].ToString();

                ALMIS.ExecuteSTP eSTP = new ALMIS.ExecuteSTP();
                eSTP.Datas();
                DataSet ds = new DataSet();
                ds = eSTP.List36("P_REGIST", Param1, Param2, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");

                dt = ds.Tables[0];

                Response.ContentType = "text/plain";

                Response.Write(dt.Rows[0]["registNmrReg"].ToString() + "|"); //0
                Response.Write(dt.Rows[0]["penlapNmrPen"].ToString() + "|"); //1
                Response.Write(dt.Rows[0]["registIdents"].ToString() + "|"); //2
                Response.Write(dt.Rows[0]["MidentNamass"].ToString() + "|"); //3
                Response.Write(dt.Rows[0]["MidentIdents"].ToString() + "|"); //4
                Response.Write(dt.Rows[0]["MidentNamass"].ToString() + "|"); //5
                Response.Write(dt.Rows[0]["MidentJnsKel"].ToString() + "|"); //6
                Response.Write(dt.Rows[0]["MidentTmplhr"].ToString() + "|"); //7
                Response.Write(dt.Rows[0]["MidentTgllhr"].ToString() + "|"); //8
                Response.Write(dt.Rows[0]["MidentPekerj"].ToString() + "|"); //9
                Response.Write(dt.Rows[0]["MidentNmrPeg"].ToString() + "|"); //10
                Response.Write(dt.Rows[0]["MidentAlamat"].ToString() + "|"); //11
                Response.Write(dt.Rows[0]["MidentJnsIdn"].ToString() + "|"); //12
                Response.Write(dt.Rows[0]["MidentNmrHps"].ToString() + "|"); //13
                Response.Write(dt.Rows[0]["MidentStatus"].ToString() + "|"); //14
                Response.Write(dt.Rows[0]["MidentNmPsng"].ToString() + "|"); //15
                Response.Write(dt.Rows[0]["MidentTmpPas"].ToString() + "|"); //16
                Response.Write(dt.Rows[0]["MidentTglPas"].ToString() + "|"); //17
                Response.Write(dt.Rows[0]["MidentThnNkh"].ToString() + "|"); //18
                Response.Write(dt.Rows[0]["registTy1Sts"].ToString() + "|"); //19
                Response.Write(dt.Rows[0]["registTy1Sts"].ToString() + "|"); //20
                Response.Write(dt.Rows[0]["registTy2Jml"].ToString() + "|"); //21
                Response.Write(dt.Rows[0]["registTy2Sts"].ToString() + "|"); //22
                Response.Write(dt.Rows[0]["registAlshak"].ToString() + "|"); //23
                Response.Write(dt.Rows[0]["registSHMsss"].ToString() + "|"); //24
                Response.Write(dt.Rows[0]["registSHMNmr"].ToString() + "|"); //25
                Response.Write(dt.Rows[0]["registSKTsss"].ToString() + "|"); //26
                Response.Write(dt.Rows[0]["registSKTNmr"].ToString() + "|"); //27
                Response.Write(dt.Rows[0]["registTahuns"].ToString() + "|"); //28
                Response.Write(dt.Rows[0]["praregLokkab"].ToString() + "|"); //29
                Response.Write(dt.Rows[0]["praregLokkec"].ToString() + "|"); //30
                Response.Write(dt.Rows[0]["praregLokdes"].ToString() + "|"); //31
                Response.Write(dt.Rows[0]["registLuasss"].ToString() + "|"); //32
                Response.Write(dt.Rows[0]["registBtsutr"].ToString() + "|"); //33
                Response.Write(dt.Rows[0]["registBtsslt"].ToString() + "|"); //34
                Response.Write(dt.Rows[0]["registBtstmr"].ToString() + "|"); //35
                Response.Write(dt.Rows[0]["registBtsbrt"].ToString() + "|"); //36
                Response.Write(dt.Rows[0]["registTy3Sts"].ToString() + "|"); //37
                Response.Write(dt.Rows[0]["registTy3Thn"].ToString() + "|"); //38
                Response.Write(dt.Rows[0]["registTy4Sts"].ToString() + "|"); //39
                Response.Write(dt.Rows[0]["registTy4Thn"].ToString() + "|"); //40
                Response.Write(dt.Rows[0]["registTy5Sts"].ToString() + "|"); //41
                Response.Write(dt.Rows[0]["registTy5Thn"].ToString() + "|"); //42
                Response.Write(dt.Rows[0]["registKtergn"].ToString() + "|"); //43
                Response.Write(dt.Rows[0]["registEkspsi"].ToString() + "|"); //44
                Response.Write(dt.Rows[0]["registLanjut"].ToString() + "|"); //45
                Response.Write(dt.Rows[0]["registKeteks"].ToString() + "|"); //46
                Response.Write(dt.Rows[0]["registKodper"].ToString() + "|"); //47

                dt.Dispose();

                Response.End();
                Response.End();
                return false;
            case "cek":

                var Param1x = Request.Params["param1"].ToString();
                var Param2x = Request.Params["param2"].ToString();

                ALMIS.ExecuteSTP eSTPx = new ALMIS.ExecuteSTP();
                eSTPx.Datas();
                DataSet dsx = new DataSet();
                dsx = eSTPx.List36("P_REGIST", Param1x, "", "", "", "", "", "", "", "", "", "", Param2x, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");

                dt = dsx.Tables[0];

                Response.ContentType = "text/plain";

                Response.Write(dt.Rows[0]["duplikat"].ToString() + "|"); //0
                Response.Write(dt.Rows[0]["registNmrReg"].ToString() + "|"); //1

                dt.Dispose();

                Response.End();
                return false;

            case "LAN":

                var param1LAN = Request.Params["param1"].ToString();
                var param2LAN = Request.Params["param2"].ToString();

                ALMIS.ExecuteSTP eSTP_LAN = new ALMIS.ExecuteSTP();
                eSTP_LAN.Datas();
                DataSet ds_LAN = new DataSet();
                ds_LAN = eSTP_LAN.List36("P_REGIST", param1LAN, param2LAN, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");

                dt = ds_LAN.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>"); // Untuk Membuat Angka
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["midentNamass"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["midentTgllhr"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["midentPkrjan"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["midentAlamat"].ToString()) + "</cell>");
                    Response.Write("</row>");
                }
                Response.Write("</rows>");
                dt.Dispose();

                Response.End();
                Response.End();

                return false;

            case "LAY":

                var param1LAY = Request.Params["param1"].ToString();
                var param2LAY = Request.Params["param2"].ToString();

                ALMIS.ExecuteSTP eSTP_LAY = new ALMIS.ExecuteSTP();
                eSTP_LAY.Datas();
                DataSet ds_LAY = new DataSet();
                ds_LAY = eSTP_LAY.List36("P_REGIST", param1LAY, param2LAY, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");

                dt = ds_LAY.Tables[0];

                Response.ContentType = "application/xhtml+xml";
                Response.Write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                Response.Write("<rows>");

                for (int i = 0; i < 1; i++)
                {
                    Random r = new Random();
                    Response.Write("<row id=\"" + (i + 1).ToString() + "\">");
                    Response.Write("<cell>" + (i + 1).ToString() + "</cell>"); // Untuk Membuat Angka
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["MidentNmAyah"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["MidentTglAyh"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["MidentKrjAyh"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["midentAlmAyh"].ToString()) + "</cell>");
                    Response.Write("</row>");
                }

                Response.Write("</rows>");
                dt.Dispose();

                Response.End();
                Response.End();

                return false;

            case "LIB":

                var param1LIB = Request.Params["param1"].ToString();
                var param2LIB = Request.Params["param2"].ToString();

                ALMIS.ExecuteSTP eSTP_LIB = new ALMIS.ExecuteSTP();
                eSTP_LIB.Datas();
                DataSet ds_LIB = new DataSet();
                ds_LIB = eSTP_LIB.List36("P_REGIST", param1LIB, param2LIB, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");

                dt = ds_LIB.Tables[0];

                Response.ContentType = "application/xhtml+xml";
                Response.Write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                Response.Write("<rows>");

                for (int i = 0; i < 1; i++)
                {
                    Random r = new Random();
                    Response.Write("<row id=\"" + (i + 1).ToString() + "\">");
                    Response.Write("<cell>" + (i + 1).ToString() + "</cell>"); // Untuk Membuat Angka
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["MidentNmIbus"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["MidentTglIbu"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["MidentKrjIbu"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["midentAlmIbu"].ToString()) + "</cell>");
                    Response.Write("</row>");
                }

                Response.Write("</rows>");
                dt.Dispose();

                Response.End();
                Response.End();

                return false;

            case "CRUD":
                Response.ContentType = "text/plain";
                Response.Write(Save());
                Response.End();
                return false;

            case "ddkl":
                Response.ContentType = "text/plain";
                Response.Write(IsiKelengkapan("1"));
                Response.End();
                return false;

            case "IA":

                string param1IA = Request.Params["param1"].ToString();
                string param2IA = Request.Params["param2"].ToString();
                string param3IA = Request.Params["param3"].ToString();
                string param4IA = Request.Params["param4"].ToString();
                string param5IA = Request.Params["param5"].ToString();
                string param6IA = Request.Params["param6"].ToString();

                ALMIS.ExecuteSTP eSTP_IA = new ALMIS.ExecuteSTP();
                eSTP_IA.Datas();
                eSTP_IA.save9("P_REGIST_D", param1IA, param2IA, "", param3IA, param4IA, param5IA, param6IA,"","");

                return false;

            case "SA": // Untuk Menampilkan Data Grid Kondisi Lahan Dan Ifra Stuktur

                var param1SA = Request.Params["param1"].ToString();
                var param2SA = Request.Params["param2"].ToString();
                var param3SA = Request.Params["param3"].ToString();

                ALMIS.ExecuteSTP eSTP_SA = new ALMIS.ExecuteSTP();
                eSTP_SA.Datas();
                DataSet ds_SA = new DataSet();
                ds_SA = eSTP_SA.List9("P_REGIST_D", param1SA, param2SA, "", param3SA, "", "","","","");

                dt = ds_SA.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>"); // Untuk Membuat Angka
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["registKondis"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["registKeters"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace("Delete^javascript:Hapus(\"" + "DA" + "\",\"" + "DA" + "\",\"" + dt.Rows[i]["registNmrReg"].ToString() + "\",\"" + dt.Rows[i]["registSequen"].ToString() + "\",\"" + dt.Rows[i]["registSequen"].ToString() + "\");^_self") + "</cell>");

                    Response.Write("</row>");
                }
                Response.Write("</rows>");
                dt.Dispose();

                Response.End();

                return false;
            case "DA":

                string param1DA = Request.Params["param1"].ToString();
                string param2DA = Request.Params["param2"].ToString();
                string param3DA = Request.Params["param3"].ToString();

                ALMIS.ExecuteSTP eSTP_DA = new ALMIS.ExecuteSTP();
                eSTP_DA.Datas();
                eSTP_DA.save8("P_REGIST_D", param1DA, param2DA, "", "", "", param3DA,"","");

                return false;

            case "ListUploadIdentitasLahan":

                var Param1z = Request.Params["param1"].ToString();
                var Param2z = Request.Params["IDRegistrasi"].ToString();

                String path_pic = (HttpContext.Current.Request.Url.AbsolutePath).ToLower();

                ALMIS.ExecuteSTP eSTPz = new ALMIS.ExecuteSTP();
                eSTPz.Datas();
                DataSet dsz = new DataSet();
                dsz = eSTPz.List36("P_REGIST", Param1z, Param2z, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");

                dt = dsz.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]["hdocumFiless"].ToString()) + "</cell>");

                    Response.Write("<cell>" + "Download^" + path_pic + "?sm=df&amp;namafile=" + dt.Rows[i]["hdocumIdLink"].ToString() + "&amp;filelama=" + dt.Rows[i]["hdocumFiless"].ToString() + "</cell>");
                    //Response.Write("<cell>" + "Delete^" + path_pic + "?sm=Deletepic&amp;IDSOURCE=" + dt.Rows[i]["IDSource"].ToString() + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace("Delete^javascript:DeletePic(\"" + dt.Rows[i]["hdocumIdLink"].ToString()) + "\",\"" + Param2z + "\");^_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();
                //conn.myConnectionClose();
                Response.End();
                return false;

            case "ListUploadKelengkapan":

                var Param1a = Request.Params["param1"].ToString();
                var Param2a = Request.Params["IDRegistrasi"].ToString();

                String path_pica = (HttpContext.Current.Request.Url.AbsolutePath).ToLower();

                ALMIS.ExecuteSTP eSTPa = new ALMIS.ExecuteSTP();
                eSTPa.Datas();
                DataSet dsa = new DataSet();
                dsa = eSTPa.List9("P_REGIST_D", Param1a, Param2a, "", "", "", "","","","");

                dt = dsa.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]["codessDescs2"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["hdocumFiless"].ToString()) + "</cell>");

                    Response.Write("<cell>" + "Download^" + path_pica + "?sm=df&amp;namafile=" + dt.Rows[i]["hdocumIdLink"].ToString() + "&amp;filelama=" + dt.Rows[i]["hdocumFiless"].ToString() + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace("Delete^javascript:DeletePic(\"" + dt.Rows[i]["hdocumIdLink"].ToString()) + "\",\"" + Param2a + "\");^_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();
                //conn.myConnectionClose();
                Response.End();
                return false;

            case "SaveUploadRegistrasi":
                Response.ContentType = "text/plain";
                Response.Write(SaveUploadRegistrasi());
                Response.End();
                return false;

            case "SaveUploadKelengkapan":
                Response.ContentType = "text/plain";
                Response.Write(SaveUploadKelengkapan());
                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("&amp;", "&")));

                Response.End();
                return false;

            default:
                Response.ContentType = "text/plain";
                Response.End();
                return true;
        }
    }