• Good day,

    Sad to say that i dont have the previledges to view the DDL of spQuery_GetSequenceNo that given to me.

    @ChrisM@Work

    is set the value of the DPNUmber,amounttobepaid,paymentdate once the user insert data it will generate a SequenceNo based on that parameter that i had.

    I also thinking to use OUTPUT on my query just to get the value of the result of the exec SP.. but i dont have idea how could i start

    here is my code..

    here is my DAL

    protected int UpdateRefNumberDAL(DeliveryListAmountEntities _deliveryListAmount)

    {

    //SqlParameter x = new SqlParameter();

    //x.Direction = ParameterDirection.Output;

    return base.Execute("sp_UPDATEREFNUMBER", _deliveryListAmount);

    //DbCommand cmd = ("sp_UPDATEREFNUMBER");

    //cmd.Parameters["@myPAram"].Direction = ParameterDirection.Output;

    //int ax = (int)cmd.Parameters["@myPAram"].Value;

    //return ax;

    }

    here is my BLL

    public int UpdateRefNumber(DeliveryListAmountEntities _deliveryListAmount)

    {

    return base.UpdateRefNumberDAL(_deliveryListAmount);

    }

    here is my code behind

    protected void rptCash_ItemCommand(object source, RepeaterCommandEventArgs e)

    {

    if (e.CommandName == "btnAmount")

    {

    Label lblSH = (Label)e.Item.FindControl("lblShipment");

    TextBox txtAmount = (TextBox)e.Item.FindControl("txtAmountPaid");

    _deliveryListAmount.bintShipment = Convert.ToInt64(lblSH.Text);

    _deliveryListAmount.bintDriver = Convert.ToInt64(lblDPNumber.Text);

    _deliveryListAmount.decAmountPaid = Convert.ToDecimal(txtAmount.Text);

    _deliveryListAmount.dtpaymentDate = Convert.ToDateTime(txtDateOfPayment.Text);

    _deliveryListAmount.decTotalAmount = Convert.ToDecimal(txtTotalAmountPaid.Text);

    if (_collectBankBll.UpdateRefNumber(_deliveryListAmount) != 0)

    {

    GetCashCollection(_deliveryListAmount);

    }

    }

    }

    and also my DAL Connection

    public abstract class DALConnection

    {

    internal string GetAppConnectionString()

    {

    return ConfigurationManager.ConnectionStrings[ConfigurationSettings.AppSettings["DefaultConnection"]].ConnectionString;

    }

    internal string GetAppConnectionString(string ConnectionName)

    {

    return ConfigurationManager.ConnectionStrings[ConnectionName].ConnectionString;

    }

    internal int GetConnectionTimeout()

    {

    string strConnectionTimeout = Convert.ToString(ConfigurationSettings.AppSettings["ConnectionTimeout"]);

    if (strConnectionTimeout.Trim() == string.Empty)

    return 30;

    else

    return int.Parse(strConnectionTimeout);

    }

    }