Exemplo n.º 1
0
        private void cmdVerify_Click(object sender, RoutedEventArgs e)
        {
            Boolean r = SaveToView();

            if (!r)
            {
                return;
            }

            CUtil.EnableForm(false, this);
            CTable t = OnixWebServiceAPI.VerifyVoidedDoc(vw.GetDbObject().CloneAll());

            CUtil.EnableForm(true, this);

            if (t != null)
            {
                MInventoryDoc ivd = new MInventoryDoc(t);
                ivd.InitErrorItem();
                if (ivd.ErrorItems.Count > 0)
                {
                    WinErrorDetails w = new WinErrorDetails(ivd.ErrorItems, "InventoryDoc");
                    w.Title = CLanguage.getValue("approve_error");
                    w.ShowDialog();
                }
                else
                {
                    String msg = CLanguage.getValue("VERIFY_SUCCESS");
                    CMessageBox.Show(msg, "SUCCESS", MessageBoxButton.OK, MessageBoxImage.Information);
                }
            }
        }
Exemplo n.º 2
0
        public static void ShowErorMessage(String msg, String errcd, CTable param)
        {
            String str = CLanguage.getValue(errcd);
            String fmt = String.Format(str, msg);

            CMessageBox.Show(fmt, "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
        }
Exemplo n.º 3
0
        public static Boolean VerifyVersion()
        {
            String api  = CConfig.APIVersion;
            String prog = CConfig.Version;

            String[] apibuilt  = api.Split('-');
            String[] progbuilt = prog.Split('-');

            String str     = CLanguage.getValue("version_mismatch");
            String strwarn = CLanguage.getValue("version_mismatch_warn");
            String fmt     = String.Format(str, api, prog);
            String fmtwarn = String.Format(strwarn, api, prog);

            if (!apibuilt[0].Equals(progbuilt[0]))
            {
                if (progbuilt[0].Equals("$ONIX_BUILD_LABEL_VAR$"))
                {
                    //Run from source code is allow for version mismatch for the sake of debugging

                    CMessageBox.Show(fmtwarn, "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
                    return(true);
                }

                CMessageBox.Show(fmt, "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
                return(false);
            }

            return(true);
        }
Exemplo n.º 4
0
        private void cmdAdd_Click(object sender, RoutedEventArgs e)
        {
            if (!CHelper.VerifyAccessRight("INVENTORY_ITEM_ADD"))
            {
                return;
            }

            if ((typ == 2) && (cit == null))
            {
                CHelper.ShowErorMessage("", "ERROR_ITEM_ADD_PLS", null);
                return;
            }

            if ((typ == 2) && !cit.ChildCount.Equals("0"))
            {
                CHelper.ShowErorMessage(cit.CategoryName, "ERROR_NOT_LAST_CHILD", null);
                return;
            }

            String        caption = CLanguage.getValue("add") + " " + CLanguage.getValue("inventory_item");
            CWinLoadParam param   = new CWinLoadParam();

            param.Caption           = caption;
            param.GenericType       = cit.ItemCategoryID;
            param.Mode              = "A";
            param.ParentItemSources = itemsSourceGrid;
            Boolean isOK = FactoryWindow.ShowWindow("WinAddEditInventoryItem", param);

            if (isOK)
            {
                rowCount         = rowCount + 1;
                lblTotal.Content = CUtil.FormatInt(rowCount.ToString());
            }
        }
        private Boolean validatePayment()
        {
            int    cnt   = 0;
            double total = 0;

            foreach (MAccountDocPayment pmt in vw.PaymentItems)
            {
                if (pmt.ExtFlag.Equals("D"))
                {
                    continue;
                }

                total = total + CUtil.StringToDouble(pmt.PaidAmount);
                cnt++;
            }

            if (cnt <= 0)
            {
                CMessageBox.Show(CLanguage.getValue("ERROR_NO_PAYMENT"), "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
                return(false);
            }

            double amt = CUtil.StringToDouble(vw.CashReceiptAmt);

            if (total < amt)
            {
                CMessageBox.Show(CLanguage.getValue("ERROR_PAYMENT_NOT_ENOUGH"), "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
                return(false);
            }

            return(true);
        }
Exemplo n.º 6
0
        private static void addReport(ReportGroupEnum grp, String key, String className, CTable dat)
        {
            String prefix = "Onix.ClientCenter.Reports.";
            String fqName = prefix + className;

            MMasterRef mr = new MMasterRef(new CTable(""));

            mr.Code           = key;
            mr.Description    = className;
            mr.DescriptionEng = fqName;
            mr.Optional       = CLanguage.getValue(key);

            ArrayList arr = null;

            if (!reports.ContainsKey(grp))
            {
                arr = new ArrayList();
                reports.Add(grp, arr);
            }
            else
            {
                arr = (ArrayList)reports[grp];
            }

            extends.Add(key, dat);
            arr.Add(mr);

            mr.MasterID = arr.Count.ToString();
        }
Exemplo n.º 7
0
        private void showItemCostHistoryWindow(String langKey)
        {
            String itemID = "";

            MInventoryCurrentBalance h = new MInventoryCurrentBalance(new CTable(""));
            MInventoryItem           t = (MInventoryItem)SelectedObject;

            if (t != null)
            {
                itemID = t.ItemID;
            }

            h.ItemID = itemID;

            Criteria.CCriteriaItemCostHistory cr = new Criteria.CCriteriaItemCostHistory();
            cr.SetActionEnable(false);
            cr.SetDefaultData(h);
            cr.Init("");

            String caption = CLanguage.getValue(langKey);

            WinLookupSearch1 w = new WinLookupSearch1(cr, caption);

            w.ShowDialog();
        }
Exemplo n.º 8
0
        private void cmdAdd_Click(object sender, RoutedEventArgs e)
        {
            if (!CHelper.VerifyAccessRight("GENERAL_MASTER_ADD"))
            {
                return;
            }

            Boolean result = CHelper.ValidateComboBox(lbl, cbo, false);

            if (!result)
            {
                return;
            }

            MMasterRef v = (MMasterRef)cbo.SelectedItem;

            String        caption = CLanguage.getValue("add");
            CWinLoadParam param   = new CWinLoadParam();

            param.Caption           = caption;
            param.GenericType       = v.MasterID;
            param.Mode              = "A";
            param.ParentItemSources = (ObservableCollection <MBaseModel>)lsvMain.ItemsSource;
            Boolean isOK = FactoryWindow.ShowWindow("WinAddEditMasterRef", param);

            if (isOK)
            {
                refreshMasterRef();
                rowCount = rowCount + 1;
                //lblTotal.Content = CUtil.FormatInt(rowCount.ToString());
            }
        }
Exemplo n.º 9
0
        private void showEditWindow()
        {
            if (!CHelper.VerifyAccessRight("GENERAL_MASTER_VIEW"))
            {
                return;
            }

            String        caption = CLanguage.getValue("edit");
            CWinLoadParam param   = new CWinLoadParam();

            param.Caption     = caption;
            param.GenericType = (currentViewObj as MMasterRef).RefType;
            param.Mode        = "E";
            param.ActualView  = currentViewObj;
            Boolean isOK = FactoryWindow.ShowWindow("WinAddEditMasterRef", param);

            if (isOK)
            {
                refreshMasterRef();
                rowCount = rowCount + 1;
                //lblTotal.Content = CUtil.FormatInt(rowCount.ToString());
            }

            refreshMasterRef();
        }
Exemplo n.º 10
0
        private void cmdTest_Click(object sender, RoutedEventArgs e)
        {
            WinPackageTest w = new WinPackageTest(vw, billSim, CLanguage.getValue("test"));

            w.ShowDialog();
            billSim = w.BillSimulate;
        }
Exemplo n.º 11
0
        private void cmdAdd_Click(object sender, RoutedEventArgs e)
        {
            if (!CHelper.VerifyAccessRight("HR_OT_ADD"))
            {
                return;
            }

            MenuItem      mnu   = (MenuItem)sender;
            CWinLoadParam param = new CWinLoadParam();

            if (mnu.Name.Equals("mnuDaily"))
            {
                param.Caption           = CLanguage.getValue("add") + " " + CLanguage.getValue("hr_ot_form");
                param.Mode              = "A";
                param.GenericType       = "1";
                param.ParentItemSources = itemSources;
                FactoryWindow.ShowWindow("WinAddEditOtDoc", param);
            }
            else if (mnu.Name.Equals("mnuMonthly"))
            {
                param.Caption           = CLanguage.getValue("add") + " " + CLanguage.getValue("hr_ot_form");
                param.Mode              = "A";
                param.GenericType       = "2";
                param.ParentItemSources = itemSources;
                FactoryWindow.ShowWindow("WinAddEditOtDoc", param);
            }
        }
Exemplo n.º 12
0
        private void AddOrEdit_Click(String mode)
        {
            TabItem ti   = (TabItem)tabMain.SelectedItem;
            String  name = (String)ti.Tag;
            String  gid  = getPackageGroupByTag(name);

            CCriteriaPromotion cr = new CCriteriaPromotion();

            cr.SetActionEnable(false);
            cr.Init(gid);



            WinLookupSearch2 w = new WinLookupSearch2(cr, CLanguage.getValue(name));

            w.ShowDialog();

            MCompanyPackage v = new MCompanyPackage(new CTable(""));

            if (vw != null)
            {
                vw.PackageGroup = gid;
                v.SetDbObject(vw.GetDbObject().Clone());
            }

            if (w.IsOK)
            {
                vw.Addtems(name, (MCompanyPackage)v, (MPackage)w.ReturnedObj);
                vw.IsModified = true;
            }
        }
Exemplo n.º 13
0
        private void cmdAdd_Click(object sender, RoutedEventArgs e)
        {
            if (!CHelper.VerifyAccessRight(getPermissionKey("A", eType)))
            {
                return;
            }

            if (eType.Equals("1"))
            {
                String        caption = CLanguage.getValue("add") + " " + CLanguage.getValue("sale_customer");
                CWinLoadParam param   = new CWinLoadParam();

                param.Caption           = caption;
                param.Mode              = "A";
                param.ParentItemSources = itemSources;
                FactoryWindow.ShowWindow("WinAddEditCustomer", param);
            }
            else
            {
                String        caption = CLanguage.getValue("add") + " " + CLanguage.getValue("purchase_supplier");
                CWinLoadParam param   = new CWinLoadParam();

                param.Caption           = caption;
                param.Mode              = "A";
                param.ParentItemSources = itemSources;
                FactoryWindow.ShowWindow("WinAddEditSupplier", param);
            }
        }
Exemplo n.º 14
0
        private void showEditWindow()
        {
            if (!CHelper.VerifyAccessRight(getPermissionKey("V", eType)))
            {
                return;
            }

            if (eType.Equals("1"))
            {
                String        caption = CLanguage.getValue("edit") + " " + CLanguage.getValue("sale_customer");
                CWinLoadParam param   = new CWinLoadParam();

                param.Caption           = caption;
                param.Mode              = "E";
                param.ActualView        = currentObj;
                param.ParentItemSources = itemSources;
                FactoryWindow.ShowWindow("WinAddEditCustomer", param);
            }
            else
            {
                String        caption = CLanguage.getValue("edit") + " " + CLanguage.getValue("purchase_supplier");
                CWinLoadParam param   = new CWinLoadParam();

                param.Caption           = caption;
                param.Mode              = "E";
                param.ActualView        = currentObj;
                param.ParentItemSources = itemSources;
                FactoryWindow.ShowWindow("WinAddEditSupplier", param);
            }
        }
Exemplo n.º 15
0
        private Boolean validateReceiptItem()
        {
            int idx = 0;

            foreach (MAccountDocDeposit rcp in vw.DepositItems)
            {
                if (rcp.ExtFlag.Equals("D"))
                {
                    continue;
                }

                idx++;
                if (rcp.Note.Trim().Equals(""))
                {
                    CHelper.ShowErorMessage(idx.ToString(), "ERROR_SELECTION_TYPE", null);
                    return(false);
                }

                if (CUtil.StringToDouble(rcp.DepositAmt) <= 0)
                {
                    CHelper.ShowErorMessage(idx.ToString(), "ERROR_SELECTION_TYPE", null);
                    return(false);
                }
            }

            if (CUtil.StringToDouble(vw.CashReceiptAmt) < 0)
            {
                //Equal zero is fine
                CMessageBox.Show(CLanguage.getValue("ERROR_RECEIPT_AMOUNT"), "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
                return(false);
            }

            return(true);
        }
        private void cmdAddProduct_Click(object sender, RoutedEventArgs e)
        {
            Boolean result = CHelper.ValidateLookup(lblCustomer, uCustomer, false);

            if (!result)
            {
                return;
            }

            populateExcludeDocSet();

            CCriteriaBillSummaryItem cr = new Criteria.CCriteriaBillSummaryItem();

            cr.SetActionEnable(false);
            cr.SetDefaultData(vw);
            cr.Init("1");

            WinMultiSelection w = new WinMultiSelection(cr, CLanguage.getValue("bill_summary_item"));

            w.ShowDialog();

            if (w.IsOK)
            {
                vw.AddAccountDocReceipts(convertToReceiptItem(w.SelectedItems));
                calculateReceiptTotal();
                vw.IsModified = true;
            }
        }
Exemplo n.º 17
0
        private void cmdTest_Click(object sender, RoutedEventArgs e)
        {
            OnixConnectionXML dbos = new OnixConnectionXML(txtDesc.Password, url, "pemgail9uzpgzl88");

            String sendString = "HELLOWORLD";

            CTable t = new CTable("");

            t.SetFieldValue("ECHO_MESSAGE", sendString);
            CUtil.EnableForm(false, this);
            CTable echo = OnixWebServiceAPI.TestServer(dbos, t);

            CUtil.EnableForm(true, this);

            if (echo == null)
            {
                CMessageBox.Show(OnixWebServiceAPI.GetLastErrorDescription(), "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                String returnStr = echo.GetFieldValue("RETURN_MESSAGE");
                if (sendString.Equals(returnStr))
                {
                    CMessageBox.Show(CLanguage.getValue("connect_success"), "SUCCESS", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else
                {
                    CMessageBox.Show(CLanguage.getValue("connect_fail"), "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Exemplo n.º 18
0
        private void showEditWindow()
        {
            if (!CHelper.VerifyAccessRight("CASH_XFER_VIEW"))
            {
                return;
            }

            MCashDocXfer v = (MCashDocXfer)currentObj;

            String winName = "WinAddEditCashExternalXfer";

            if (v.CashXferType.Equals("1"))
            {
                winName = "WinAddEditCashTransfer";
            }

            String caption = CLanguage.getValue("edit") + " " + CLanguage.getValue("Trans");

            CWinLoadParam param = new CWinLoadParam();

            param.Caption           = caption;
            param.GenericType       = ((int)docType).ToString();
            param.Mode              = "E";
            param.ParentItemSources = itemSources;
            param.ActualView        = currentObj;
            FactoryWindow.ShowWindow(winName, param);
        }
Exemplo n.º 19
0
        private void showSalePurchaseHistoryWindow(String category, String selectType, String langKey)
        {
            MSalePurchaseHistory h = new MSalePurchaseHistory(new CTable(""));

            if (selectType.Equals("2"))
            {
                h.ItemCode = this.txtCode.Text;
            }
            else
            {
                //1=Service
                h.ServiceCode = this.txtCode.Text;
            }
            h.Category      = category;
            h.SelectionType = selectType;

            //ObservableCollection<MBaseModel> arr = new ObservableCollection<MBaseModel>();

            Criteria.CCriteriaSalePurchaseHistory cr = new Criteria.CCriteriaSalePurchaseHistory();
            cr.SetActionEnable(false);
            cr.SetDefaultData(h);
            cr.Init(category);

            String caption = CLanguage.getValue(langKey);

            WinLookupSearch1 w = new WinLookupSearch1(cr, caption);

            w.ShowDialog();
        }
        private void manipulateRow(CTable o)
        {
            string code       = "";
            string name       = "";
            string typeName   = "";
            string selectType = o.GetFieldValue("SELECTION_TYPE");

            if (selectType.Equals("2"))
            {
                code     = o.GetFieldValue("ITEM_CODE");
                name     = o.GetFieldValue("ITEM_NAME_THAI");
                typeName = CLanguage.getValue("item");
            }
            else if (selectType.Equals("1"))
            {
                code     = o.GetFieldValue("SERVICE_CODE");
                name     = o.GetFieldValue("SERVICE_NAME");
                typeName = CLanguage.getValue("service");
            }
            else
            {
                code     = CLanguage.getValue("free_text");
                name     = o.GetFieldValue("FREE_TEXT");
                typeName = code;
            }

            o.SetFieldValue("SELECTION_TYPE_NAME", typeName);
            o.SetFieldValue("DISPLAY_CODE", code);
            o.SetFieldValue("DISPLAY_NAME", name);
        }
Exemplo n.º 21
0
        private void cmdAdd_Click(object sender, RoutedEventArgs e)
        {
            String caption = ItemText;

            if (dt == InventoryDocumentType.InvDocBorrow)
            {
                CWinLoadParam param = new CWinLoadParam();

                param.Caption          = (String)(sender as Button).Content + " " + caption;
                param.Mode             = "A";
                param.ActualParentView = mv;
                param.ActualView       = currentViewObj;
                param.GenericType      = loadParam.GenericType;

                vw.IsModified = FactoryWindow.ShowWindow("WinAddEditBorrowReturnItem", param);
            }
            else if (dt == InventoryDocumentType.InvDocReturn)
            {
                CCriteriaBorrowItem cr = new CCriteriaBorrowItem();
                cr.SetActionEnable(false);
                cr.SetDefaultData(vw);
                cr.Init("");

                WinMultiSelection w = new WinMultiSelection(cr, CLanguage.getValue("borrow_return_item"));
                w.ShowDialog();

                if (w.IsOK)
                {
                    addReturnDocItems(w.SelectedItems);
                    vw.IsModified = true;
                }
            }
        }
Exemplo n.º 22
0
        private void mnuMasterRefAdd_Click(object sender, RoutedEventArgs e)
        {
            CComboConfig cfg = (CComboConfig)comboTypeConfigs[ComboLoadType];
            ObservableCollection <MBaseModel> arr = new ObservableCollection <MBaseModel>();
            MasterRefEnum rt = (MasterRefEnum)int.Parse(cfg.Type);

            //WinAddEditMasterRef w = new WinAddEditMasterRef(rt);
            //w.Caption = (String)(sender as MenuItem).Header + " " + Caption;
            //w.SetMasterRefType(rt);
            //w.Mode = "A";
            //w.ParentItemSource = arr;
            //w.ShowDialog();

            String        caption = CLanguage.getValue("add") + " " + Caption;
            CWinLoadParam param   = new CWinLoadParam();

            param.Caption           = caption;
            param.GenericType       = cfg.Type;
            param.Mode              = "A";
            param.ParentItemSources = arr;
            Boolean isOK = FactoryWindow.ShowWindow("WinAddEditMasterRef", param);

            if (isOK)
            {
                CMasterReference.LoadAllMasterRefItems(OnixWebServiceAPI.GetAllMasterRefList, rt);
            }
        }
Exemplo n.º 23
0
        public ObservableCollection <MBaseModel> GetSortableColumns()
        {
            ObservableCollection <MBaseModel> items = new ObservableCollection <MBaseModel>();
            ArrayList arr = new ArrayList();

            int idx = 0;

            foreach (CCriteriaColumnBase cc in gridColumns)
            {
                if (cc.Sortable)
                {
                    MCriteriaColumn mc = new MCriteriaColumn();
                    mc.ColumnName           = cc.ColumnName;
                    mc.ColumnText           = CLanguage.getValue(cc.ColumnCaptionKey);
                    mc.ColumnKey            = cc.ColumnCaptionKey;
                    mc.SortingOrderBy       = getSettingValue(mc.ColumnName, "SortingOrderBy", "ASC");
                    mc.IsUsedForSortingFlag = getSettingValue(mc.ColumnName, "IsUsedForSortingFlag", "N");
                    mc.ItemSeqNo            = getSettingValue(mc.ColumnName, "ItemSeqNo", idx.ToString());

                    arr.Add(mc);
                }

                idx++;
            }

            //Sort by ItemSeqNo here
            arr.Sort(new SortableColumnComparator());

            foreach (MCriteriaColumn cc in arr)
            {
                items.Add(cc);
            }

            return(items);
        }
Exemplo n.º 24
0
        protected ArrayList displayTotalTexts(String group, ArrayList accum, int idx, String key)
        {
            ArrayList arr   = (ArrayList)reportConfigHash[group];
            ArrayList temps = new ArrayList();

            int i = 0;

            foreach (CReportColConfig rc in arr)
            {
                if (i == idx)
                {
                    temps.Add(CLanguage.getValue(key));
                }
                else if (rc.IsSum)
                {
                    String tmp = "";
                    if (accum.Count > 0)
                    {
                        tmp = CUtil.FormatNumber(accum[i].ToString());
                    }

                    temps.Add(tmp);
                }
                else
                {
                    temps.Add("");
                }

                i++;
            }

            return(temps);
        }
        private void cmdVerify_Click(object sender, RoutedEventArgs e)
        {
            Boolean r = SaveToView();

            if (!r)
            {
                return;
            }

            CUtil.EnableForm(false, this);
            vw.DocumentType = ((int)dt).ToString();
            CTable t = verifyAccountDocWrapper();

            CUtil.EnableForm(true, this);
            if (t != null)
            {
                MInventoryDoc ivd = new MInventoryDoc(t);
                ivd.InitErrorItem();
                if (ivd.ErrorItems.Count > 0)
                {
                    WinErrorDetails w = new WinErrorDetails(ivd.ErrorItems, "InventoryDoc");
                    w.Title = CLanguage.getValue("approve_error");
                    w.ShowDialog();
                }
                else
                {
                    String msg = CLanguage.getValue("VERIFY_SUCCESS");
                    CMessageBox.Show(msg, "SUCCESS", MessageBoxButton.OK, MessageBoxImage.Information);
                }
            }
        }
        private void constructMenuItems(Button btn)
        {
            MAuxilaryDocSubItem adi        = (MAuxilaryDocSubItem)btn.Tag;
            ContextMenu         btnContext = new ContextMenu();

            MenuItem mi1 = new MenuItem();

            mi1.Name   = "mnuAdd";
            mi1.Tag    = adi;
            mi1.Click += mnuAdd_Click;
            mi1.Header = CLanguage.getValue("add");

            MenuItem mi2 = new MenuItem();

            mi2.Name   = "mnuDelete";
            mi2.Tag    = adi;
            mi2.Click += mnuDelete_Click;
            mi2.Header = CLanguage.getValue("delete");

            btnContext.Items.Add(mi1);
            btnContext.Items.Add(new Separator());
            btnContext.Items.Add(mi2);

            btn.ContextMenu = btnContext;
        }
Exemplo n.º 27
0
        public static Boolean ValidateComboBox(Label lbl, UComboBox cb, Boolean AllowEmpty)
        {
            String lb = "";

            if (lbl != null)
            {
                lb = lbl.Content.ToString();
            }

            String str = CLanguage.getValue("ERROR_TEXT_VALIDATE");
            String fmt = String.Format(str, lbl.Content);

            if (cb.IsEnabled)
            {
                if (AllowEmpty)
                {
                    return(true);
                }

                if ((cb.SelectedObject == null) || (cb.IsEmpty()))
                {
                    CMessageBox.Show(fmt, "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
                    cb.Focus();
                    return(false);
                }
            }

            return(true);
        }
        private Boolean validateReceiptItem()
        {
            foreach (MAccountDocReceipt rcp in vw.ReceiptItems)
            {
                if (rcp.ExtFlag.Equals("D"))
                {
                    continue;
                }

                if (!vw.EntityId.Equals(rcp.EntityID))
                {
                    CMessageBox.Show(CLanguage.getValue("ERROR_INVALID_ENTITY") + " " + rcp.DocumentNo, "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
                    return(false);
                }
            }

            if (CUtil.StringToDouble(vw.CashReceiptAmt) < 0)
            {
                //Equal zero is fine
                CMessageBox.Show(CLanguage.getValue("ERROR_RECEIPT_AMOUNT"), "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
                return(false);
            }

            return(true);
        }
Exemplo n.º 29
0
        public static void ShowKeyExist(Label lbl, ComboBox tb)
        {
            String str = CLanguage.getValue("ERROR_DUPLICATE_KEY");
            String fmt = String.Format(str, lbl.Content, tb.Text);

            CMessageBox.Show(fmt, "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
        }
Exemplo n.º 30
0
        private void cmdAddMenu_Click(object sender, RoutedEventArgs e)
        {
            String name = (sender as MenuItem).Name;

            String qtype = "1";

            if (name.Equals("mnuDetail"))
            {
                qtype = "2";
            }

            String caption = (sender as MenuItem).Header.ToString();

            if (!CHelper.VerifyAccessRight("SALE_QUOTATION_ADD"))
            {
                return;
            }

            WinAddEditQuotation w = new WinAddEditQuotation("A", itemSources, null, docType, qtype);

            w.Caption = CLanguage.getValue("add") + " " + caption;
            w.ShowDialog();
            if (w.IsPreviewNeed)
            {
                WinFormPrinting wp = new WinFormPrinting("grpPurchasePO", getDocumentObject(w.CreatedID));
                wp.ShowDialog();
            }
        }