Example #1
0
        public virtual void rootElement_LayoutUpdated(object sender, EventArgs e)
        {
            String oldPrevItemWidth  = rptConfig.GetConfigValue("PrevItemWidth");
            String oldPrevAreaHeight = rptConfig.GetConfigValue("PrevAreaHeight");

            String hstr1 = CUtil.FormatNumber(oldPrevAreaHeight);
            String wstr1 = CUtil.FormatNumber(oldPrevItemWidth);


            double areaHeight = tablePanel.ActualHeight - headerPanel.ActualHeight;
            double areaWidth  = tablePanel.ActualWidth;

            GridLength gl       = (GridLength)primaryColumns[descriptionColumnIndex];
            double     colWidth = getDescColumnWidth(areaWidth);

            String hstr2 = CUtil.FormatNumber(areaHeight.ToString());
            String wstr2 = CUtil.FormatNumber(colWidth.ToString());

            if (!hstr1.Equals(hstr2) || !wstr1.Equals(wstr2))
            {
                rptConfig.SetConfigValue("PrevItemWidth", colWidth.ToString(), "double", "");
                rptConfig.SetConfigValue("PrevAreaHeight", areaHeight.ToString(), "double", "");
                CReportConfigs.SaveReportConfig(null, rptConfig);

                CHelper.ShowErorMessage("", "ERROR_PREVIEW_AGAIN", null);
            }
        }
        public override MReportConfig CreateDefaultConfigValues()
        {
            MReportConfig rc = new MReportConfig(new Wis.WsClientAPI.CTable(""));

            rc.SetConfigValue("DocumentTypeThai", "ใบสั่งซื้อ / PURCHASE ORDER", "String", "Document Type Thai");
            rc.SetConfigValue("DocumentTypeEng", "PURCHASE ORDER", "String", "Document Type Eng");

            populateDefaultReportConfig(rc);

            return(rc);
        }
Example #3
0
        public override MReportConfig CreateDefaultConfigValues()
        {
            MReportConfig rc = new MReportConfig(new Wis.WsClientAPI.CTable(""));

            rc.SetConfigValue("DocumentTypeThai", "QUOTATION", "String", "Document Type Thai");
            rc.SetConfigValue("DocumentTypeEng", "QUOTATION", "String", "Document Type Eng");

            populateDefaultReportConfig(rc);

            return(rc);
        }
        public override MReportConfig CreateDefaultConfigValues()
        {
            MReportConfig rc = new MReportConfig(new Wis.WsClientAPI.CTable(""));

            rc.SetConfigValue("DocumentTypeThai", "ใบเสร็จรับเงิน", "String", "Document Type Thai");
            rc.SetConfigValue("DocumentTypeEng", "OFFICIAL RECEIPT", "String", "Document Type Eng");

            populateDefaultReportConfig(rc);

            return(rc);
        }
Example #5
0
        public override MReportConfig CreateDefaultConfigValues()
        {
            MReportConfig rc = new MReportConfig(new Wis.WsClientAPI.CTable(""));

            rc.SetConfigValue("DocumentTypeThai", "ใบสำคัญรับ", "String", "Document Type Thai");
            rc.SetConfigValue("DocumentTypeEng", "RECEIVE VOUCHER", "String", "Document Type Eng");

            populateDefaultReportConfig(rc);

            return(rc);
        }
        public override MReportConfig CreateDefaultConfigValues()
        {
            MReportConfig rc = new MReportConfig(new Wis.WsClientAPI.CTable(""));

            rc.SetConfigValue("DocumentTypeThai", "ใบยืมพัสดุ", "String", "Document Type Thai");
            rc.SetConfigValue("DocumentTypeEng", "INVENTORY BORROW DOCUMENT", "String", "Document Type Eng");

            populateDefaultReportConfig(rc);

            return(rc);
        }
        public override MReportConfig CreateDefaultConfigValues()
        {
            MReportConfig rc = new MReportConfig(new Wis.WsClientAPI.CTable(""));

            rc.SetConfigValue("DocumentTypeThai", "ใบแจ้งหนี้/ใบกำกับภาษี", "String", "Document Type Thai");
            rc.SetConfigValue("DocumentTypeEng", "DELIVERY ORDER/TAX INVOICE", "String", "Document Type Eng");

            populateDefaultReportConfig(rc);

            return(rc);
        }
        public override MReportConfig CreateDefaultConfigValues()
        {
            MReportConfig rc = new MReportConfig(new Wis.WsClientAPI.CTable(""));

            rc.SetConfigValue("DocumentTypeThai", "ใบกำกับภาษี / ใบเสร็จ", "String", "Document Type Thai");
            rc.SetConfigValue("DocumentTypeEng", "TAX INVOICE / RECEIPT", "String", "Document Type Eng");

            populateDefaultReportConfig(rc);

            return(rc);
        }
