private void cmdCheque_Click(object sender, RoutedEventArgs e)
        {
            Boolean result = CHelper.ValidateLookup(lblSupplier, uSupplier, false);

            if (!result)
            {
                return;
            }

            if (vw.ChequeID.Equals(""))
            {
                ObservableCollection <MBaseModel> arr = new ObservableCollection <MBaseModel>();
                CCriteriaCheque.ShowAddChequeWindow("2", arr, vw);

                if (arr.Count > 0)
                {
                    MCheque cq = (MCheque)arr[0];
                    vw.ChequeID   = cq.ChequeID;
                    vw.ChequeNo   = cq.ChequeNo;
                    vw.IsModified = true;
                }
            }
            else
            {
                CCriteriaCheque.ShowEditWindow("2", null, vw);
            }
        }
Example #2
0
        private void mnuContextMenu_Click(object sender, RoutedEventArgs e)
        {
            MenuItem mnu  = (sender as MenuItem);
            string   name = mnu.Name;

            if (name.Equals("mnuEdit"))
            {
                ShowEditWindow(eType, itemSources, currentObj);
            }
            else if (name.Equals("mnuCopy"))
            {
                CUtil.EnableForm(false, ParentControl);

                CTable newobj = OnixWebServiceAPI.CopyCheque(currentObj.GetDbObject());
                if (newobj != null)
                {
                    MCheque ivd = new MCheque(newobj);
                    ItemAddedEvent(ivd, e);
                }
                else
                {
                    //Error here
                    CHelper.ShowErorMessage(OnixWebServiceAPI.GetLastErrorDescription(), "ERROR_USER_ADD", null);
                }

                CUtil.EnableForm(true, ParentControl);
            }
        }
Example #3
0
        private void cmdCheque_Click(object sender, RoutedEventArgs e)
        {
            Boolean result = CHelper.ValidateLookup(lblCustomer, uCustomer, false);

            if (!result)
            {
                return;
            }

            String type = "2";

            if (dt == AccountDocumentType.AcctDocArReceipt)
            {
                type = "1";
            }

            if (vw.ChequeID.Equals(""))
            {
                ObservableCollection <MBaseModel> arr = new ObservableCollection <MBaseModel>();
                CCriteriaCheque.ShowAddChequeWindow(type, arr, vw);

                if (arr.Count > 0)
                {
                    MCheque cq = (MCheque)arr[0];
                    vw.ChequeID   = cq.ChequeID;
                    vw.IsModified = true;
                }
            }
            else
            {
                CCriteriaCheque.ShowEditWindow(type, null, vw);
            }
        }
        private void txtChequeNo_GotFocus(object sender, RoutedEventArgs e)
        {
            if (doc.ChequeID.Equals(""))
            {
                return;
            }

            UTextBox           txt = sender as UTextBox;
            MAccountDocPayment pmt = (MAccountDocPayment)txt.Tag;

            if (pmt.ChequeID.Equals(doc.ChequeID))
            {
                return;
            }

            MCheque cheq = getChequeByID(doc.ChequeID);

            if (cheq == null)
            {
                pmt.ChequeNo   = "";
                pmt.PaidAmount = "0.00";
                pmt.ChequeID   = "";
                pmt.ChequeNo   = "";
            }
            else
            {
                pmt.ChequeNo   = cheq.ChequeNo;
                pmt.BankID     = cheq.ChequeBankID;
                pmt.PaidAmount = cheq.ChequeAmount;
                pmt.ChequeID   = cheq.ChequeID;
            }
        }
Example #5
0
        protected override MBaseModel createObject()
        {
            MCheque av = (MCheque)loadParam.ActualView;

            MCheque mv = new MCheque(new CTable(""));

            mv.CreateDefaultValue();
            mv.ChequeDate = DateTime.Now;
            mv.Direction  = loadParam.GenericType;

            if (av != null)
            {
                //Default value
                mv.EntityObj    = av.EntityObj;
                mv.PayeeName    = av.PayeeName;
                mv.ChequeAmount = av.ChequeAmount;
            }

            mv.IssueDate     = DateTime.Now;
            mv.ChequeDate    = DateTime.Now;
            mv.ChequeStatus  = ((int)InventoryDocumentStatus.InvDocPending).ToString();
            mv.IsAcPayeeOnly = true;
            mv.AllowNegative = CGlobalVariable.IsCashNegativeAllow();

            return(mv);
        }
