Example #1
0
        /// <summary>
        /// This method is used to validate vouchers/booklets received at ho.
        /// </summary>
        /// <param name="ReceivingAtHoInfo"></param>
        public static void ScanVouchersReceivedAtHo(ReceivingAtHoInfo ReceivingAtHoInfo, bool IsBooklet, string UserID)
        {
            try
            {
                clsParameterCollection ParameterCollection = new clsParameterCollection();
                if (IsBooklet)
                    ParameterCollection.ProcedureName = "BS_ReceivedatHO_ScanBooklet";
                else
                    ParameterCollection.ProcedureName = "BS_ReceivedatHO_ScanVouchers";
                ParameterCollection.ParaCollection.Add(new clsParameter("@TransactionID", ReceivingAtHoInfo.TransactionID));
                ParameterCollection.ParaCollection.Add(new clsParameter("@VoucherNo", ReceivingAtHoInfo.FirstVoucherID));
                ParameterCollection.ParaCollection.Add(new clsParameter("@UserID", UserID));
                DataAccess.ExecuteNonQuerySp(ParameterCollection);
            }
            catch (Exception Ex)
            {
                if (!Ex.Message.Contains("User Define:"))
                    BL_Exception.WriteLog(Ex);

                throw Ex;
            }
        }
        protected void txtVID_TextChanged(object sender, EventArgs e)
        {
            if (ddlTransactionID.SelectedValue == "0")
            {
                lblTransactionError.Visible = true;
                txtVID.Text = string.Empty;
                ddlTransactionID.Focus();
            }
            else
            {
                lblTransactionError.Visible = false;
                try
                {
                    ReceivingAtHoInfo ReceivingAtHoInfo = new ReceivingAtHoInfo();
                    ReceivingAtHoInfo.TransactionID = ddlTransactionID.SelectedValue; //txtTransactionID.Text;
                    ReceivingAtHoInfo.FirstVoucherID = txtVID.Text;
                    userID = Session["UserID"] != null ? Session["UserID"].ToString() : "";
                    BL_ReceivingAtHo.ScanVouchersReceivedAtHo(ReceivingAtHoInfo, ddlVoucherBooklet.SelectedValue == "1", userID);
                    BindGrid();
                    txtVID.Text = string.Empty;
                    txtVID.Focus();
                }
                catch (Exception ex)
                {

                    BindGrid();
                    txtVID.Text = string.Empty;
                    txtVID.Focus();
                    if (ex.Message.Contains("User Define:"))
                    {
                        string ErrorMessage = "alert('" + ex.Message.Replace("User Define:", string.Empty) + "');";
                        AjaxControlToolkit.ToolkitScriptManager.RegisterStartupScript(this, GetType(), "checkValide", ErrorMessage, true);
                    }
                    mpePopup.Show();
                    AjaxControlToolkit.ToolkitScriptManager.RegisterStartupScript(this, GetType(), "checkValide", ex.Message, true);
                }
            }
            mpePopup.Show();
        }