public static string CreateMasterTableInfo(string detailtable, string[] keys, System.Web.UI.Page page)
    {
        string strTableName = "dbo.DOKUMEN";
        string oldTableName = strTableName;
        string keyField     = string.Empty;
        string output       = string.Empty;
        Dictionary <string, object> smarty = new Dictionary <string, object>();
        Builder builder = Factory.CreateBuilder();

        smarty.Add("__table", strTableName);
        string sCulture = ConfigurationManager.AppSettings["LCID"];

        if (!String.IsNullOrEmpty(sCulture))
        {
            int nCulture = int.Parse(sCulture);
            smarty.Add("LCID", nCulture);
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(nCulture, false);
        }
        if (System.Web.HttpContext.Current.Session["locale_xml"] != null)
        {
            smarty.Add("Captions", AspNetRunnerPage.GetTableCaptions((XmlNode)System.Web.HttpContext.Current.Session["locale_xml"],
                                                                     (string)System.Web.HttpContext.Current.Session["language"]));
            if (!string.IsNullOrEmpty(strTableName))
            {
                smarty.Add("Labels", AspNetRunnerPage.GetFieldCaptions((XmlNode)System.Web.HttpContext.Current.Session["locale_xml"],
                                                                       (string)System.Web.HttpContext.Current.Session["language"], "dbo_DOKUMEN"));
            }
        }
        IDictionary <string, object> par = new Dictionary <string, object>();

        keyField      = "KODEDOKUMEN";
        par[keyField] = keys[1 - 1];

        DOKUMENController controller = new DOKUMENController();
        DOKUMEN           item       = controller.FetchByManyID(par);

        string keylink = string.Empty;

        if (item != null)
        {
            keylink += "&key1=" + Control.HTMLEncodeSpecialChars(HttpUtility.UrlEncode(item.KODEDOKUMEN.ToString()));
        }

        string value = "";

        Control control_KODEDOKUMEN = new Control("KODEDOKUMEN", item.KODEDOKUMEN, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	KODEDOKUMEN -
        value = control_KODEDOKUMEN.GetData();
        value = control_KODEDOKUMEN.ProcessLargeText(value, "field=KODEDOKUMEN" + keylink, "", MODE.MODE_LIST);
        smarty.Add("KODEDOKUMEN_mastervalue", value);

        Control control_DESKRIPSI = new Control("DESKRIPSI", item.DESKRIPSI, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	DESKRIPSI -
        value = control_DESKRIPSI.GetData();
        value = control_DESKRIPSI.ProcessLargeText(value, "field=DESKRIPSI" + keylink, "", MODE.MODE_LIST);
        smarty.Add("DESKRIPSI_mastervalue", value);
        return(func.BuildOutput(page, @"~\DOKUMEN_masterlist.aspx", smarty));
    }
Exemplo n.º 2
0
    public static string DisplayMasterTableInfo(string sourcetable, IList <object> masterkeys, System.Web.UI.Page page)
    {
        string strTableName = "JENISKEGIATAN";
        string oldTableName = strTableName;
        string keyField     = string.Empty;
        string output       = string.Empty;
        Dictionary <string, object> smarty = new Dictionary <string, object>();
        Builder builder = Factory.CreateBuilder();

        smarty.Add("__table", "JENISKEGIATAN");
        string sCulture = ConfigurationManager.AppSettings["LCID"];

        if (!String.IsNullOrEmpty(sCulture))
        {
            int nCulture = int.Parse(sCulture);
            smarty.Add("LCID", nCulture);
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(nCulture, false);
        }
        if (System.Web.HttpContext.Current.Session["locale_xml"] != null)
        {
            smarty.Add("Captions", AspNetRunnerPage.GetTableCaptions((XmlNode)System.Web.HttpContext.Current.Session["locale_xml"],
                                                                     (string)System.Web.HttpContext.Current.Session["language"]));
            if (!string.IsNullOrEmpty(strTableName))
            {
                smarty.Add("Labels", AspNetRunnerPage.GetFieldCaptions((XmlNode)System.Web.HttpContext.Current.Session["locale_xml"],
                                                                       (string)System.Web.HttpContext.Current.Session["language"],
                                                                       "dbo_JENISKEGIATAN"));
            }
        }

        keyField = "KODEJENISKEGIATAN";
        keyField = "KODEJENISKEGIATAN";

        JENISKEGIATANController controller = new JENISKEGIATANController();
        JENISKEGIATANCollection collection = controller.FetchByID(masterkeys[0]);

        string keylink = string.Empty;

        if (collection != null && collection.Count > 0)
        {
            keylink += "&key1=" + Control.HTMLEncodeSpecialChars(HttpUtility.UrlEncode(collection[0].KODEJENISKEGIATAN.ToString()));
        }

        string value = "";

        Control control_KODEJENISKEGIATAN = new Control("KODEJENISKEGIATAN", collection[0].KODEJENISKEGIATAN, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	KODEJENISKEGIATAN -
        value = control_KODEJENISKEGIATAN.GetData();
        value = control_KODEJENISKEGIATAN.ProcessLargeText(value, "field=KODEJENISKEGIATAN" + keylink, "", MODE.MODE_LIST);
        smarty.Add("KODEJENISKEGIATAN_mastervalue", value);

        Control control_DESKRIPSI = new Control("DESKRIPSI", collection[0].DESKRIPSI, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	DESKRIPSI -
        value = control_DESKRIPSI.GetData();
        value = control_DESKRIPSI.ProcessLargeText(value, "field=DESKRIPSI" + keylink, "", MODE.MODE_LIST);
        smarty.Add("DESKRIPSI_mastervalue", value);
        return(func.BuildOutput(page, @"~\JENISKEGIATAN_masterprint.aspx", smarty));
    }
    public static string CreateMasterTableInfo(string detailtable, string[] keys, System.Web.UI.Page page)
    {
        string strTableName = "dbo.AKTOR";
        string oldTableName = strTableName;
        string keyField     = string.Empty;
        string output       = string.Empty;
        Dictionary <string, object> smarty = new Dictionary <string, object>();
        Builder builder = Factory.CreateBuilder();

        smarty.Add("__table", strTableName);
        string sCulture = ConfigurationManager.AppSettings["LCID"];

        if (!String.IsNullOrEmpty(sCulture))
        {
            int nCulture = int.Parse(sCulture);
            smarty.Add("LCID", nCulture);
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(nCulture, false);
        }
        if (System.Web.HttpContext.Current.Session["locale_xml"] != null)
        {
            smarty.Add("Captions", AspNetRunnerPage.GetTableCaptions((XmlNode)System.Web.HttpContext.Current.Session["locale_xml"],
                                                                     (string)System.Web.HttpContext.Current.Session["language"]));
            if (!string.IsNullOrEmpty(strTableName))
            {
                smarty.Add("Labels", AspNetRunnerPage.GetFieldCaptions((XmlNode)System.Web.HttpContext.Current.Session["locale_xml"],
                                                                       (string)System.Web.HttpContext.Current.Session["language"], "dbo_AKTOR"));
            }
        }
        IDictionary <string, object> par = new Dictionary <string, object>();

        keyField      = "NIP";
        par[keyField] = keys[1 - 1];
        keyField      = "NIP";
        par[keyField] = keys[1 - 1];

        AKTORController controller = new AKTORController();
        AKTOR           item       = controller.FetchByManyID(par);

        string keylink = string.Empty;

        if (item != null)
        {
            keylink += "&key1=" + Control.HTMLEncodeSpecialChars(HttpUtility.UrlEncode(item.NIP.ToString()));
        }

        string value = "";

        Control control_NIP = new Control("NIP", item.NIP, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	NIP -
        value = control_NIP.GetData();
        value = control_NIP.ProcessLargeText(value, "field=NIP" + keylink, "", MODE.MODE_LIST);
        smarty.Add("NIP_mastervalue", value);

        Control control_NAMA = new Control("NAMA", item.NAMA, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	NAMA -
        value = control_NAMA.GetData();
        value = control_NAMA.ProcessLargeText(value, "field=NAMA" + keylink, "", MODE.MODE_LIST);
        smarty.Add("NAMA_mastervalue", value);

        Control control_KODEJABATAN = new Control("KODEJABATAN", item.KODEJABATAN, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	KODEJABATAN -
        control_KODEJABATAN.Value = func.GetLookupValue(control_KODEJABATAN.FieldInfo);
        value = control_KODEJABATAN.DisplayLookupWizard();
        smarty.Add("KODEJABATAN_mastervalue", value);

        Control control_KODETIPE = new Control("KODETIPE", item.KODETIPE, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	KODETIPE -
        control_KODETIPE.Value = func.GetLookupValue(control_KODETIPE.FieldInfo);
        value = control_KODETIPE.DisplayLookupWizard();
        smarty.Add("KODETIPE_mastervalue", value);
        return(func.BuildOutput(page, @"~\AKTOR_masterlist.aspx", smarty));
    }
Exemplo n.º 4
0
    public static string DisplayMasterTableInfo(string sourcetable, IList <object> masterkeys, System.Web.UI.Page page)
    {
        string strTableName = "PBJ";
        string oldTableName = strTableName;
        string keyField     = string.Empty;
        string output       = string.Empty;
        Dictionary <string, object> smarty = new Dictionary <string, object>();
        Builder builder = Factory.CreateBuilder();

        smarty.Add("__table", "PBJ");
        string sCulture = ConfigurationManager.AppSettings["LCID"];

        if (!String.IsNullOrEmpty(sCulture))
        {
            int nCulture = int.Parse(sCulture);
            smarty.Add("LCID", nCulture);
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(nCulture, false);
        }
        if (System.Web.HttpContext.Current.Session["locale_xml"] != null)
        {
            smarty.Add("Captions", AspNetRunnerPage.GetTableCaptions((XmlNode)System.Web.HttpContext.Current.Session["locale_xml"],
                                                                     (string)System.Web.HttpContext.Current.Session["language"]));
            if (!string.IsNullOrEmpty(strTableName))
            {
                smarty.Add("Labels", AspNetRunnerPage.GetFieldCaptions((XmlNode)System.Web.HttpContext.Current.Session["locale_xml"],
                                                                       (string)System.Web.HttpContext.Current.Session["language"],
                                                                       "dbo_PBJ"));
            }
        }

        keyField = "KODEPBJ";
        keyField = "KODEPBJ";

        PBJController controller = new PBJController();
        PBJCollection collection = controller.FetchByID(masterkeys[0]);

        string keylink = string.Empty;

        if (collection != null && collection.Count > 0)
        {
            keylink += "&key1=" + Control.HTMLEncodeSpecialChars(HttpUtility.UrlEncode(collection[0].KODEPBJ.ToString()));
        }

        string value = "";

        Control control_KODEPBJ = new Control("KODEPBJ", collection[0].KODEPBJ, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	KODEPBJ -
        value = control_KODEPBJ.GetData();
        value = control_KODEPBJ.ProcessLargeText(value, "field=KODEPBJ" + keylink, "", MODE.MODE_LIST);
        smarty.Add("KODEPBJ_mastervalue", value);

        Control control_NAMAKEGIATAN = new Control("NAMAKEGIATAN", collection[0].NAMAKEGIATAN, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	NAMAKEGIATAN -
        value = control_NAMAKEGIATAN.GetData();
        value = control_NAMAKEGIATAN.ProcessLargeText(value, "field=NAMAKEGIATAN" + keylink, "", MODE.MODE_LIST);
        smarty.Add("NAMAKEGIATAN_mastervalue", value);

        Control control_NAMAPAKET = new Control("NAMAPAKET", collection[0].NAMAPAKET, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	NAMAPAKET -
        value = control_NAMAPAKET.GetData();
        value = control_NAMAPAKET.ProcessLargeText(value, "field=NAMAPAKET" + keylink, "", MODE.MODE_LIST);
        smarty.Add("NAMAPAKET_mastervalue", value);

        Control control_KODESKPD = new Control("KODESKPD", collection[0].KODESKPD, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	KODESKPD -
        control_KODESKPD.Value = func.GetLookupValue(control_KODESKPD.FieldInfo);
        value = control_KODESKPD.DisplayLookupWizard();
        smarty.Add("KODESKPD_mastervalue", value);

        Control control_PPK = new Control("PPK", collection[0].PPK, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	PPK -
        control_PPK.Value = func.GetLookupValue(control_PPK.FieldInfo);
        value             = control_PPK.DisplayLookupWizard();
        smarty.Add("PPK_mastervalue", value);

        Control control_PPTK = new Control("PPTK", collection[0].PPTK, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	PPTK -
        control_PPTK.Value = func.GetLookupValue(control_PPTK.FieldInfo);
        value = control_PPTK.DisplayLookupWizard();
        smarty.Add("PPTK_mastervalue", value);

        Control control_KODEJENISKEGIATAN = new Control("KODEJENISKEGIATAN", collection[0].KODEJENISKEGIATAN, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	KODEJENISKEGIATAN -
        control_KODEJENISKEGIATAN.Value = func.GetLookupValue(control_KODEJENISKEGIATAN.FieldInfo);
        value = control_KODEJENISKEGIATAN.DisplayLookupWizard();
        smarty.Add("KODEJENISKEGIATAN_mastervalue", value);

        Control control_TANGGALPENGAJUAN = new Control("TANGGALPENGAJUAN", collection[0].TANGGALPENGAJUAN, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	TANGGALPENGAJUAN - Short Date
        value = control_TANGGALPENGAJUAN.GetData();
        value = control_TANGGALPENGAJUAN.ProcessLargeText(value, "field=TANGGALPENGAJUAN" + keylink, "", MODE.MODE_LIST);
        smarty.Add("TANGGALPENGAJUAN_mastervalue", value);

        Control control_LENGKAP = new Control("LENGKAP", collection[0].LENGKAP, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	LENGKAP -
        value = control_LENGKAP.GetData();
        value = control_LENGKAP.ProcessLargeText(value, "field=LENGKAP" + keylink, "", MODE.MODE_LIST);
        smarty.Add("LENGKAP_mastervalue", value);

        Control control_DIKEMBALIKAN = new Control("DIKEMBALIKAN", collection[0].DIKEMBALIKAN, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	DIKEMBALIKAN -
        value = control_DIKEMBALIKAN.GetData();
        value = control_DIKEMBALIKAN.ProcessLargeText(value, "field=DIKEMBALIKAN" + keylink, "", MODE.MODE_LIST);
        smarty.Add("DIKEMBALIKAN_mastervalue", value);

        Control control_KODESTATUSPBJ = new Control("KODESTATUSPBJ", collection[0].KODESTATUSPBJ, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	KODESTATUSPBJ -
        control_KODESTATUSPBJ.Value = func.GetLookupValue(control_KODESTATUSPBJ.FieldInfo);
        value = control_KODESTATUSPBJ.DisplayLookupWizard();
        smarty.Add("KODESTATUSPBJ_mastervalue", value);
        return(func.BuildOutput(page, @"~\PBJ_masterprint.aspx", smarty));
    }
    public static string DisplayMasterTableInfo(string sourcetable, IList <object> masterkeys, System.Web.UI.Page page)
    {
        string strTableName = "Tb_Vendor";
        string oldTableName = strTableName;
        string keyField     = string.Empty;
        string output       = string.Empty;
        Dictionary <string, object> smarty = new Dictionary <string, object>();
        Builder builder = Factory.CreateBuilder();

        smarty.Add("__table", "Tb_Vendor");
        string sCulture = ConfigurationManager.AppSettings["LCID"];

        if (!String.IsNullOrEmpty(sCulture))
        {
            int nCulture = int.Parse(sCulture);
            smarty.Add("LCID", nCulture);
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(nCulture, false);
        }
        if (System.Web.HttpContext.Current.Session["locale_xml"] != null)
        {
            smarty.Add("Captions", AspNetRunnerPage.GetTableCaptions((XmlNode)System.Web.HttpContext.Current.Session["locale_xml"],
                                                                     (string)System.Web.HttpContext.Current.Session["language"]));
            if (!string.IsNullOrEmpty(strTableName))
            {
                smarty.Add("Labels", AspNetRunnerPage.GetFieldCaptions((XmlNode)System.Web.HttpContext.Current.Session["locale_xml"],
                                                                       (string)System.Web.HttpContext.Current.Session["language"],
                                                                       "dbo_Tb_Vendor"));
            }
        }

        keyField = "KD_VENDOR";

        Tb_VendorController controller = new Tb_VendorController();
        Tb_VendorCollection collection = controller.FetchByID(masterkeys[0]);

        string keylink = string.Empty;

        if (collection != null && collection.Count > 0)
        {
            keylink += "&key1=" + Control.HTMLEncodeSpecialChars(HttpUtility.UrlEncode(collection[0].KD_VENDOR.ToString()));
        }

        string value = "";

        Control control_KD_VENDOR = new Control("KD_VENDOR", collection[0].KD_VENDOR, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	KD_VENDOR -
        value = control_KD_VENDOR.GetData();
        value = control_KD_VENDOR.ProcessLargeText(value, "field=KD%5FVENDOR" + keylink, "", MODE.MODE_LIST);
        smarty.Add("KD_VENDOR_mastervalue", value);

        Control control_NAMA = new Control("NAMA", collection[0].NAMA, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	NAMA -
        value = control_NAMA.GetData();
        value = control_NAMA.ProcessLargeText(value, "field=NAMA" + keylink, "", MODE.MODE_LIST);
        smarty.Add("NAMA_mastervalue", value);

        Control control_ALAMAT = new Control("ALAMAT", collection[0].ALAMAT, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	ALAMAT -
        value = control_ALAMAT.GetData();
        value = control_ALAMAT.ProcessLargeText(value, "field=ALAMAT" + keylink, "", MODE.MODE_LIST);
        smarty.Add("ALAMAT_mastervalue", value);

        Control control_NPWP = new Control("NPWP", collection[0].NPWP, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	NPWP -
        value = control_NPWP.GetData();
        value = control_NPWP.ProcessLargeText(value, "field=NPWP" + keylink, "", MODE.MODE_LIST);
        smarty.Add("NPWP_mastervalue", value);

        Control control_TELEPON = new Control("TELEPON", collection[0].TELEPON, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	TELEPON -
        value = control_TELEPON.GetData();
        value = control_TELEPON.ProcessLargeText(value, "field=TELEPON" + keylink, "", MODE.MODE_LIST);
        smarty.Add("TELEPON_mastervalue", value);

        Control control_FAX = new Control("FAX", collection[0].FAX, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	FAX -
        value = control_FAX.GetData();
        value = control_FAX.ProcessLargeText(value, "field=FAX" + keylink, "", MODE.MODE_LIST);
        smarty.Add("FAX_mastervalue", value);

        Control control_EMAIL = new Control("EMAIL", collection[0].EMAIL, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	EMAIL -
        value = control_EMAIL.GetData();
        value = control_EMAIL.ProcessLargeText(value, "field=EMAIL" + keylink, "", MODE.MODE_LIST);
        smarty.Add("EMAIL_mastervalue", value);

        Control control_STATUS = new Control("STATUS", collection[0].STATUS, false, smarty, page.Request, builder, MODE.MODE_LIST);

        //	STATUS - Checkbox
        value = control_STATUS.GetData();
        smarty.Add("STATUS_mastervalue", value);
        return(func.BuildOutput(page, @"~\Tb_Vendor_masterprint.aspx", smarty));
    }