示例#1
0
        public static int SaveAdvance(MoneyReceiptEntity moneyReceipt)
        {
            string strExecution = "[fwd].[AddAdvance]";
            int    result       = 0;
            string MrNo         = string.Empty;

            using (DbQuery oDq = new DbQuery(strExecution))
            {
                oDq.AddBigIntegerParam("@AdvanceID", moneyReceipt.MoneyReceiptId);
                oDq.AddBigIntegerParam("@InvoiceID", moneyReceipt.InvoiceId); //Just to avoid exception. Not actually in use.
                oDq.AddBigIntegerParam("@CompanyID", 1);
                oDq.AddIntegerParam("@PartyID", moneyReceipt.CREID);
                oDq.AddIntegerParam("@PartyTypeID", moneyReceipt.NvoccId);
                oDq.AddNVarcharParam("@pmtType", moneyReceipt.CHA);
                oDq.AddBigIntegerParam("@JobID", moneyReceipt.BLId);
                oDq.AddDateTimeParam("@MRDate", moneyReceipt.MRDate);
                oDq.AddNVarcharParam("@ChequeNo", moneyReceipt.ChequeNo);
                oDq.AddDateTimeParam("@ChequeDate", moneyReceipt.ChequeDate);
                oDq.AddNVarcharParam("@ChequeBank", moneyReceipt.ChequeBank);
                oDq.AddDecimalParam("@CashPayment", 12, 2, moneyReceipt.CashPayment);
                oDq.AddDecimalParam("@ChequePayment", 12, 2, moneyReceipt.ChequePayment);
                oDq.AddDecimalParam("@TDSDeducted", 12, 2, moneyReceipt.TdsDeducted);
                oDq.AddIntegerParam("@UserAdded", moneyReceipt.UserAddedId);
                oDq.AddIntegerParam("@UserLastEdited", moneyReceipt.UserEditedId);
                oDq.AddDateTimeParam("@AddedOn", moneyReceipt.UserAddedOn);
                oDq.AddDateTimeParam("@EditedOn", moneyReceipt.UserEditedOn);
                oDq.AddBooleanParam("@MRStatus", moneyReceipt.Status);
                oDq.AddIntegerParam("@Result", result, QueryParameterDirection.Output);
                oDq.AddNVarcharParam("@MRNo", 40, MrNo, QueryParameterDirection.Output);
                oDq.RunActionQuery();
                result = Convert.ToInt32(oDq.GetParaValue("@Result"));
                MrNo   = Convert.ToString(oDq.GetParaValue("@MRNo"));
            }
            return(result);
        }
示例#2
0
        public static List <MoneyReceiptEntity> GetMoneyReceipts(SearchCriteria searchCriteria)
        {
            string strExecution = "[dbo].[uspGetMoneyReceipts]";
            List <MoneyReceiptEntity> lstMoneyReceipts = new List <MoneyReceiptEntity>();

            using (DbQuery oDq = new DbQuery(strExecution))
            {
                oDq.AddVarcharParam("@InvoiceNo", 20, searchCriteria.StringOption1);
                oDq.AddVarcharParam("@BLNo", 60, searchCriteria.StringOption2);
                oDq.AddVarcharParam("@MRNo", 40, searchCriteria.StringOption3);
                oDq.AddIntegerParam("@IsExport", searchCriteria.IntegerOption1);
                oDq.AddVarcharParam("@SortExpression", 20, searchCriteria.SortExpression);
                oDq.AddVarcharParam("@SortDirection", 4, searchCriteria.SortDirection);
                DataTableReader reader = oDq.GetTableReader();

                while (reader.Read())
                {
                    MoneyReceiptEntity moneyReceipt = new MoneyReceiptEntity(reader);

                    lstMoneyReceipts.Add(moneyReceipt);
                }

                reader.Close();
            }

            return(lstMoneyReceipts);
        }
        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;
            }
        }
