private void LoadData()
        {
            MoneyReceiptsBLL mrBll = new MoneyReceiptsBLL();
            DataTable        dt    = mrBll.GetInvoiceDetailForCrePayment(_InvoiceId, _jobid, _PaymentType);

            txtDate.Text        = DateTime.Now.ToShortDateString();
            txtJobNo.Text       = dt.Rows[0]["JOBNO"].ToString();
            txtJobDate.Text     = Convert.ToDateTime(dt.Rows[0]["JOBDATE"].ToString()).ToString("dd/MM/yyyy");
            txtInvoiceNo.Text   = "";
            txtInvoiceDate.Text = "";
            if (_PaymentType == "C")
            {
                rdoPayment.SelectedValue = _PaymentType;
                ddlParty.SelectedValue   = Convert.ToString(dt.Rows[0]["fk_CreditorID"]);
                ddlParty.Enabled         = false;
            }
            //txtLocation.Text = dt.Rows[0]["LOCATION"].ToString();
            //ddlExportImport.SelectedValue = dt.Rows[0]["EXPIMP"].ToString();
            if (_PaymentType == "C")
            {
                txtInvoiceNo.Text   = dt.Rows[0]["INVNO"].ToString();
                txtInvoiceType.Text = dt.Rows[0]["DOCTYPE"].ToString();
                txtInvoiceDate.Text = Convert.ToDateTime(dt.Rows[0]["INVDT"].ToString()).ToString("dd/MM/yyyy");
            }

            //hdnInvDt.Value = Convert.ToDateTime(dt.Rows[0]["INVDT"].ToString()).ToString("MM/dd/yyyy");
            txtInvoiceAmount.Text = dt.Rows[0]["INVAMT"].ToString();
            txtPendingAmt.Text    = dt.Rows[0]["PENDING"].ToString();
            //hdnLocationID.Value = dt.Rows[0]["LOCID"].ToString();
            //hdnNvoccId.Value = dt.Rows[0]["LINEID"].ToString();
        }
Example #2
0
        private void DeleteMoneyReceipt(string mrNo)
        {
            MoneyReceiptsBLL mrBLL = new MoneyReceiptsBLL();

            mrBLL.DeleteMoneyReceipts(mrNo);
            //UserBLL userBll = new UserBLL();
            //userBll.DeleteUser(userId, _userId);
            //LoadUser();
            ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "<script>javascript:void alert('" + ResourceManager.GetStringWithoutName("ERR00010") + "');</script>", false);
        }
        private void PopulateBillType()
        {
            List <InvoiceTypeEntity> lstLoc = new MoneyReceiptsBLL().GetInvoiceTypes();

            ddlType.DataValueField = "InvoiceTypeId";
            ddlType.DataTextField  = "InvoiceTypeName";
            ddlType.DataSource     = lstLoc;
            ddlType.DataBind();
            ddlType.Items.Insert(0, new ListItem(Constants.DROPDOWNLIST_DEFAULT_TEXT, Constants.DROPDOWNLIST_DEFAULT_VALUE));
        }
        private void SaveMoneyReceipts()
        {
            MoneyReceiptsBLL   mrBll        = new MoneyReceiptsBLL();
            MoneyReceiptEntity moneyReceipt = new MoneyReceiptEntity();

            //int returnVal = 0;

            moneyReceipt.InvoiceId = Convert.ToInt64(_InvoiceId);
            //moneyReceipt.LocationId = Convert.ToInt32(hdnLocationID.Value);
            //moneyReceipt.NvoccId = Convert.ToInt32(hdnNvoccId.Value);
            //moneyReceipt.ExportImport = Convert.ToChar(ddlExportImport.SelectedValue);
            moneyReceipt.MRDate     = Convert.ToDateTime(txtDate.Text);
            moneyReceipt.ChequeNo   = txtChqNo.Text;
            moneyReceipt.ChequeBank = txtBankName.Text.ToUpper();
            moneyReceipt.CHA        = rdoPayment.SelectedValue.ToString();
            if (!string.IsNullOrEmpty(txtChqDate.Text))
            {
                moneyReceipt.ChequeDate = Convert.ToDateTime(txtChqDate.Text);
            }

            if (!string.IsNullOrEmpty(txtCashAmt.Text))
            {
                moneyReceipt.CashPayment = Convert.ToDecimal(txtCashAmt.Text);
            }

            if (!string.IsNullOrEmpty(txtChequeAmt.Text))
            {
                moneyReceipt.ChequePayment = Convert.ToDecimal(txtChequeAmt.Text);
            }

            if (!string.IsNullOrEmpty(txtTDS.Text))
            {
                moneyReceipt.TdsDeducted = Convert.ToDecimal(txtTDS.Text);
            }

            moneyReceipt.NvoccId      = _jobid;
            moneyReceipt.CREID        = ddlParty.SelectedValue.ToInt();
            moneyReceipt.UserAddedId  = _userId;
            moneyReceipt.UserEditedId = _userId;
            moneyReceipt.UserAddedOn  = DateTime.Now.Date;
            moneyReceipt.UserEditedOn = DateTime.Now.Date;
            moneyReceipt.Status       = true;

            switch (mrBll.SaveCrePayment(moneyReceipt))
            {
            case 0: lblMessage.Text = ResourceManager.GetStringWithoutName("ERR00011");
                break;

            case 1:
                Response.Redirect("~/Forwarding/Transaction/Dashboard.aspx?JobId=" + GeneralFunctions.EncryptQueryString(_jobid.ToString()));
                break;
            }
        }
