/// <summary> /// This method is used to scan vouhers through scanning machine. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void txtVID_TextChanged(object sender, EventArgs e) { if (ddlStn.SelectedValue == "0") { lblSTNError.Visible = true; txtVID.Text = string.Empty; ddlStn.Focus(); } else { try { InwardStoreInfo ScanInfo = new InwardStoreInfo(); ScanInfo.type = drpvoucherbooklet.SelectedValue.ToString(); ScanInfo.storeCode = drpStore.SelectedValue.ToString(); ScanInfo.firstID = txtVID.Text; ScanInfo.stnNo = ddlStn.SelectedValue; BL_InwardStore.ScanVouchers(ScanInfo, Session["UserID"].ToString()); GetScanDetails(); txtVID.Text = string.Empty; txtVID.Focus(); } catch (Exception Ex) { if (Ex.Message.Contains("User Define")) { AjaxControlToolkit.ToolkitScriptManager.RegisterStartupScript(this, GetType(), "Scan", "alert('" + Ex.Message.Replace("User Define:", "").Replace("\r", "").Replace("\n", "") + "')", true); txtVID.Text = string.Empty; txtVID.Focus(); mpeInwardStore.Show(); } } } mpeInwardStore.Show(); }
/// <summary> /// This method is used to Scan entered vouchers and Inward to store. /// </summary> /// <param name="StoreInfo"></param> public static void ScanVouchers(InwardStoreInfo ScanInfo, string UserID) { try { clsParameterCollection ParameterCollection = new clsParameterCollection(); if (ScanInfo.type == "0")//Voucher ParameterCollection.ProcedureName = "BS_InwardAtStore_ScanVoucher"; else//Booklet ParameterCollection.ProcedureName = "BS_InwardAtStore_ScanBooklet"; ParameterCollection.ParaCollection.Add(new clsParameter("@ToStoreCode", ScanInfo.storeCode.ToString())); ParameterCollection.ParaCollection.Add(new clsParameter("@STNNO", ScanInfo.stnNo)); ParameterCollection.ParaCollection.Add(new clsParameter("@VoucherNO", ScanInfo.firstID)); 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; } }