示例#4
0
        protected void gvwMoneyReceipt_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals("Sort"))
            {
                if (ViewState[Constants.SORT_EXPRESSION] == null)
                {
                    ViewState[Constants.SORT_EXPRESSION] = e.CommandArgument.ToString();
                    ViewState[Constants.SORT_DIRECTION]  = "ASC";
                }
                else
                {
                    if (ViewState[Constants.SORT_EXPRESSION].ToString() == e.CommandArgument.ToString())
                    {
                        if (ViewState[Constants.SORT_DIRECTION].ToString() == "ASC")
                        {
                            ViewState[Constants.SORT_DIRECTION] = "DESC";
                        }
                        else
                        {
                            ViewState[Constants.SORT_DIRECTION] = "ASC";
                        }
                    }
                    else
                    {
                        ViewState[Constants.SORT_DIRECTION]  = "ASC";
                        ViewState[Constants.SORT_EXPRESSION] = e.CommandArgument.ToString();
                    }
                }

                LoadMoneyReceipt();
            }
            else if (e.CommandName == "Edit")
            {
                MoneyReceiptEntity mrSession = (Session["MROBJECT"] as List <MoneyReceiptEntity>).FirstOrDefault(mr => mr.MRNo == e.CommandArgument.ToString());
                mrSession.IsEdited  = 1;
                Session["MROBJECT"] = mrSession;
                RedirecToAddEditPage(Convert.ToInt32(e.CommandArgument));
            }
            else if (e.CommandName == "Remove")
            {
                DeleteMoneyReceipt(e.CommandArgument.ToString());
            }
        }
示例#5
0
        public static int SaveMoneyReceipt(MoneyReceiptEntity moneyReceipt)
        {
            string strExecution = "[trn].[AddMoneyReceipt]";
            int    result       = 0;
            string MrNo         = string.Empty;

            using (DbQuery oDq = new DbQuery(strExecution))
            {
                //if (moneyReceipt.IsAdded == 1)
                //{
                oDq.AddBigIntegerParam("@MoneyRcptID", moneyReceipt.MoneyReceiptId);
                oDq.AddBigIntegerParam("@InvoiceID", moneyReceipt.InvoiceId);     //Just to avoid exception. Not actually in use.
                oDq.AddIntegerParam("@LocationID", moneyReceipt.LocationId);
                oDq.AddIntegerParam("@NVOCCID", moneyReceipt.NvoccId);
                oDq.AddCharParam("@ExportImport", 2, moneyReceipt.ExportImport);
                oDq.AddDateTimeParam("@MRDate", moneyReceipt.MRDate);
                oDq.AddNVarcharParam("@ChequeNo", moneyReceipt.ChequeNo);
                oDq.AddDateTimeParam("@ChequeDate", moneyReceipt.ChequeDate);
                oDq.AddNVarcharParam("@ChequeBank", moneyReceipt.ChequeBank);
                oDq.AddDecimalParam("@CashPayment", 12, 2, moneyReceipt.CashPayment);
                oDq.AddDecimalParam("@ChequePayment", 12, 2, moneyReceipt.ChequePayment);
                oDq.AddDecimalParam("@TDSDeducted", 12, 2, moneyReceipt.TdsDeducted);
                oDq.AddIntegerParam("@UserAdded", moneyReceipt.UserAddedId);
                oDq.AddIntegerParam("@UserLastEdited", moneyReceipt.UserEditedId);
                oDq.AddDateTimeParam("@AddedOn", moneyReceipt.UserAddedOn);
                oDq.AddDateTimeParam("@EditedOn", moneyReceipt.UserEditedOn);
                oDq.AddBooleanParam("@MRStatus", moneyReceipt.Status);
                oDq.AddIntegerParam("@Result", result, QueryParameterDirection.Output);
                oDq.AddNVarcharParam("@MRNo", 40, MrNo, QueryParameterDirection.Output);
                oDq.RunActionQuery();
                result = Convert.ToInt32(oDq.GetParaValue("@Result"));
                MrNo   = Convert.ToString(oDq.GetParaValue("@MRNo"));
                //}
            }

            return(result);
        }
示例#6
0
 public int SaveAdvance(MoneyReceiptEntity moneyReceipt)
 {
     return(MoneyReceiptDAL.SaveAdvance(moneyReceipt));
 }
示例#7
0
 public int SaveCrePayment(MoneyReceiptEntity moneyReceipt)
 {
     return(MoneyReceiptDAL.SaveCrePayment(moneyReceipt));
 }
示例#8
0
        //public int SaveMoneyReceipts(List<MoneyReceiptEntity> moneyReceipts)
        //{
        //    return MoneyReceiptDAL.SaveMoneyReceipts(moneyReceipts);

        //}

        public int SaveMoneyReceipt(MoneyReceiptEntity moneyReceipt)
        {
            return(MoneyReceiptDAL.SaveMoneyReceipt(moneyReceipt));
        }