Example #9
0
        public override MReportConfig CreateDefaultConfigValues()
        {
            MReportConfig rc = new MReportConfig(new Wis.WsClientAPI.CTable(""));

            rc.SetConfigValue("DocumentTypeThai", "ใบแจ้งเงินเดือน", "String", "Document Type Thai");
            rc.SetConfigValue("DocumentTypeEng", "Payroll Slip", "String", "Document Type Eng");

            rc.SetConfigValue("Filler1Height", "10", "String", "Heigh of top space filler");
            rc.SetConfigValue("Filler2Height", "10", "String", "Heigh of area above tax ID");
            rc.SetConfigValue("Filler3Height", "0", "String", "Heigh of area below tax ID");

            populateDefaultReportConfig(rc);

            return(rc);
        }
Example #10
0
        public override MReportConfig CreateDefaultConfigValues()
        {
            MReportConfig rc = new MReportConfig(new Wis.WsClientAPI.CTable(""));

            rc.SetConfigValue("FontSize", "18", "double", "Font Size");
            rc.SetConfigValue("FontName", "AngsanaUPC", "String", "Font Name");
            rc.SetConfigValue("LineWidth", "300", "double", "Line Length");
            rc.SetConfigValue("CustomerBoxWidth", "450", "double", "Customer box Length");
            rc.SetConfigValue("AddressBoxWidth", "450", "double", "Address box Length");
            rc.SetConfigValue("Language", "TH", "String", "Language");

            rc.SetConfigValue("ItemPerPage", "22", "int", "Item per pages");

            rc.SetConfigValue("HeaderTextSize", "17", "int", "Table header text size");
            rc.SetConfigValue("TopHeaderTextSize", "22", "int", "Top most header text size");
            rc.SetConfigValue("BottomLeftBoxWidth", "320", "int", "Bottom Left Box Width");
            rc.SetConfigValue("BottomBoxHeight", "160", "int", "Bottom Box Height");

            //Custom A4 form Height="29.7cm" Width="21cm"
            rc.SetConfigValue("PageWidthCm", "21", "double", "Page Width (CM)");
            rc.SetConfigValue("PageHeightCm", "29.7", "double", "Page Height (CM)");

            rc.SetConfigValue("MarginLeftCm", "0.54", "double", "Margin Left (CM)");
            rc.SetConfigValue("MarginTopCm", "0.54", "double", "Margin Top (CM)");
            rc.SetConfigValue("MarginRightCm", "0.54", "double", "Margin Right (CM)");
            rc.SetConfigValue("MarginBottomCm", "0.54", "double", "Margin Bottom (CM)");

            rc.SetConfigValue("IsCopyReport", "Y", "String", "Is Copy Report?");
            rc.SetConfigValue("HowManyIssue", "4", "int", "How many issue?");
            rc.SetConfigValue("Issue1", "", "String", "Issue 1");
            rc.SetConfigValue("Issue2", "", "String", "Issue 2");
            rc.SetConfigValue("Issue3", "", "String", "Issue 3");
            rc.SetConfigValue("Issue4", "", "String", "Issue 4");
            rc.SetConfigValue("DisplayNamePrefixFlag", "Y", "String", "Y - to show company prefix, N - not show");

            return(rc);
        }
        public override MReportConfig CreateDefaultConfigValues()
        {
            MReportConfig rc = new MReportConfig(new Wis.WsClientAPI.CTable(""));

            rc.SetConfigValue("DocumentTypeThai", "ใบเบิกสินค้าคงคลัง", "String", "Document Type Thai");
            rc.SetConfigValue("DocumentTypeEng", "Inventory Export", "String", "Document Type Eng");
            rc.SetConfigValue("FontSize", "18", "double", "Font Size");
            rc.SetConfigValue("FontName", "AngsanaUPC", "String", "Font Name");
            rc.SetConfigValue("LineWidth", "200", "double", "Line Length");
            rc.SetConfigValue("CustomerBoxWidth", "450", "double", "Customer box Length");
            rc.SetConfigValue("AddressBoxWidth", "450", "double", "Address box Length");
            rc.SetConfigValue("Language", "TH", "String", "Language");
            rc.SetConfigValue("DisplayLogoFlag", "Y", "Boolean", "Y=Show, N=Hide");
            rc.SetConfigValue("DisplayNamePrefixFlag", "Y", "Boolean", "Y=Show, N=Hide");
            rc.SetConfigValue("DisplayItemCodeFlag", "N", "Boolean", "Y=Show, N=Hide");
            rc.SetConfigValue("DisplayBranchFlag", "N", "Boolean", "Y=Show, N=Hide");
            rc.SetConfigValue("DisplayShadowFlag", "Y", "Boolean", "Y=Show, N=Hide");

            rc.SetConfigValue("ItemPerPage", "22", "int", "Item per pages");

            //Custom A4 form Height="29.7cm" Width="21cm"
            rc.SetConfigValue("PageWidthCm", "21", "double", "Page Width (CM)");
            rc.SetConfigValue("PageHeightCm", "29.7", "double", "Page Height (CM)");

            rc.SetConfigValue("MarginLeftCm", "0.54", "double", "Margin Left (CM)");
            rc.SetConfigValue("MarginTopCm", "0.54", "double", "Margin Top (CM)");
            rc.SetConfigValue("MarginRightCm", "0.54", "double", "Margin Right (CM)");
            rc.SetConfigValue("MarginBottomCm", "0.54", "double", "Margin Bottom (CM)");

            return(rc);
        }