Example #6
0
        private void CmdCheque_Click(object sender, RoutedEventArgs e)
        {
            MVTaxDocument vm = (MVTaxDocument)vw;
            MAccountDoc   ad = CTaxDocumentUtil.TaxDocToAccountDoc(vm, this);

            if (ad == null)
            {
                return;
            }

            if (vm.ChequeID.Equals(""))
            {
                ad.ArApAmt = vm.WhAmount;

                ObservableCollection <MBaseModel> arr = new ObservableCollection <MBaseModel>();
                CCriteriaCheque.ShowAddChequeWindow("2", arr, ad);

                if (arr.Count > 0)
                {
                    MCheque cq = (MCheque)arr[0];
                    vm.ChequeID   = cq.ChequeID;
                    vm.ChequeNo   = cq.ChequeNo;
                    vm.IsModified = true;
                }
            }
            else
            {
                CCriteriaCheque.ShowEditWindow("2", null, ad);
            }
        }
        private MCheque getChequeByID(String cheqID)
        {
            MCheque cheq = new MCheque(new CTable(""));

            cheq.ChequeID = cheqID;

            CUtil.EnableForm(false, this);
            CTable cq = OnixWebServiceAPI.GetChequeInfo(cheq.GetDbObject());

            CUtil.EnableForm(true, this);
            if (cq == null)
            {
                return(null);
            }

            return(new MCheque(cq));
        }
        private MCheque getCheque(String cheqNo)
        {
            MCheque cheq = new MCheque(new CTable(""));

            cheq.ChequeNo = cheqNo;

            CUtil.EnableForm(false, this);
            ArrayList arr = OnixWebServiceAPI.GetChequeList(cheq.GetDbObject());

            CUtil.EnableForm(true, this);
            if ((arr == null) || (arr.Count <= 0))
            {
                return(null);
            }

            CTable t = (CTable)arr[0];

            return(new MCheque(t));
        }
Example #9
0
        private void cboBank_GotFocus(object sender, RoutedEventArgs e)
        {
            MCheque mv = (MCheque)vw;

            if (loadParam.GenericType.Equals("1"))
            {
                return;
            }

            MMasterRef cb      = mv.ChequeBankObj;
            MMasterRef accBank = mv.BankObj;

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

            bank.MasterID    = cb.MasterID;
            bank.Code        = cb.Code;
            bank.Description = cb.Description;

            mv.BankObj = bank;
        }
        private void txtChequeNo_TextSelected(object sender, EventArgs e)
        {
            UTextBox           txt  = sender as UTextBox;
            MAccountDocPayment pmt  = (MAccountDocPayment)txt.Tag;
            String             code = txt.Text;

            MCheque cheq = getCheque(code);

            if (cheq == null)
            {
                pmt.ChequeNo   = "";
                pmt.PaidAmount = "0.00";
                pmt.ChequeID   = "";
            }
            else
            {
                pmt.BankID     = cheq.ChequeBankID;
                pmt.PaidAmount = cheq.ChequeAmount;
                pmt.ChequeID   = cheq.ChequeID;
            }
        }
Example #11
0
        public UFormChequePayment(MBaseModel model, int page, int totalPage, MReportConfig cfg, CReportPageParam param)
        {
            if (model == null)
            {
                model = new MCheque(new Wis.WsClientAPI.CTable(""));
            }

            dataSource = model;
            pageNo     = page;
            pageCount  = totalPage;
            pageParam  = param;
            rptConfig  = cfg;

            init();

            MCheque ad = (dataSource as MCheque);

            numberTextAmount = ad.ChequeAmountFmt;

            DataContext = model;
            InitializeComponent();
        }
Example #12
0
        public static void ShowEditWindow(String type, ObservableCollection <MBaseModel> items, MBaseModel defDat)
        {
            if (!CHelper.VerifyAccessRight("CASH_CHEQUE_VIEW"))
            {
                return;
            }

            MCheque cheque;

            if ((defDat is MCheque))
            {
                cheque = (MCheque)defDat;
            }
            else
            {
                MAccountDoc ad = (MAccountDoc)defDat;
                cheque          = new MCheque(new CTable(""));
                cheque.ChequeID = ad.ChequeID;
            }

            String        caption = "";
            CWinLoadParam param   = new CWinLoadParam();

            if (type.Equals("1"))
            {
                caption = CLanguage.getValue("edit") + " " + CLanguage.getValue("receivable_cheque");
            }
            else
            {
                caption = CLanguage.getValue("edit") + " " + CLanguage.getValue("payable_cheque");
            }

            param.Caption           = caption;
            param.GenericType       = type;
            param.Mode              = "E";
            param.ActualView        = cheque;
            param.ParentItemSources = items;
            FactoryWindow.ShowWindow("WinAddEditCheque", param);
        }