Example #5
0
        private void RetriveParameters()
        {
            _userId = MoneyReceiptsBLL.GetLoggedInUserId();

            //Get user permission.
            MoneyReceiptsBLL.GetUserPermission(out _canAdd, out _canEdit, out _canDelete, out _canView);

            if (!ReferenceEquals(Request.QueryString["invid"], null))
            {
                Int32.TryParse(GeneralFunctions.DecryptQueryString(Request.QueryString["invid"].ToString()), out _InvoiceId);
            }
        }
Example #6
0
        private void LoadMoneyReceipt()
        {
            //List<MoneyReceiptEntity> moneyReceipts = new List<MoneyReceiptEntity>();
            //   MoneyReceiptEntity mr = new MoneyReceiptEntity(null);
            //   MoneyReceiptEntity moneyReceipt1 = new MoneyReceiptEntity(null);
            //   MoneyReceiptEntity moneyReceipt2 = new MoneyReceiptEntity(null);

            //   MoneyReceiptEntity mr1 = new MoneyReceiptEntity(null);
            //   mr1.BLNo = "XYZ";

            //   MoneyReceiptEntity moneyReceipt11 = new MoneyReceiptEntity(null);
            //   moneyReceipt11.BLNo = "XYZ";

            //   MoneyReceiptEntity moneyReceipt22 = new MoneyReceiptEntity(null);
            //   moneyReceipt22.MRNo = "TG";
            //   moneyReceipt22.BLNo = "XYZ";
            //       moneyReceipts.Add(mr);
            //       moneyReceipts.Add(moneyReceipt1);
            //       moneyReceipts.Add(moneyReceipt2);

            //       moneyReceipts.Add(mr1);
            //       moneyReceipts.Add(moneyReceipt11);
            //       moneyReceipts.Add(moneyReceipt22);

            //       moneyReceipts.Add(mr1);
            //       moneyReceipts.Add(moneyReceipt11);
            //       moneyReceipts.Add(moneyReceipt22);
            //GetMoneyReceiptsRearranged(moneyReceipts);
            //  gvwMoneyReceipts.DataSource = GetMoneyReceiptsRearranged(moneyReceipts);
            //  gvwMoneyReceipts.DataBind();
            if (!ReferenceEquals(Session[Constants.SESSION_SEARCH_CRITERIA], null))
            {
                SearchCriteria searchCriteria = (SearchCriteria)Session[Constants.SESSION_SEARCH_CRITERIA];

                if (!ReferenceEquals(searchCriteria, null))
                {
                    BuildSearchCriteria(searchCriteria);
                    MoneyReceiptsBLL mrBll = new MoneyReceiptsBLL();

                    gvwMoneyReceipts.PageIndex = searchCriteria.PageIndex;
                    if (searchCriteria.PageSize > 0)
                    {
                        gvwMoneyReceipts.PageSize = searchCriteria.PageSize;
                    }
                    List <MoneyReceiptEntity> lstMRMaster = GetMoneyReceiptsRearranged(mrBll.GetMoneyReceipts(searchCriteria));
                    gvwMoneyReceipts.DataSource = lstMRMaster;
                    gvwMoneyReceipts.DataBind();
                    Session["MROBJECT"] = lstMRMaster;
                }
            }
        }
Example #7
0
        //private void GetPartyValuesSetToDdl()
        //{
        //    //ddlParty.Items.Clear();
        //    //var creditorInvoice = new CreditorInvoiceBLL().GetCreditor((ISearchCriteria)null);

        //    var creditorInvoice = new EstimateBLL().GetAllParty(0);
        //    ddlParty.DataSource = creditorInvoice;
        //    ddlParty.DataTextField = "PartyName";
        //    ddlParty.DataValueField = "pk_fwPartyID";
        //    ddlParty.DataBind();
        //    ddlParty.Items.Insert(0, new ListItem("--Select--", "0"));
        //}

        private void RetriveParameters()
        {
            _userId = MoneyReceiptsBLL.GetLoggedInUserId();

            //Get user permission.
            MoneyReceiptsBLL.GetUserPermission(out _canAdd, out _canEdit, out _canDelete, out _canView);

            //if (!ReferenceEquals(Request.QueryString["invid"], null))
            //{
            if (Request.QueryString["AdvanceID"] != null)
            {
                Int32.TryParse(GeneralFunctions.DecryptQueryString(Request.QueryString["AdvanceID"].ToString()), out _AdvanceId);
            }
            Int32.TryParse(GeneralFunctions.DecryptQueryString(Request.QueryString["jobid"].ToString()), out _jobid);
            _PaymentType = GeneralFunctions.DecryptQueryString(Request.QueryString["paymenttype"].ToString());
            //}
        }