Example #12
0
        public override MReportConfig CreateDefaultConfigValues()
        {
            MReportConfig rc = new MReportConfig(new Wis.WsClientAPI.CTable(""));

            rc.SetConfigValue("FontSize", "16", "double", "Font Size");
            rc.SetConfigValue("FontName", "AngsanaUPC", "String", "Font Name");
            rc.SetConfigValue("Language", "TH", "String", "Language");

            //Custom Cheque form Height="9cm" Width="17.5cm" Tanachat Bank Cheque
            rc.SetConfigValue("PageWidthCm", "18", "double", "Page Width (CM)");
            rc.SetConfigValue("PageHeightCm", "9", "double", "Page Height (CM)");

            rc.SetConfigValue("MarginLeftCm", "0", "double", "Margin Left (CM)");
            rc.SetConfigValue("MarginTopCm", "0", "double", "Margin Top (CM)");
            rc.SetConfigValue("MarginRightCm", "0", "double", "Margin Right (CM)");
            rc.SetConfigValue("MarginBottomCm", "0", "double", "Margin Bottom (CM)");

            rc.SetConfigValue("PositionChequeDateFmt", "500,10", "String", "ChequeDateFmt Position");
            rc.SetConfigValue("PositionCompany", "100,10", "String", "Company Position");
            rc.SetConfigValue("PositionPayeeName", "100,70", "String", "PayeeName Position");
            rc.SetConfigValue("PositionNumberAsText", "120,100", "String", "NumberAsText Position");
            rc.SetConfigValue("PositionChequeAmountFmt", "500,120", "String", "ChequeAmountFmt Position");
            rc.SetConfigValue("PositionAcPayeeOnly", "80,40", "String", "AcPayeeOnly Position");
            rc.SetConfigValue("PositionHolderMask", "300,70", "String", "Holder Mask Position");
            rc.SetConfigValue("MaskingText", "######", "String", "Masking Text");

            rc.SetConfigValue("IsAcPayeeOnlyText", "A/C PAYEE ONLY", "String", "IsAcPayeeOnly Text");

            return(rc);
        }