Example #13
0
        public static void ShowAddChequeWindow(String type, ObservableCollection <MBaseModel> items, MBaseModel defDat)
        {
            MCheque cheque = null;

            if (defDat != null)
            {
                MAccountDoc ad = (MAccountDoc)defDat;
                cheque = new MCheque(new CTable(""));

                cheque.EntityObj = ad.EntityObj;
                cheque.PayeeName = ad.EntityName;
                if (ad.IsPopulateChequeAmt)
                {
                    cheque.ChequeAmount = ad.ArApAmt;
                }

                //Create default value here
            }

            String        caption = "";
            CWinLoadParam param   = new CWinLoadParam();

            if (type.Equals("1"))
            {
                caption = CLanguage.getValue("add") + " " + CLanguage.getValue("receivable_cheque");
            }
            else
            {
                caption = CLanguage.getValue("add") + " " + CLanguage.getValue("payable_cheque");
            }

            param.Caption           = caption;
            param.GenericType       = type;
            param.Mode              = "A";
            param.ActualView        = cheque;
            param.ParentItemSources = items;
            FactoryWindow.ShowWindow("WinAddEditCheque", param);
        }
Example #14
0
        public override Tuple <CTable, ObservableCollection <MBaseModel> > QueryData()
        {
            (model as MCheque).Direction = eType;
            CTable tb = model.GetDbObject();

            items = OnixWebServiceAPI.GetChequeList(tb);
            lastObjectReturned = OnixWebServiceAPI.GetLastObjectReturned();

            itemSources.Clear();
            int idx = 0;

            foreach (CTable o in items)
            {
                MCheque v = new MCheque(o);

                v.RowIndex = idx;
                itemSources.Add(v);
                idx++;
            }

            Tuple <CTable, ObservableCollection <MBaseModel> > tuple = new Tuple <CTable, ObservableCollection <MBaseModel> >(lastObjectReturned, itemSources);

            return(tuple);
        }
        private void getFilterTextFromServer(String key, String text)
        {
            ArrayList arr = null;

            CUtil.EnableForm(false, this);

            if ((nameSpace == TextSearchNameSpace.ApChequeNS) || (nameSpace == TextSearchNameSpace.ArChequeNS))
            {
                MMasterRef bank = extraParam as MMasterRef;

                MCheque cheque = new MCheque(new CTable(""));
                cheque.ChequeNo     = key;
                cheque.BankID       = bank.MasterID;
                cheque.ChequeStatus = "1";

                //cheque.Direction = "1";
                //if (nameSpace == TextSearchNameSpace.ApChequeNS)
                //{
                //    cheque.Direction = "2";
                //}

                arr = OnixWebServiceAPI.GetChequeList(cheque.GetDbObject());
            }
            else if (nameSpace == TextSearchNameSpace.MicroServiceCodeNS)
            {
                MMasterRef mr = new MMasterRef(new CTable(""));
                mr.Code        = key;
                mr.Description = nameSpace.ToString();

                arr = OnixWebServiceAPI.GetListAPI("SassGetSearchTextList", "SEARCH_TEXT_LIST", mr.GetDbObject());
            }
            else
            {
                MMasterRef mr = new MMasterRef(new CTable(""));
                mr.Code        = key;
                mr.Description = nameSpace.ToString();
                mr.RefType     = ((int)mrType).ToString();

                CTable t = mr.GetDbObject();
                arr = OnixWebServiceAPI.GetSearchTextList(t);
            }

            CUtil.EnableForm(true, this);

            if (arr == null)
            {
                return;
            }

            ArrayList filters = new ArrayList();

            foreach (CTable o in arr)
            {
                MMasterRef m;
                if ((nameSpace == TextSearchNameSpace.ApChequeNS) || (nameSpace == TextSearchNameSpace.ArChequeNS))
                {
                    MCheque c = new MCheque(o);
                    m = new MMasterRef(new CTable(""));

                    m.Code           = c.ChequeNo;
                    m.Description    = c.PayeeName;
                    m.DescriptionEng = c.ChequeAmountFmt;
                }
                else
                {
                    m = new MMasterRef(o);
                }

                filters.Add(m);
            }

            dicts.Add(key, filters);
            createFilterArray(text, filters);
        }
Example #16
0
 private void cmdAction_Click(object sender, RoutedEventArgs e)
 {
     currentObj = (MCheque)(sender as UActionButton).Tag;
 }
Example #17
0
 public override void DoubleClickData(MBaseModel m)
 {
     currentObj = (MCheque)m;
     ShowEditWindow(eType, itemSources, currentObj);
 }