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;
        }
    }
Exemplo n.º 2
0
    private bool ServiceSelect(string sm)
    {
        switch (sm)
        {
            case "L":

                var param1L = Request.Params["param1"].ToString();
                var param2L = Request.Params["param2"].ToString();
                var param4L = Request.Params["param4"].ToString();
                ALMIS.ExecuteSTP eSTP_L = new ALMIS.ExecuteSTP();
                eSTP_L.Datas();
                DataSet ds_L = new DataSet();
                ds_L = eSTP_L.List10("P_VISUMS_D", param1L, param2L, "", param4L, "", "", "", "", "", "");
                dt = ds_L.Tables[0];
                Response.ContentType = "application/xhtml+xml";
                Response.Write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                Response.Write("<rows>");

                    if (param1L == "LRK")
                    {
                        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]["visumsCodess"].ToString()) + "</cell>");
                            Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["visumsKtrgn"].ToString()) + "</cell>");
                            Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["visumsRekom"].ToString()) + "</cell>");
                            Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["visumsAksi"].ToString()) + "</cell>");
                            Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["visumsSequen"].ToString()) + "</cell>");
                            Response.Write("</row>");
                        }
                    }

                    else
                    {
                        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]["visumsCodess"].ToString()) + "</cell>");
                            Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["visumsKtrgn"].ToString()) + "</cell>");
                            Response.Write("<cell>" + RemoveWhiteSpace("Hapus^javascript:Hapus(\"" + "DO" + "\",\"" + "DO" + "\",\"" + dt.Rows[i]["visumsNovism"].ToString() + "\",\"" + dt.Rows[i]["visumsSequen"].ToString() + "\",\"" + "\");^_self") + "</cell>");
                            Response.Write("</row>");
                        }
                    }
                Response.Write("</rows>");
                dt.Dispose();
                Response.End();
                Response.End();

                return false;

            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.List13("P_VISUMS", Param1, Param2, "", "", "", "", "", "", "", "", "", "", "");

                dt = ds.Tables[0];

                Response.ContentType = "text/plain";
                Response.Write(dt.Rows[0]["visumsNovism"].ToString() + "|"); //0
                Response.Write(dt.Rows[0]["registNmrReg"].ToString() + "|"); //1
                Response.Write(dt.Rows[0]["pengtoNmrPid"].ToString() + "|"); //2
                Response.Write(dt.Rows[0]["visumsVerLnj"].ToString() + "|"); //3
                Response.Write(dt.Rows[0]["visumsEkseps"].ToString() + "|"); //4
                Response.Write(dt.Rows[0]["VisumsKetEks"].ToString() + "|"); //5
                dt.Dispose();

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

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

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

            default:
                Response.ContentType = "text/plain";
                Response.End();
                return true;
        }
    }
    private String CRUD()
    {
        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();
        param10 = Request.Params["param10"].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.List10("P_PREDOK", "X", param2, "", param4, "", "", "", "", "", "");
                dt = ds.Tables[0];

                if (dt.Rows.Count > 0)
                {
                    if (output == "E")
                        output = "noedit";

                    if (output == "D")
                        output = "nodelete";

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

                    return output;
                }

                eSTP.Datas();
                eSTP.save10("P_PREDOK", param1, param2, param3, param4, userid, param6, param7, param8, param9, param10);

                return output;
            }
            else
                output = "gagal";
        }
        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();
                var param2L = Request.Params["param2"].ToString();
                var param4L = Request.Params["param4"].ToString();
                var param5L = Request.Params["param5"].ToString();
                var param7L = Request.Params["param7"].ToString();
                ALMIS.ExecuteSTP eSTP_L = new ALMIS.ExecuteSTP();
                eSTP_L.Datas();
                DataSet ds_L = new DataSet();
                ds_L = eSTP_L.List10("P_PREDOK", param1L, param2L, "", param4L, param5L, "", param7L, "", userid, "");

                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]["PredokNmrDok"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["ClausrNmrClm"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["ClausrNamass"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["ClausrLokKab"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["ClausrLokKec"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["ClausrLokDes"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["perusaNamass"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["PredokAssign"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["PredokLanjut"].ToString()) + "</cell>");
                    Response.Write("<cell>" + RemoveWhiteSpace(dt.Rows[i]["Assign"].ToString()) + "</cell>");

                    //if (dt.Rows[i]["ClausrNmrClm"].ToString() != "")
                    //{

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

                    //}

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

                Response.End();

                return false;

            case "A":

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

                ALMIS.ExecuteSTP eSTP = new ALMIS.ExecuteSTP();
                eSTP.Datas();
                DataSet ds = new DataSet();
                eSTP.save10("P_PREDOK", param1, param2, "", param4, userid, "", param7, "", param9, "");
                Response.End();
                return false;

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

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