Example #13
0
        protected void populateDefaultReportConfig(MReportConfig rc)
        {
            rc.SetConfigValue("FontSize", "18", "double", "Font Size");
            rc.SetConfigValue("FontName", "AngsanaUPC", "String", "Font Name");
            rc.SetConfigValue("LineWidth", "300", "double", "Line Length");
            rc.SetConfigValue("CustomerBoxWidth", "450", "double", "Customer box Length");
            rc.SetConfigValue("AddressBoxWidth", "450", "double", "Address box Length");
            rc.SetConfigValue("Language", "TH", "String", "Language");
            rc.SetConfigValue("DisplayLogoFlag", "Y", "Boolean", "Y=Show, N=Hide");
            rc.SetConfigValue("DisplayNamePrefixFlag", "Y", "Boolean", "Y=Show, N=Hide");
            rc.SetConfigValue("DisplayItemCodeFlag", "N", "Boolean", "Y=Show, N=Hide");
            rc.SetConfigValue("DisplayBranchFlag", "N", "Boolean", "Y=Show, N=Hide");
            rc.SetConfigValue("DisplayShadowFlag", "Y", "Boolean", "Y=Show, N=Hide");
            rc.SetConfigValue("CustomerBoxHeight", "150", "double", "Customer box Height");

            rc.SetConfigValue("ItemPerPage", "22", "int", "Item per pages");
            rc.SetConfigValue("WrapFlag", "N", "String", "Y=Wrap, N=No wrap");
            rc.SetConfigValue("ItemRowHeight", "30", "double", "Item row heignt in case WrapFlag = N");

            //Custom A4 form Height="29.7cm" Width="21cm"
            rc.SetConfigValue("PageWidthCm", "21", "double", "Page Width (CM)");
            rc.SetConfigValue("PageHeightCm", "29.7", "double", "Page Height (CM)");

            rc.SetConfigValue("MarginLeftCm", "0.54", "double", "Margin Left (CM)");
            rc.SetConfigValue("MarginTopCm", "0.54", "double", "Margin Top (CM)");
            rc.SetConfigValue("MarginRightCm", "0.54", "double", "Margin Right (CM)");
            rc.SetConfigValue("MarginBottomCm", "0.54", "double", "Margin Bottom (CM)");
        }
        public override MReportConfig CreateDefaultConfigValues()
        {
            MReportConfig rc = new MReportConfig(new Wis.WsClientAPI.CTable(""));

            rc.SetConfigValue("DocumentTypeThai", "ใบฝากเงินเพื่อเข้าบัญชีเงินเดือน", "String", "Document Type Thai");
            rc.SetConfigValue("DocumentTypeEng", "Payroll Deposit Slip", "String", "Document Type Eng");

            rc.SetConfigValue("FontSize", "10", "double", "Font Size");
            rc.SetConfigValue("FontName", "AngsanaUPC", "String", "Font Name");

            rc.SetConfigValue("PageWidthCm", "20.70", "double", "Page Width (CM)");
            rc.SetConfigValue("PageHeightCm", "11.20", "double", "Page Height (CM)");
            rc.SetConfigValue("MarginLeftCm", "0.00", "double", "Margin Left (CM)");
            rc.SetConfigValue("MarginTopCm", "0.00", "double", "Margin Top (CM)");
            rc.SetConfigValue("MarginRightCm", "0.00", "double", "Margin Right (CM)");
            rc.SetConfigValue("MarginBottomCm", "0.00", "double", "Margin Bottom (CM)");
            rc.SetConfigValue("Language", "TH", "String", "Language");

            rc.SetConfigValue("Filler1Height", "10", "String", "");
            rc.SetConfigValue("Filler2Height", "20", "String", "");
            rc.SetConfigValue("Filler3Height", "50", "String", "");
            rc.SetConfigValue("Filler4Height", "20", "String", "");
            rc.SetConfigValue("Filler5Height", "60", "String", "");

            rc.SetConfigValue("DisplayGridFlag", "Y", "String", "Y=Display, N=Not display");

            //populateDefaultReportConfig(rc);

            return(rc);
        }