Example #8
0
        private void LoadData()
        {
            MoneyReceiptsBLL mrBll = new MoneyReceiptsBLL();
            int       PartyId;
            DataTable dt;

            if (_AdvanceId == 0)
            {
                dt = mrBll.GetInvoiceDetailForAdvance(_AdvanceId, _jobid, _PaymentType);

                txtDate.Text    = DateTime.Now.ToShortDateString();
                txtJobNo.Text   = dt.Rows[0]["JOBNO"].ToString();
                txtJobDate.Text = Convert.ToDateTime(dt.Rows[0]["JOBDATE"].ToString()).ToString("dd/MM/yyyy");
                hdnJobID.Value  = dt.Rows[0]["pk_JobID"].ToString();
            }
            else
            {
                dt              = mrBll.GetAdvanceforEdit(_AdvanceId, _jobid, _PaymentType);
                txtChqNo.Text   = dt.Rows[0]["ChequeNo"].ToString();
                txtChqDate.Text = dt.Rows[0]["ChequeDate"].ToString().Split(' ')[0];
                //ddlParty.SelectedValue = dt.Rows[0]["fk_PartyID"].ToString();
                ddlPartyType.SelectedValue = dt.Rows[0]["fk_PartyTypeID"].ToString();
                txtJobNo.Text         = dt.Rows[0]["JobNo"].ToString();
                txtChequeAmt.Text     = dt.Rows[0]["ChequePayment"].ToString();
                txtCashAmt.Text       = dt.Rows[0]["CashPayment"].ToString();
                txtBankName.Text      = dt.Rows[0]["ChequeBank"].ToString();
                txtMRNo.Text          = dt.Rows[0]["pmtReference"].ToString();
                PartyId               = dt.Rows[0]["fk_PartyID"].ToInt();
                txtDate.Text          = dt.Rows[0]["pmtDate"].ToString().Split(' ')[0];
                txtJobDate.Text       = dt.Rows[0]["JobDate"].ToString().Split(' ')[0];
                txtCurrentAmount.Text = (txtCashAmt.Text.ToDecimal() + txtChequeAmt.Text.ToDecimal()).ToString();
                hdnJobID.Value        = dt.Rows[0]["fk_JobID"].ToString();
                GetPartyValuesSetToDdl(ddlPartyType.SelectedValue.ToInt());
                ddlParty.SelectedValue = PartyId.ToString();
            }
            //if (_PaymentType == "C")
            //{
            //    ddlParty.SelectedValue = Convert.ToString(dt.Rows[0]["fk_CreditorID"]);
            //    ddlParty.Enabled = false;
            //}
        }
Example #9
0
        private void LoadData()
        {
            MoneyReceiptsBLL mrBll = new MoneyReceiptsBLL();
            DataTable        dt    = mrBll.GetInvoiceDetailForMoneyReceipt(_InvoiceId);

            txtDate.Text     = DateTime.Now.ToShortDateString();
            txtBLNo.Text     = dt.Rows[0]["BLNO"].ToString();
            txtNvocc.Text    = dt.Rows[0]["LINE"].ToString();
            txtLocation.Text = dt.Rows[0]["LOCATION"].ToString();
            ddlExportImport.SelectedValue = dt.Rows[0]["EXPIMP"].ToString();

            txtInvoiceNo.Text     = dt.Rows[0]["INVNO"].ToString();
            txtInvoiceType.Text   = dt.Rows[0]["DOCTYPE"].ToString();
            txtInvoiceDate.Text   = Convert.ToDateTime(dt.Rows[0]["INVDT"].ToString()).ToString("dd/MM/yyyy");
            hdnInvDt.Value        = Convert.ToDateTime(dt.Rows[0]["INVDT"].ToString()).ToString("MM/dd/yyyy");
            txtInvoiceAmount.Text = dt.Rows[0]["INVAMT"].ToString();
            txtPendingAmt.Text    = dt.Rows[0]["PENDING"].ToString();

            hdnLocationID.Value = dt.Rows[0]["LOCID"].ToString();
            hdnNvoccId.Value    = dt.Rows[0]["LINEID"].ToString(); // forwarding this field is used as Jobid
        }