예제 #1
0
        public void AddVoucherDetailRow(VoucherDetailModel voucherDetail)
        {
            voucherDetail.RowNumber = CurrentRowNumber;
            CurrentRowNumber++;

            VoucherDetails.Add(voucherDetail);
        }
        private int InsertVoucherDetails(int voucherID)
        {
            int ReturnValue = 0;

            List <VoucherDetails> VoucherDetailsList = new List <VoucherDetails>();

            foreach (GridViewRow TheRow in gView_DebitVoucher.Rows)
            {
                VoucherDetails TheVoucherDetails = new VoucherDetails();
                {
                    TheVoucherDetails.VoucherID = voucherID;

                    if (TheRow.Cells[0].Text != "Cash")
                    {
                        TheVoucherDetails.VoucherAmount    = decimal.Parse(TheRow.Cells[1].Text);
                        TheVoucherDetails.VoucherEntryType = MicroEnums.GetStringValue(MicroEnums.VoucherEntryType.DebitSide);
                    }
                    else
                    {
                        TheVoucherDetails.VoucherAmount    = PageVariables.TotalDebitAmount;
                        TheVoucherDetails.VoucherEntryType = MicroEnums.GetStringValue(MicroEnums.VoucherEntryType.CreditSide);
                    }
                    TheVoucherDetails.AccountLedgerDescription = TheRow.Cells[0].Text;
                }

                VoucherDetailsList.Add(TheVoucherDetails);
            }
            ReturnValue = VoucherManagement.GetInstance.InsertVoucherDetails(VoucherDetailsList);
            return(ReturnValue);
        }
예제 #3
0
        public IEnumerable <VoucherDetails> getvoucherDetailList(string voucherNO)
        {
            //_facct.openConnection();
            DateTime t = DateTime.Now;
            //int top = 7;
            int year       = t.Year;
            int searchfrom = year - 2;
            //getTableName(searchfrom);
            bool table_exist = _facct.IsTableExist(getTableName(searchfrom));

            List <string> tablenames = new List <string>();
            string        command    = string.Empty;

            while (table_exist)
            {
                command += string.Format("SELECT [VRNO],[AMOUNT],[NPRNO],[ICCNO],[COMNO],[CQNO] FROM {0} WHERE VRNO='{1}'", getTableName(searchfrom), voucherNO.Trim());

                //tablenames.Add(getTableName(searchfrom));
                searchfrom++;
                table_exist = _facct.IsTableExist(getTableName(searchfrom));
                if (table_exist)
                {
                    command += " UNION ALL ";
                }
            }

            List <VoucherDetails> vouchlist = new List <VoucherDetails>();

            SqlDataReader allVoucher = _facct.getFromFacct(command);

            while (allVoucher.Read())
            {
                VoucherDetails vouch = new VoucherDetails();
                vouch.voucherNo = Convert.ToString(allVoucher["VRNO"] ?? null);
                vouch.Amount    = Convert.ToDecimal(allVoucher["AMOUNT"] ?? 0);
                vouch.chequno   = Convert.ToString(allVoucher["CQNO"]);
                vouch.NPRNO     = String.Equals(Convert.ToString(allVoucher["NPRNO"]), "ICC") == true ? " " : Convert.ToString(allVoucher["NPRNO"]);
                vouch.ICCNO     = Convert.ToString(allVoucher["ICCNO"]);
                vouchlist.Add(vouch);
            }

            return(vouchlist.ToList());
        }
예제 #4
0
        private void btnGetVoucherInfo_Click(object sender, RoutedEventArgs e)
        {
            string strBarCode         = ucValueCalc.txtDisplay.Text.Trim();
            int    InstallationNumber = 0;
            int    ValidationLength   = 0;
            int    CurrLength         = strBarCode.Trim().Length;

            try
            {
                if (this.ucValueCalc.txtDisplay.Text.Trim().Length > 0)
                {
                    if (strBarCode.Length < 4)
                    {
                        MessageBox.ShowBox("MessageID403", BMC_Icon.Error);
                        return;
                    }
                    if (strBarCode.Length != 18)
                    {
                        LinqDataAccessDataContext            linqDBExchange     = new LinqDataAccessDataContext(CommonDataAccess.ExchangeConnectionString);
                        IEnumerable <InstallationFromTicket> InstallationTicket = linqDBExchange.GetInstallationNumber(strBarCode);

                        if (InstallationTicket != null)
                        {
                            foreach (var item in InstallationTicket)
                            {
                                InstallationNumber = item.installation_no.Value;
                                strBarCode         = item.strbarcode;
                            }

                            DataTable InstallationDetails = (new CommonDataAccess()).GetInstallationDetails(0, InstallationNumber, false, false);
                            if (InstallationDetails.Rows.Count > 0)
                            {
                                int.TryParse(InstallationDetails.Rows[0]["Validation_length"].ToString(), out ValidationLength);
                                if (ValidationLength != CurrLength)
                                {
                                    MessageBox.ShowBox("MessageID403", BMC_Icon.Error);
                                    return;
                                }
                            }
                        }
                        else
                        {
                            MessageBox.ShowBox("MessageID403", BMC_Icon.Error);
                            return;
                        }
                    }

                    VoucherDetails objVoucherDetails = new VoucherDetails(strBarCode);

                    if (objVoucherDetails.IsVoucherFound)
                    {
                        // Window owner = Window.GetWindow(this);
                        objVoucherDetails.ShowDialogEx(this);
                    }
                    else
                    {
                        MessageBox.ShowBox("MessageID213", BMC_Icon.Information);  //Voucher Not Found
                    }
                }
                else
                {
                    MessageBox.ShowBox("MessageID264", BMC_Icon.Information);   //Enter Valid Voucher Bar code
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }
        }
예제 #5
0
 public void AddVoucherDetailRow(VoucherDetail voucherDetail, int rowNumber)
 {
     VoucherDetails.Add(voucherDetail);
     SetRowNumber(rowNumber);
 }