Example #15
0
        private CTable verifyAndConstructObject()
        {
            foreach (CEntry en in entries)
            {
                UIElement elm   = en.ActualUI;
                String    value = "";

                if (en.EntryType == EntryType.ENTRY_DATE_MIN)
                {
                    UDatePicker dt = (UDatePicker)elm;
                    if (dt.SelectedDate == null)
                    {
                        value = "";
                    }
                    else
                    {
                        value = CUtil.DateTimeToDateStringInternalMin((DateTime)dt.SelectedDate);
                    }
                }
                else if (en.EntryType == EntryType.ENTRY_DATE_MAX)
                {
                    UDatePicker dt = (UDatePicker)elm;
                    if (dt.SelectedDate == null)
                    {
                        value = "";
                    }
                    else
                    {
                        value = CUtil.DateTimeToDateStringInternalMax((DateTime)dt.SelectedDate);
                    }
                }
                else if (en.EntryType == EntryType.ENTRY_MONTH_YEAR)
                {
                    UDateEntry dt = (UDateEntry)elm;
                    if (dt.SelectedDate == null)
                    {
                        value = "";
                    }
                    else
                    {
                        value = CUtil.DateTimeToDateStringInternal((DateTime)dt.SelectedDate);
                    }
                }
                else if (en.EntryType == EntryType.ENTRY_TEXT_BOX)
                {
                    TextBox txt = (TextBox)elm;

                    if (!CHelper.ValidateTextBox((Label)en.ActualLabel, txt, en.NullAllowed))
                    {
                        return(null);
                    }

                    value = txt.Text;
                }
                else if (en.EntryType == EntryType.ENTRY_CHECK_BOX)
                {
                    CheckBox cbx = (CheckBox)elm;

                    value = booleanToFlag((Boolean)cbx.IsChecked);
                }
                else if (en.EntryType == EntryType.ENTRY_COMBO_BOX)
                {
                    ComboBox cbo = (ComboBox)elm;

                    if (!CHelper.ValidateComboBox((Label)en.ActualLabel, cbo, en.NullAllowed))
                    {
                        return(null);
                    }

                    MBaseModel v = (MBaseModel)cbo.SelectedItem;
                    value = en.ObjectToIndexFunction(v);
                }

                String fld = en.FieldName;
                rptCfg.SetConfigValue(fld, value, "String", "");
            }

            if (!CHelper.ValidateComboBox(lblPaperType, cboPaperType, false))
            {
                return(null);
            }

            MMasterRef mr = (MMasterRef)cboPaperType.SelectedItem;

            rptCfg.SetConfigValue((String)cboPaperType.Tag, mr.MasterID, "Integer", "");


            if (radPotrait.IsChecked == true)
            {
                rptCfg.SetConfigValue((String)lblPaperType.Tag, (String)radPotrait.Tag, "String", "");
            }
            else if (radLandScape.IsChecked == true)
            {
                rptCfg.SetConfigValue((String)lblPaperType.Tag, (String)radLandScape.Tag, "String", "");
            }

            if (cbxPageRange.IsChecked == true)
            {
                paginator.isPageRange = true;

                if (!CHelper.ValidateTextBox(lblFromPage, txtFromPage, false, InputDataType.InputTypeZeroPossitiveInt))
                {
                    return(null);
                }
                paginator.fromPage = CUtil.StringToInt(txtFromPage.Text);

                if (!CHelper.ValidateTextBox(lblToPage, txtToPage, false, InputDataType.InputTypeZeroPossitiveInt))
                {
                    return(null);
                }
                paginator.toPage = CUtil.StringToInt(txtToPage.Text);

                if (paginator.toPage < paginator.fromPage)
                {
                    CHelper.ShowErorMessage("", "ERROR_PAGE_RANGE", null);
                    txtFromPage.Focus();

                    return(null);
                }
            }

            if (!CHelper.ValidateTextBox(lblMarginLeft, txtLeft, false, InputDataType.InputTypeZeroPossitiveDecimal))
            {
                return(null);
            }
            if (!CHelper.ValidateTextBox(lblMarginTop, txtTop, false, InputDataType.InputTypeZeroPossitiveDecimal))
            {
                return(null);
            }
            if (!CHelper.ValidateTextBox(lblMarginRight, txtRight, false, InputDataType.InputTypeZeroPossitiveDecimal))
            {
                return(null);
            }
            if (!CHelper.ValidateTextBox(lblMarginBottom, txtBottom, false, InputDataType.InputTypeZeroPossitiveDecimal))
            {
                return(null);
            }

            rptCfg.SetConfigValue((String)txtFromPage.Tag, txtFromPage.Text, "String", "");
            rptCfg.SetConfigValue((String)txtToPage.Tag, txtToPage.Text, "String", "");
            rptCfg.SetConfigValue((String)txtLeft.Tag, txtLeft.Text, "String", "");
            rptCfg.SetConfigValue((String)txtTop.Tag, txtTop.Text, "String", "");
            rptCfg.SetConfigValue((String)txtRight.Tag, txtRight.Text, "String", "");
            rptCfg.SetConfigValue((String)txtBottom.Tag, txtBottom.Text, "String", "");
            CUtil.EnableForm(false, this);
            CReportConfigs.SaveReportConfig(null, rptCfg);
            CUtil.EnableForm(true, this);

            CTable tb = rptCfg.GetParamObject();

            return(tb);
        }