public XElement GenerateAddRq(decimal?TotalValue = null, DateTime?InventoryDate = null) { XElement Add = new XElement(typeof(ItemInventory).Name + "Add"); Add.Add(Name?.ToQBXML(nameof(Name))); Add.Add(BarCode?.ToQBXML(nameof(BarCode))); Add.Add(IsActive.ToQBXML(nameof(IsActive))); Add.Add(ClassRef?.ToQBXML(nameof(ClassRef))); Add.Add(ParentRef?.ToQBXML(nameof(ParentRef))); Add.Add(ManufacturerPartNumber?.ToQBXML(nameof(ManufacturerPartNumber))); Add.Add(UnitOfMeasureSetRef?.ToQBXML(nameof(UnitOfMeasureSetRef))); Add.Add(SalesTaxCodeRef?.ToQBXML(nameof(SalesTaxCodeRef))); Add.Add(SalesDesc?.ToQBXML(nameof(SalesDesc))); Add.Add(SalesPrice?.ToQBXML(nameof(SalesPrice))); Add.Add(IncomeAccountRef?.ToQBXML(nameof(IncomeAccountRef))); Add.Add(PurchaseDesc?.ToQBXML(nameof(PurchaseDesc))); Add.Add(PurchaseCost?.ToQBXML(nameof(PurchaseCost))); Add.Add(COGSAccountRef?.ToQBXML(nameof(COGSAccountRef))); Add.Add(PrefVendorRef?.ToQBXML(nameof(PrefVendorRef))); Add.Add(AssetAccountRef?.ToQBXML(nameof(AssetAccountRef))); Add.Add(ReorderPoint?.ToQBXML(nameof(ReorderPoint))); Add.Add(Max?.ToQBXML(nameof(Max))); Add.Add(QuantityOnHand?.ToQBXML(nameof(QuantityOnHand))); Add.Add(TotalValue?.ToQBXML(nameof(TotalValue))); Add.Add(InventoryDate?.ToQBXML(nameof(InventoryDate))); Add.Add(ExternalGUID?.ToQBXML(nameof(ExternalGUID))); XElement AddRq = new XElement(typeof(ItemInventory).Name + "AddRq", Add); foreach (var value in IncludeRetElement) { AddRq.Add(value.ToQBXML(nameof(IncludeRetElement))); } return(AddRq); }
private void Btn_1_Click(object sender, RoutedEventArgs e) { BarCode barCode = new BarCode(); barCode.Symbology = Symbology.QRCode; barCode.CodeText = "Alexander Johnathon Stevenson JR;Senior Software Developer;[email protected];20180709-08:00:00;9993334444;Los Angeles;CA;USA;ABC Company"; barCode.BackColor = Color.White; barCode.ForeColor = Color.Black; barCode.RotationAngle = 0; barCode.CodeBinaryData = Encoding.Default.GetBytes(barCode.CodeText); barCode.Options.QRCode.Version = QRCodeVersion.Version5; barCode.Options.QRCode.CompactionMode = QRCodeCompactionMode.Byte; barCode.Options.QRCode.ErrorLevel = QRCodeErrorLevel.H; barCode.Options.QRCode.ShowCodeText = false; barCode.Dpi = 200; barCode.AutoSize = false; //needs to be off if specifying unit and widths barCode.Unit = GraphicsUnit.Millimeter; // Note: 1 inch = 25.4 Millimeters barCode.ImageWidth = 70F; barCode.ImageHeight = 70F; Bitmap bitmap = ResizeImage(barCode.BarCodeImage, 200, 200); bitmap.Save("QRCode.png"); Process.Start("QRCode.png"); }
private Product FindProductBy(BarCode barCode) { var product = _repository.FindBy(barCode); Guard.Operation(product != null, "Repository error: null reference received"); return(product); }
public void GetProduct(BarCode barCode) { BarCodeScanner = new BarCodeScanner(this.ProductRepository); var productID = BarCodeScanner.GetProductID(barCode); if (productID != -1) { var product = BarCodeScanner.GetProduct(productID); if (product != null) { Products.Add(product); var message = string.Format("{0}, {1}", product.ProductName, product.ProductPrice); LCDisplayDevice.MessageToDisplay = message; LCDisplayDevice.PrintMessage(message); } else { LCDisplayDevice.MessageToDisplay = "Product not found"; LCDisplayDevice.PrintMessage("Product not found"); } } else { LCDisplayDevice.MessageToDisplay = "Invalid bar-code"; LCDisplayDevice.PrintMessage("Invalid bar-code"); } }
public SerialNumber GetNewModel(string name) { using (var db = GetDbContext()) { SerialNumber serialNumber = new SerialNumber() { Name = name }; var entry = db.SerialNumbers.Where(e => e.Name == serialNumber.Name && e.Number == serialNumber.Number && e.SID == 0).OrderByDescending(e => e.ID).FirstOrDefault(); if (entry != null) { return(entry); } else { entry = db.SerialNumbers.Where(e => e.Number == serialNumber.Number).OrderByDescending(e => e.ID).FirstOrDefault(); int count = 0; if (entry != null) { count = entry.NumberExt; } serialNumber.NumberExt = count + 1; serialNumber.BarCode = BarCode.GetBarCodePath(serialNumber.Coding); db.SerialNumbers.Add(serialNumber); db.SaveChanges(); } return(serialNumber); } }
public void BarCode_with_all_propreties_set() { //Arrange var text = new BarCode { Left = "1cm", Top = "2cm", Width = "10cm", Height = "3cm", IsBackground = true, Name = "MyBarCode", Code = "123", }; var xme = text.ToXme(); //Act var otherLine = BarCode.Load(xme); //Assert Assert.AreEqual(text.Left, otherLine.Left); Assert.AreEqual(text.Right, otherLine.Right); Assert.AreEqual(text.Width, otherLine.Width); Assert.AreEqual(text.Top, otherLine.Top); Assert.AreEqual(text.Bottom, otherLine.Bottom); Assert.AreEqual(text.Height, otherLine.Height); Assert.AreEqual(text.Name, otherLine.Name); Assert.AreEqual(text.IsBackground, otherLine.IsBackground); Assert.AreEqual(text.Name, otherLine.Name); Assert.AreEqual(text.Code, text.Code); Assert.AreEqual(text.ToString(), otherLine.ToString()); Assert.AreEqual(xme.OuterXml, otherLine.ToXme().OuterXml); }
public IHttpActionResult GetBarCode(string projectId) { SortedDictionary <string, string> sd = new SortedDictionary <string, string>() { }; sd.Add("@ProejctId", projectId.ToString()); RDSService.RDSService rdsService = new RDSService.RDSService(); DataSet ds = rdsService.SelectList("USP_GetBarCode", sd); List <BarCode> lstBarcode = new List <BarCode>(); if (ds != null && ds.Tables[0].Rows.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { var barCode = new BarCode() { BarCodeId = Convert.ToInt32(dr[0]), StockLength = dr[1].ToString(), BarCodeGrade = dr[2].ToString().Equals("1") ? true : false, StandardSplice = dr[3].ToString(), MachanicSplice = dr[4].ToString() }; lstBarcode.Add(barCode); } } return(Ok(lstBarcode.FirstOrDefault())); }
public ATMForm(Database.Connection db, ClientSettings s, BarCode.ReaderControl r, Logger.Logging logger) : base(db, s, r, logger, 120000) { InitializeComponent(); userObjects["START"] = new ATMStart(db); userObjects["PINCODE"] = new ATMPinCode(db); userObjects["SELECT"] = new ATMSelect(db); userObjects["BALANCE"] = new ATMBalance(db); userObjects["TRANSFER"] = new ATMTransfer(db); userObjects["AMOUNT"] = new ATMAmount(db); userObjects["VERIFY"] = new ATMVerify(db); userObjects["STOCK_START"] = new ATMStockStart(db); userObjects["STOCK_DIRECT"] = new StockDirectShare(db); userObjects["STOCK_DIRECT_QTY"] = new StockDirectQty(db); userObjects["STOCK_DIRECT_PRICE"] = new StockDirectPrice(db); userObjects["STOCK_DIRECT_RECIPIENT"] = new StockDirectRecipient(db); userObjects["STOCK_DIRECT_RECEIVER_PINCODE"] = new StockDirectPinCode(db); userObjects["STOCK_DIRECT_CONFIRM"] = new StockDirectConfirmation(db); userObjects["NEWS"] = new StockNews(db); userObjects["STOCK_REQUESTS"] = new StockRequests(db); userObjects["STOCK_ADD_REQUEST_TICKER"] = new StockAddRequestTicker(db); userObjects["STOCK_ADD_QTY"] = new StockAddQty(db); userObjects["STOCK_ADD_OPERATION"] = new StockAddOperation(db); userObjects["STOCK_DELETE_REQUEST_CONFURMATION"] = new StockDeleteRequestConfirmation(db); startupObjectKey = "START"; }
private void Print() { if (_WarehouseFacade == null) { _WarehouseFacade = new WarehouseFacade(base.DataProvider); } if (this.gridWebGrid.Rows.Count <= 0) { return; } try { this.DataProvider.BeginTransaction(); for (int i = 0; i < this.gridWebGrid.Rows.Count; i++) { string barno = this.gridWebGrid.Rows[i].Items.FindItemByKey("TDCartonNo").Value.ToString(); BarCode bar = (BarCode)_WarehouseFacade.GetBarCode(barno); bar.PrintTimes = bar.PrintTimes + 1; _WarehouseFacade.UpdateBarCode(bar); } this.DataProvider.CommitTransaction(); } catch (Exception ex) { this.DataProvider.RollbackTransaction(); WebInfoPublish.PublishInfo(this, ex.Message, this.languageComponent1); } }
// GET: Products/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var product = db.Products.Find(id); var Barra = new BarCode { ProductId = product.ProductId }; NewProductView np = new NewProductView(); np.Product = product; np.BarCode = Barra; if (np == null) { return(HttpNotFound()); } return(View(np)); }
/// <summary> /// metoda koja služi za generiranje barkoda prema proslijeđenome kodu/stringu /// </summary> /// <param name="kod"></param> public void GenerirajBarcode(string kod) { BarCode pdf417 = new BarCode(); pdf417.Symbology = KeepAutomation.Barcode.Symbology.PDF417; pdf417.PDF417RowCount = 3; pdf417.PDF417ColumnCount = 5; pdf417.CodeToEncode = kod; pdf417.PDF417DataMode = PDF417DataMode.Auto; pdf417.BarcodeUnit = KeepAutomation.Barcode.BarcodeUnit.Pixel; // pdf417.DPI = 100; pdf417.X = 1.9f; pdf417.Y = pdf417.X / 0.3f; //pdf417.Y = 2; pdf417.BarCodeWidth = 44; pdf417.BarCodeHeight = 20; pdf417.PDF417XtoYRatio = 0.2f; pdf417.LeftMargin = 12; pdf417.RightMargin = 12; pdf417.TopMargin = 6; pdf417.BottomMargin = 6; pdf417.Orientation = KeepAutomation.Barcode.Orientation.Degree0; pdf417.ImageFormat = ImageFormat.Png; pdf417.PDF417ECL = PDF417ECL.ECL_1; Bitmap barcodeInBitmap = pdf417.generateBarcodeToBitmap(); uiGeneriraniBarcode.Image = barcodeInBitmap; }
internal override void Render() { RenderFilling(); BarcodeFormatInfo formatInfo = (BarcodeFormatInfo)_renderInfo.FormatInfo; Area contentArea = _renderInfo.LayoutInfo.ContentArea; XRect destRect = new XRect(contentArea.X, contentArea.Y, formatInfo.Width, formatInfo.Height); BarCode gfxBarcode = null; if (_barcode.Type == BarcodeType.Barcode39) { gfxBarcode = new Code3of9Standard(_barcode.Code); } else if (_barcode.Type == BarcodeType.Barcode25i) { gfxBarcode = new Code2of5Interleaved(_barcode.Code); } // if gfxBarcode is null, the barcode type is not supported if (gfxBarcode != null) { gfxBarcode.Direction = CodeDirection.LeftToRight; gfxBarcode.Size = new XSize(ShapeWidth, ShapeHeight); _gfx.DrawBarCode(gfxBarcode, XBrushes.Black, destRect.Location); } RenderLine(); }
/// <summary> /// Generate a barcode preview button event handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GeneratePreviewBtn_Click(object sender, EventArgs e) { Symbology CurrentSymbology = Symbology.UPCA; //Switch between the encoding types switch (comboBox1.SelectedItem) { case "UPC-A": CurrentSymbology = Symbology.UPCA; Code = UnformattedBarcodeTextbox.Text; break; case "EAN-13": CurrentSymbology = Symbology.EAN13; Code = UnformattedBarcodeTextbox.Text; break; case "ITF-14": CurrentSymbology = Symbology.ITF14; Code = UnformattedBarcodeTextbox.Text; break; } BarCode Instance = new BarCode { Symbology = CurrentSymbology, CodeToEncode = Code }; pictureBox1.BackgroundImage = Instance.generateBarcodeToBitmap(); }
public void printBarcode() { DataTable tblInBarcode = new DataTable(); tblInBarcode.TableName = "SanPham"; tblInBarcode.Columns.Add(new DataColumn("SanPhamID", typeof(string))); tblInBarcode.Columns.Add(new DataColumn("TenSanPham", typeof(string))); tblInBarcode.Columns.Add(new DataColumn("GiaBan", typeof(string))); foreach (DataRow item in tblDonHangChiTiet.Rows) { int intSLin = Convert.ToInt32(item["SoLuong"]); for (int i = 0; i < intSLin; i++) { tblInBarcode.Rows.Add(item["SanPhamID"], item["TenSanPham"], item["DonGia"]); } } BarCode rpt = new BarCode(); rpt.SetDataSource(tblInBarcode); frmViewReports f = new frmViewReports(); f.crystalReportViewer1.ReportSource = rpt; f.MdiParent = this.MdiParent; f.Show(); }
public Product FindBy(BarCode barCode) { int.TryParse(barCode.Code, out var code); code %= Products.Length; return(Products[code]); }
private void MakeWorksheet() { BarCode barCode = new BarCode() { Symbology = Symbology.Code128, BackColor = Color.White, ForeColor = Color.Black, RotationAngle = 0, }; barCode.CodeText = "111111111"; barCode.CodeBinaryData = Encoding.Default.GetBytes(barCode.CodeText); barCode.Options.Code128.ShowCodeText = false; barCode.Paddings.Left = 10; barCode.Paddings.Right = 10; this.spreadsheetControl1.Document.Worksheets[0].Pictures.AddPicture(barCode.BarCodeImage, spreadsheetControl1.Document.Worksheets[0].Range["L2:P2"]); spreadsheetControl1.Document.Worksheets[0].Cells["D3"].Value = "가공지시번호"; spreadsheetControl1.Document.Worksheets[0].Cells["D4"].Value = "재종"; spreadsheetControl1.Document.Worksheets[0].Cells["I3"].Value = "품명"; spreadsheetControl1.Document.Worksheets[0].Cells["I4"].Value = "형번"; spreadsheetControl1.Document.Worksheets[0].Cells["N3"].Value = "고객명"; spreadsheetControl1.Document.Worksheets[0].Cells["N4"].Value = "품번"; spreadsheetControl1.Document.Worksheets[0].Cells[11, 1].Value = "공정명"; }
private void btnPrint_Click(object sender, EventArgs e) { var cardList = new List <BarCode>(); for (int counter = 0; counter < _DiscountCardList.Count; counter++) { if (rdbPrintSelected.Checked) { if (dgvDiscountCard.Rows[counter].Cells["PrintCheck"].Value == null) { continue; } if (!bool.Parse(dgvDiscountCard.Rows[counter].Cells["PrintCheck"].Value.ToString())) { continue; } } var barCode = new BarCode { BarCodeValue = ((DiscountCard)_DiscountCardList[counter]).CardNumber, DisplayStr = "" }; cardList.Add(barCode); } PrintDiscountCard.InializePrinting(cardList); }
private void Org_Bill_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { BarCode.Focus(); } }
public void Cancel(string code) { Guard.Operation(_outChecker != null); var barCode = new BarCode(code); _outChecker.Cancel(barCode); }
/// <summary> /// 修改数据到表TblCommodity /// </summary> /// <param name="name" Commodity的U_nam名字</param> /// <param name="commodity">更新成的表</param> public bool UpdataCommoditys(string id, Commodity commodity, string path) { using (WarehouseERPDAL dB = new WarehouseERPDAL()) { try { var model = dB.commoditys.Where(c => c.Co_Id.ToString() == id).FirstOrDefault(); if (model != null && !model.Equals(new Commodity())) { BarCode barCode = new BarCode(); if (model.Co_bar_code != commodity.Co_bar_code) { barCode.DeleteFile(path + model.Co_bar_code + ".jdg"); barCode.Code(commodity.Co_bar_code, path); } Change(ref model, commodity); } dB.SaveChanges(); return(true); } catch (Exception e) { return(false); } } }
public void Scan(string code) { Guard.Operation(_outChecker != null); var barCode = new BarCode(code); _outChecker.Scan(barCode); }
private void LoadBarCodes() { var barCodeStorage = _storages.BarCodeStorage; var transaction1 = _storages.TransactionStorage.CreateTransaction(_account, _additionalCategory, "Transaction 111111111111", 1m, DateTime.Now, 0, 0, null, null); var transaction2 = _storages.TransactionStorage.CreateTransaction(_account, _category, "Transaction 222222222222", 2m, DateTime.Now, 0, 22.222m, null, null); var transaction3 = _storages.TransactionStorage.CreateTransaction(_account, _category, "Transaction 333333333333", 3m, DateTime.Now, 0, 3.333m, null, null); var barCode1 = new BarCode("111111111111") { Transaction = transaction1 }; var barCode2 = new BarCode("222222222222", true, 6) { Transaction = transaction2 }; var barCode3 = new BarCode("333333333333", true, 5) { Transaction = transaction3 }; barCodeStorage.CreateBarCode(barCode1); barCodeStorage.CreateBarCode(barCode2); barCodeStorage.CreateBarCode(barCode3); }
private void btn_Reissue_Click(object sender, EventArgs e) { c = txt_PaletteQuantity.Text; string strConn = ConfigurationManager.ConnectionStrings["Project"].ConnectionString; DataSet ds = new DataSet(); using (SqlConnection conn = new SqlConnection(strConn)) { conn.Open(); string strSql = String.Format(@"select Barcode_No from Goods_In_History where Barcode_No='{0}'", a); SqlDataAdapter da = new SqlDataAdapter(strSql, conn); da.Fill(ds, "Barcode_No"); conn.Close(); } // Barcode_Service service = new Barcode_Service(); XtraReport1 rpt = new XtraReport1(c, f, t); // rpt.DataSource = service.GetBarcode(cb_Item.Text); rpt.DataSource = ds.Tables["Barcode_No"]; BarCode frm = new BarCode(rpt); //frm.documentViewer1.DocumentSource = rpt; //frm.ShowDialog(); }
private void createBarcode(string stt_) { string fileName; BarCode barcode = new BarCode(); barcode.DisplayChecksum = false; barcode.TildeEnabled = false; barcode.Symbology = KeepAutomation.Barcode.Symbology.Code93; barcode.CodeToEncode = stt_; barcode.X = 1; barcode.Y = 30; barcode.BarCodeWidth = 225; barcode.BarCodeHeight = 81; barcode.DisplayText = false; barcode.DisplayStartStop = true; barcode.BarcodeUnit = KeepAutomation.Barcode.BarcodeUnit.Pixel; barcode.Orientation = KeepAutomation.Barcode.Orientation.Degree0; barcode.DPI = 300; if (!Directory.Exists("Barcode images")) { Directory.CreateDirectory("Barcode images"); } fileName = "Barcode images/" + stt_ + ".png"; barcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Png; barcode.generateBarcodeToImageFile(fileName); picResult.Image = Image.FromFile(fileName); picResult1.Image = Image.FromFile(fileName); }
public ActionResult DeleteConfirmed(int id) { BarCode barCode = db.BarCodes.Find(id); db.BarCodes.Remove(barCode); db.SaveChanges(); return(RedirectToAction("Index")); }
public override global::System.Data.DataSet Clone() { BarCode cln = ((BarCode)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
public Example_11() { PDF pdf = new PDF(new BufferedStream( new FileStream("Example_11.pdf", FileMode.Create))); Font f1 = new Font(pdf, new FileStream( "fonts/OpenSans/OpenSans-Regular.ttf.stream", FileMode.Open, FileAccess.Read), Font.STREAM); Page page = new Page(pdf, Letter.PORTRAIT); BarCode code = new BarCode(BarCode.CODE128, "Hellö, World!"); code.SetLocation(170f, 70f); code.SetModuleLength(0.75f); code.SetFont(f1); code.DrawOn(page); code = new BarCode(BarCode.CODE128, "G86513JVW0C"); code.SetLocation(170f, 170f); code.SetModuleLength(0.75f); code.SetDirection(BarCode.TOP_TO_BOTTOM); code.SetFont(f1); code.DrawOn(page); code = new BarCode(BarCode.CODE39, "WIKIPEDIA"); code.SetLocation(270f, 370f); code.SetModuleLength(0.75f); code.SetFont(f1); code.DrawOn(page); code = new BarCode(BarCode.CODE39, "CODE39"); code.SetLocation(400f, 70f); code.SetModuleLength(0.75f); code.SetDirection(BarCode.TOP_TO_BOTTOM); code.SetFont(f1); code.DrawOn(page); code = new BarCode(BarCode.CODE39, "CODE39"); code.SetLocation(450f, 70f); code.SetModuleLength(0.75f); code.SetDirection(BarCode.BOTTOM_TO_TOP); code.SetFont(f1); code.DrawOn(page); code = new BarCode(BarCode.UPC, "712345678904"); code.SetLocation(450f, 270f); code.SetModuleLength(0.75f); code.SetDirection(BarCode.BOTTOM_TO_TOP); code.SetFont(f1); code.DrawOn(page); pdf.Complete(); }
public void Update(BarCode barCode, long updatedBy) { using (SqlConnection connection = Connection) { connection.Open(); connection.Execute("UPDATE BarCodes set Name = @NAME, Manufacturer = @MANUF where Id = @ID", new { ID = barCode.Id, NAME = barCode.Name, MANUF = barCode.Manufacturer }); } }
private static DocumentRange BuildBarcode(SubDocument document, DocumentPosition start, TemplateItem foundFeld) { if (!string.IsNullOrEmpty(foundFeld.Code)) { using (var barCode = new BarCode()) { barCode.Symbology = Symbology.Code128; barCode.Options.Code128.Charset = Code128CharacterSet.CharsetAuto; barCode.Options.Code128.ShowCodeText = false; barCode.Unit = GraphicsUnit.Point; barCode.CodeText = foundFeld.Code; barCode.CodeBinaryData = Encoding.UTF8.GetBytes(barCode.CodeText); barCode.BackColor = Color.White; barCode.ForeColor = Color.Black; if (foundFeld.BarCodeHeight.HasValue) { barCode.ImageHeight = foundFeld.BarCodeHeight.Value; } if (foundFeld.BarCodeWidth.HasValue) { barCode.ImageWidth = foundFeld.BarCodeWidth.Value; } if (foundFeld.BarCodeRotation.HasValue) { barCode.RotationAngle = foundFeld.BarCodeRotation.Value; } if (foundFeld.BarCodeAutoScale.HasValue) { barCode.AutoSize = foundFeld.BarCodeAutoScale.Value; } barCode.DpiY = foundFeld.BarCodeDpiY; barCode.DpiX = foundFeld.BarCodeDpiX; barCode.Module = foundFeld.Module.HasValue ? foundFeld.Module.Value : 1f; var img = document.Images.Insert(start, barCode.BarCodeImage); if (foundFeld.BarCodeScaleY.HasValue) { img.ScaleY = foundFeld.BarCodeScaleY.Value; } if (foundFeld.BarCodeScaleX.HasValue) { img.ScaleX = foundFeld.BarCodeScaleX.Value; } return(img.Range); } } return(document.InsertText(start, string.Empty)); }
public void GetProductBarCodeTest() { var barcode = new BarCode(SilpoZefir, true, 6); var productBarCode = barcode.GetProductBarCode(); Assert.AreEqual("2710041", productBarCode); }
public void SetSetting(BarCode b) { this.Visibility = Visibility.Visible; this.ShowDisplayAutomation(); //if (a == currentActivity) // return; clearSetting(); initSetting(b.BarCodeData); currentBarCode = b; }
public CashDeskForm(Database.Connection db, ClientSettings s, BarCode.ReaderControl r, Logger.Logging logger) : base(db, s, r, logger, 120000) { InitializeComponent(); userObjects["START"] = new CashDeskStart(db); userObjects["AMOUNT"] = new CashDeskAmount(db); userObjects["VERIFY"] = new CashDeskVerify(db); startupObjectKey = "START"; }
public InfoTermForm(Database.Connection db, ClientSettings s, BarCode.ReaderControl r, Logger.Logging logger) : base(db, s, r, logger, 120000) { InitializeComponent(); userObjects["START"] = new InfoTermStart(db); userObjects["PINCODE"] = new InfoTermPinCode(db); userObjects["SEARCH"] = new InfoTermSearch(db); userObjects["TABLE"] = new InfoTermTable(db); userObjects["FULLINFO"] = new InfoTermFullInfo(db); startupObjectKey = "START"; }
/// <summary> /// 生成条码对象 /// </summary> /// <param name="text">条码内容</param> /// <param name="showCodeText">是否显示内容</param> public static BarCode BuildQRCode(string text, bool showCodeText) { BarCode barCode = new BarCode(); barCode.Symbology = Symbology.QRCode; barCode.CodeText = text; barCode.BackColor = Color.White; barCode.ForeColor = Color.Black; barCode.RotationAngle = 0; barCode.CodeBinaryData = Encoding.UTF8.GetBytes(barCode.CodeText); barCode.Options.QRCode.CompactionMode = QRCodeCompactionMode.Byte; barCode.Options.QRCode.ErrorLevel = QRCodeErrorLevel.Q; barCode.Options.QRCode.ShowCodeText = false; return barCode; }
public ClientForm(Database.Connection db, ClientSettings s, BarCode.ReaderControl r, Logger.Logging l, int inactTime) : base(db) { userObjects = new Dictionary<String, UserObject>(); settings = s; RC = r; logger = l; if (inactTime > 0) { inactivityTimer = new Timer(); inactivityTimer.Tick += new EventHandler(inactivityTimer_Tick); inactivityTimer.Interval = inactTime; } InitializeComponent(); if (RC != null || disableScanner) { RC.BarCodeObject.BarCodeEvent += new EventHandler<BarCode.BarCodeEventArgs>(HandleBarCodeEvent); } }
/// <summary> /// End GridView Space Info Funcations /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /////star of Stroage lots Info Grids Funcations//////////////// protected void gvLot_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "AddMore") { LinkButton lnkbtnAddMoreSetting = gvLot.FooterRow.FindControl("lnkbtnAddMore") as LinkButton; LinkButton lnkbtnAddSetting = gvLot.FooterRow.FindControl("lnkbtnAddSetting") as LinkButton; LinkButton lnkbtnCancelSetting = gvLot.FooterRow.FindControl("lnkbtnCancelSetting") as LinkButton; lnkbtnAddSetting.Visible = true; lnkbtnAddMoreSetting.Visible = false; lnkbtnCancelSetting.Visible = true; TextBox txtLotFooter = gvLot.FooterRow.FindControl("txtLotfooter") as TextBox; //TextBox txtSpace = gvSetting.FooterRow.FindControl("txtSpaces") as TextBox; txtLotFooter.Visible = true; } if (e.CommandName == "AddLotSpace") { lblErrorLane.Text = String.Empty; lblErrorLot.Text = String.Empty; lblErrorSpace.Text = String.Empty; pnlLot.Visible = false; pnlSpace.Visible = true; hidLotId.Value = Convert.ToString(e.CommandArgument); GridViewRow gvr = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); int RemoveAt = gvr.RowIndex; Label lbl = (Label)gvLot.Rows[RemoveAt].FindControl("lbllotnumber"); lblLotNumberSpace.Text = lbl.Text; lblFacilityForSpace.Text = lblfacilityname.Text; LoadRows(1); } if (e.CommandName == "Insert") { try { TextBox txtParkingLot = (TextBox)((GridView)sender).FooterRow.FindControl("txtLotfooter"); int id = 0; Lots lot = new Lots(); lot.LotNumber = txtParkingLot.Text.Trim(); //Guid.NewGuid().ToString().Substring(0, 6); lot.Quantity = 0; lot.OrganizationId = UserOrganizationId;// Convert.ToInt32(ddlStakeholder.SelectedValue); lot.DateCreated = DateTime.Now; lot.IsActive = true; lot.SpaceId = 0; lot.UserID = LoginMemberId;// currentUserInfo.UserId; lot.RoleID = UserOrganizationRoleId;// currentUserInfo.RoleId; lot.IsCompleted = true; BarCode br = new BarCode(); br.DateCreated = DateTime.Now.ToString(); br.OrganizationID = UserOrganizationId; br.BarCodeNumber = GenerateLotSerialNumber(); Guid g = Guid.NewGuid(); string str = g.ToString().Replace("-", ""); if (br.GenerateLotBarCodeImage(str)) { hdnLotBarCodeImageFileName.Value = str + ".gif"; //imgLotBarcode.ImageUrl = String.Format("/images/temp/{0}.Gif", str); //imgLotBarcode.Visible = true; } if (System.IO.File.Exists(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value)))) { br.Image = System.IO.File.ReadAllBytes(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value))); } lot.BarCodeId = BarCode.Insert(br); lot.SubLot = false; lot.Permanent = true; string serialNumber = Lots.insertLot(lot, out id, str); hidLotId.Value = id.ToString(); //lbkSaveLot.Visible = false; dvLotRecord.Visible = true; LoadLots(1); //dvSpaceRecord.Visible = true; } catch (Exception ex) { new SqlLog().InsertSqlLog(0, "addInventory.lnkLotSave_Click", ex); } } else if (e.CommandName == "Edit") { hidLotId.Value = Convert.ToString(e.CommandArgument); lblErrorLot.Text = string.Empty; } else if (e.CommandName == "Delete") { int lotId = Convert.ToInt32(e.CommandArgument); if (!lothaveTire(lotId)) { Lots.deleteLot(lotId); lblErrorLot.Text = string.Empty; LoadLots(1); lblErrorLane.Text = string.Empty; lblErrorLot.Text = string.Empty; lblErrorSpace.Text = string.Empty; } } else if (e.CommandName == "RowInfoPopUp") { LotRowControl.Visible = true; lblErrorLot.Text = String.Empty; //lblErrorSpace.Text = String.Empty; dvpopupfacilityinfo.Visible = true; //pnlLot.Visible = false; hidLotId.Value = Convert.ToString(e.CommandArgument); Lots objLots = new Lots(Conversion.ParseInt(hidLotId.Value)); GridViewRow gvr = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); int RemoveAt = gvr.RowIndex; HiddenField lbl = (HiddenField)gvLot.Rows[RemoveAt].FindControl("hdGVLotNumber"); hdnlotname.Value = lbl.Value; LotRowControl.loadFacilityandLotName(objLots.FacilityName, lbl.Value, hndfacilityId.Value); LotRowControl.loadLotRows(Convert.ToInt32(e.CommandArgument)); } else if (e.CommandName == "Cancel") { gvLot.EditIndex = -1; LoadLots(1); } }
private void HideControlsForTransfer() { int loadid = Conversion.ParseInt(Request.QueryString["LoadId"]); Loads objLoad = new Loads(loadid); BarCode objBarCode = new BarCode(objLoad.BarcodeId); if (ddlLoadType.SelectedValue=="74") { pnlControls.Visible = true; pnlDropDowns.Visible = false; rvfFacility.Enabled = false; rvfLane.Enabled = false; rvfLot.Enabled = false; rvfSpace.Enabled = false; dvSearchHauler1.Visible = false; rfvHaul.Enabled = false; hdnLotBarCodeImageFileName.Value = objBarCode.BarCodeNumber + ".gif"; imgLotBarcode.ImageUrl = String.Format("/images/temp/{0}.Gif", objBarCode.BarCodeNumber); imgLotBarcode.Visible = true; } else if (ddlLoadType.SelectedValue=="72") { pnlControls.Visible = false; pnlDropDowns.Visible = true; BindddlFacility(); BindddlLots(); BindddlSpace(); BindddlLane(); rvfFacility.Enabled = true; rvfLane.Enabled = true; rvfLot.Enabled = true; rvfSpace.Enabled = true; hdnLotBarCodeImageFileName.Value = objBarCode.BarCodeNumber + ".gif"; imgLoadBarCodeTransfer.ImageUrl = String.Format("/images/temp/{0}.Gif", objBarCode.BarCodeNumber); imgLoadBarCodeTransfer.Visible = true; } else { dvSearchHauler1.Visible = true; rfvHaul.Enabled = true; pnlControls.Visible = true; pnlDropDowns.Visible = false; rvfFacility.Enabled = false; rvfLane.Enabled = false; rvfLot.Enabled = false; rvfSpace.Enabled = false; hdnLotBarCodeImageFileName.Value = objBarCode.BarCodeNumber + ".gif"; imgLotBarcode.ImageUrl = String.Format("/images/temp/{0}.Gif", objBarCode.BarCodeNumber); imgLotBarcode.Visible = true; } }
protected void lnkbtnAddCreateLoad_Click(object sender, EventArgs e) { int loadid = Conversion.ParseInt(Request.QueryString["LoadId"]); Loads objLoad = new Loads(loadid); BarCode objBarCode = new BarCode(objLoad.BarcodeId); if (ddlLoadType.SelectedValue == "74") { dvSearchHauler1.Visible = false; rfvHaul.Enabled = false; lblerrorPONumber.Text = string.Empty; lblErrorInvoiceNumber.Text = string.Empty; if (txtponumber.Text.Trim().ToString() == txtsealnumber.Text.Trim().ToString()) { if (txtinvoicenumber.Text.Trim().ToString() == txtladingnumber.Text.Trim().ToString()) { lblerrorPONumber.Text = "PO Number Seal Number are Same. !"; // lblerrorPONumber.Text = string.Empty; lblErrorInvoiceNumber.Text = "Invoice Number Bill Of Lading Number are Same. !"; } else { lblerrorPONumber.Text = "PO Number Seal Number are Same. !"; } } else { lblerrorPONumber.Text = string.Empty; if (txtinvoicenumber.Text.Trim().ToString() == txtladingnumber.Text.Trim().ToString()) { lblErrorInvoiceNumber.Text = "Invoice Number Bill Of Lading Number are Same. !"; } else { lblErrorInvoiceNumber.Text = string.Empty; //BarCode br = new BarCode(); //br.DateCreated = DateTime.Now.ToShortDateString(); //br.OrganizationID = UserOrganizationId; //br.BarCodeNumber = GenerateLotSerialNumber(); //// Guid g = Guid.NewGuid(); //string str = br.BarCodeNumber.ToString().Replace("-", ""); //if (br.GenerateLotBarCodeImage(str)) //{ // hdnLotBarCodeImageFileName.Value = str + ".gif"; // imgLotBarcode.ImageUrl = String.Format("/images/temp/{0}.Gif", str); // imgLotBarcode.Visible = true; // //txtBrand.Focus(); //} //if (System.IO.File.Exists(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value)))) //{ // br.Image = System.IO.File.ReadAllBytes(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value))); //} //lnkContinue.Visible = true; //int barcodeId = BarCode.Insert(br); //int loadId = 0; Loads.updateRecieveLoad(loadid, Conversion.ParseInt(ddlLoadType.SelectedValue),txtponumber.Text, txtinvoicenumber.Text, txtsealnumber.Text, txttrailernumber.Text, txtweight.Text, txtladingnumber.Text, UserOrganizationId,LoginMemberId, objLoad.BarcodeId, objBarCode.BarCodeNumber, txtLoadnumber.Text); Response.Redirect("inventory-load"); } } } else if (ddlLoadType.SelectedValue == "73" || ddlLoadType.SelectedValue == "75") { dvSearchHauler1.Visible = true; rfvHaul.Enabled = true; lblerrorPONumber.Text = string.Empty; lblErrorInvoiceNumber.Text = string.Empty; if (txtponumber.Text.Trim().ToString() == txtsealnumber.Text.Trim().ToString()) { if (txtinvoicenumber.Text.Trim().ToString() == txtladingnumber.Text.Trim().ToString()) { lblerrorPONumber.Text = "PO Number Seal Number are Same. !"; // lblerrorPONumber.Text = string.Empty; lblErrorInvoiceNumber.Text = "Invoice Number Bill Of Lading Number are Same. !"; } else { lblerrorPONumber.Text = "PO Number Seal Number are Same. !"; } } else { lblerrorPONumber.Text = string.Empty; if (txtinvoicenumber.Text.Trim().ToString() == txtladingnumber.Text.Trim().ToString()) { lblErrorInvoiceNumber.Text = "Invoice Number Bill Of Lading Number are Same. !"; } else { lblErrorInvoiceNumber.Text = string.Empty; //BarCode br = new BarCode(); //br.DateCreated = DateTime.Now.ToShortDateString(); //br.OrganizationID = UserOrganizationId; //br.BarCodeNumber = GenerateLotSerialNumber(); //// Guid g = Guid.NewGuid(); //string str = br.BarCodeNumber.ToString().Replace("-", ""); //if (br.GenerateLotBarCodeImage(str)) //{ // hdnLotBarCodeImageFileName.Value = str + ".gif"; // imgLotBarcode.ImageUrl = String.Format("/images/temp/{0}.Gif", str); // imgLotBarcode.Visible = true; // //txtBrand.Focus(); //} //if (System.IO.File.Exists(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value)))) //{ // br.Image = System.IO.File.ReadAllBytes(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value))); //} //lnkbtnAddCreateLoad.Visible = false; ////lnkContinue.Visible = true; //int barcodeId = BarCode.Insert(br); //int loadId = 0; if (Conversion.ParseInt(hidOrgID.Value) == UserOrganizationId) { lblHaulerError.Text = "Please Select Any other Hauler Name"; return; } else { lblHaulerError.Text = string.Empty; Loads.updatePendingAndShipLoad(loadid, Conversion.ParseInt(ddlLoadType.SelectedValue), txtponumber.Text.Trim(), txtinvoicenumber.Text.Trim(), txtsealnumber.Text.Trim(), txttrailernumber.Text.Trim(), txtweight.Text.Trim(), txtladingnumber.Text.Trim(), UserOrganizationId, LoginMemberId, Conversion.ParseInt(hidOrgID.Value), objLoad.BarcodeId, objBarCode.BarCodeNumber, txtLoadnumber.Text.Trim()); if (Conversion.ParseInt(ddlLoadType.SelectedValue) == 75) { SendNotification(loadid); } Response.Redirect("inventory-load"); } } } } else { //BarCode br = new BarCode(); //br.DateCreated = DateTime.Now.ToShortDateString(); //br.OrganizationID = UserOrganizationId; //br.BarCodeNumber = GenerateLotSerialNumber(); //// Guid g = Guid.NewGuid(); //string str = br.BarCodeNumber.ToString().Replace("-", ""); //if (br.GenerateLotBarCodeImage(str)) //{ // hdnLotBarCodeImageFileName.Value = str + ".gif"; // imgLoadBarCodeTransfer.ImageUrl = String.Format("/images/temp/{0}.Gif", str); // imgLoadBarCodeTransfer.Visible = true; // //txtBrand.Focus(); //} //if (System.IO.File.Exists(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value)))) //{ // br.Image = System.IO.File.ReadAllBytes(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value))); //} //lnkbtnAddCreateLoad.Visible = false; //lnkContinue.Visible = true; //int barcodeId = BarCode.Insert(br); //int loadId = 0; if (ddlLoadType.SelectedValue =="72") { Loads.updateTransferLoad(loadid,Conversion.ParseInt(ddlLoadType.SelectedValue), Conversion.ParseInt(ddlLot.SelectedValue), Conversion.ParseInt(ddlSpace.SelectedValue), Conversion.ParseInt(ddlLane.SelectedValue), UserOrganizationId,LoginMemberId,objLoad.BarcodeId, objLoad.LoadNumber); Response.Redirect("inventory-load"); } } /* lot.BarCodeId*/ //int id = BarCode.Insert(br); }
private void LoadEditInfoOnLoadPage() { int loadid = Conversion.ParseInt(Request.QueryString["LoadId"]); Loads objLoad = new Loads(loadid); Utils.GetLookUpData<DropDownList>(ref ddlLoadType, LookUps.LoadType); ddlLoadType.SelectedValue = objLoad.LoadTypeId.ToString(); if (objLoad.LoadTypeId == 73 || objLoad.LoadTypeId == 75) { BarCode objBarCode = new BarCode(objLoad.BarcodeId); txtCompanyName.Text = UserInfo.GetCurrentUserInfo().FullName; txtLoadnumber.Text = objLoad.LoadNumber; hidOrgID.Value = objLoad.HaulerIDNumber.ToString(); txtponumber.Text = objLoad.POnumber; txtinvoicenumber.Text = objLoad.InvoiceNumber; txtsealnumber.Text = objLoad.SealNumber; txttrailernumber.Text = objLoad.TrailerNumber; txthauleridnumber.Text = objLoad.HaulerOrganization; txtweight.Text = objLoad.Weight; txtladingnumber.Text = objLoad.BillOfLandingNumber; hdnLotBarCodeImageFileName.Value = objBarCode.BarCodeNumber + ".gif"; imgLotBarcode.ImageUrl = String.Format("/images/temp/{0}.Gif", objBarCode.BarCodeNumber); imgLotBarcode.Visible = true; } else if (objLoad.LoadTypeId == 72) { BarCode objBarCode = new BarCode(objLoad.BarcodeId); pnlControls.Visible = false; pnlDropDowns.Visible = true; BindddlFacility(); BindddlLane(); txtCompanyName.Text = UserInfo.GetCurrentUserInfo().FullName; ddlFacility.SelectedValue = objLoad.FacilityId.ToString(); BindddlLots(); ddlLot.SelectedValue = objLoad.LotID.ToString(); BindddlSpace(); ddlSpace.SelectedValue = objLoad.SpaceId.ToString(); BindddlLane(); ddlLane.SelectedValue = objLoad.Lane; hdnLotBarCodeImageFileName.Value = objBarCode.BarCodeNumber + ".gif"; imgLoadBarCodeTransfer.ImageUrl = String.Format("/images/temp/{0}.Gif", objBarCode.BarCodeNumber); imgLoadBarCodeTransfer.Visible = true; } else { BarCode objBarCode = new BarCode(objLoad.BarcodeId); pnlControls.Visible = true; pnlDropDowns.Visible = false; dvSearchHauler1.Visible = false; txtCompanyName.Text = UserInfo.GetCurrentUserInfo().FullName; txtLoadnumber.Text = objLoad.LoadNumber; txtponumber.Text = objLoad.POnumber; txtinvoicenumber.Text = objLoad.InvoiceNumber; txtsealnumber.Text = objLoad.SealNumber; txttrailernumber.Text = objLoad.TrailerNumber; txthauleridnumber.Text = objLoad.HaulerOrganization; txtweight.Text = objLoad.Weight; txtladingnumber.Text = objLoad.BillOfLandingNumber; hdnLotBarCodeImageFileName.Value = objBarCode.BarCodeNumber + ".gif"; imgLotBarcode.ImageUrl = String.Format("/images/temp/{0}.Gif", objBarCode.BarCodeNumber); imgLotBarcode.Visible = true; hidOrgID.Value = objLoad.HaulerIDNumber.ToString(); } }
protected void btnGenerateBarCode_Click(object sender, EventArgs e) { txtDOTPlant.Attributes.Add("prevValue", txtDOTPlant.Text); txtDOTSize.Attributes.Add("prevValue", txtDOTSize.Text); txtDOTBrand.Attributes.Add("prevValue", txtDOTBrand.Text); txtDOTWeek.Attributes.Add("prevValue", txtDOTWeek.Text); txtDOTYear.Attributes.Add("prevValue", txtDOTYear.Text); if (ValidateDotCode()) { BarCode br = new BarCode(); br.DateCreated = DateTime.Now.ToShortDateString(); br.OrganizationID = UserOrganizationId; br.BarCodeNumber = GenerateLotSerialNumber(); string str = br.BarCodeNumber.ToString().Replace("-", ""); // Guid g = Guid.NewGuid(); if (br.GenerateLotBarCodeImage(str)) { hdnBarCodeImageFileName.Value = str + ".gif"; imgBarCode.ImageUrl = String.Format("/Images/temp/{0}.Gif", str); imgBarCode.Visible = true; txtBrand.Focus(); } else { if (hdnBarCodeImageFileName.Value != "") { if (System.IO.File.Exists(Server.MapPath(String.Format("/Images/temp/{0}", hdnBarCodeImageFileName.Value)))) { System.IO.File.Delete(Server.MapPath(String.Format("/Images/temp/{0}", hdnBarCodeImageFileName.Value))); } hdnBarCodeImageFileName.Value = ""; } imgBarCode.Visible = false; } } //ScriptManager.RegisterStartupScript(this, this.GetType(), "SetRecycleStatebtnGenerateBarCode_Click", String.Format("ShowInventoryForm();SetRecycleState({0});", ddlTireState.SelectedValue), true); }
private void GenerateBarCodeForProduct() { BarCode br = new BarCode(); br.DateCreated = DateTime.Now.ToShortDateString(); br.OrganizationID = UserOrganizationId; br.BarCodeNumber = GenerateLotSerialNumber(); string str = br.BarCodeNumber.ToString().Replace("-", ""); if (br.GenerateLotBarCodeImage(str)) { hdnBarCodeImageFileName.Value = str + ".gif"; } }
private void AddNewLOT() { try { // if (string.IsNullOrEmpty(txtLotNmber.Text)) if (string.IsNullOrEmpty(hidLotId.Value)) { if (txtLotNmber.Text == "Create New Lot") { txtLotNmber.Text = string.Empty; } int id = 0; Lots lot = new Lots(); string lotNum = Guid.NewGuid().ToString().Substring(0, 6); lblLotNumber.Text = "Lot# " + lotNum; lot.LotNumber = lotNum;//txtLotNmber.Text; lot.Quantity = string.IsNullOrEmpty(txtQuantity.Text) ? 0 : Convert.ToInt32(txtQuantity.Text); lot.OrganizationId = UserOrganizationId;// Convert.ToInt32(ddlStakeholder.SelectedValue); lot.DateCreated = DateTime.Now;//DateTime.Parse(txtdate.Text.ToString()); lot.IsActive = true; lot.SpaceId = 1; lot.UserID = LoginMemberId;// currentUserInfo.UserId; lot.RoleID = UserOrganizationRoleId;// currentUserInfo.RoleId; lot.IsCompleted = false; lot.ProductCategoryId = CatId; BarCode br = new BarCode(); br.DateCreated = DateTime.Now.ToShortDateString(); br.OrganizationID = UserOrganizationId; br.BarCodeNumber = GenerateLotSerialNumber(); // Guid g = Guid.NewGuid(); string str = br.BarCodeNumber.ToString().Replace("-", ""); if (br.GenerateLotBarCodeImage(str)) { hdnLotBarCodeImageFileName.Value = str + ".gif"; imgLotBarcode.ImageUrl = String.Format("/Images/temp/{0}.Gif", str); imgLotBarcode.Visible = true; imgProductLot.ImageUrl = String.Format("/Images/temp/{0}.Gif", str); imgProductLot.Visible = true; } if (System.IO.File.Exists(Server.MapPath(String.Format("/Images/temp/{0}", hdnLotBarCodeImageFileName.Value)))) { br.Image = System.IO.File.ReadAllBytes(Server.MapPath(String.Format("/Images/temp/{0}", hdnLotBarCodeImageFileName.Value))); } lot.BarCodeId = BarCode.Insert(br); if (chkSublot.Checked) lot.SubLot = true; else lot.SubLot = false; string serialNumber = Lots.insertLot(lot, out id, str); hidLotId.Value = id.ToString(); imgLotBarcode.Visible = true; imgLotBarcode.ImageUrl = "/Handlers/GetBarcodeImage.ashx?LotID=" + id; imgProductLot.Visible = true; imgProductLot.ImageUrl = "/Handlers/GetBarcodeImage.ashx?LotID=" + id; // lblLotNumber.Text += " " + txtLotNmber.Text; lblLotNumber.Text = "Lot# " + lotNum; lblProductLot.Text = "Lot# " + lotNum; lnkSingle.Visible = false; //ScriptManager.RegisterStartupScript(this, this.GetType(), "", "HideLotSaveLnk();", true); if (chkSublot.Checked) { Lots.updateSubLotTires(Convert.ToInt32(hidSelectedLot.Value), id, Session["SubLotTireIds"].ToString()); Session["SubLotTireIds"] = ""; Response.Redirect("lotinfo"); } else { lnkContinue.Visible = true; } } else { if (!string.IsNullOrEmpty(hidSelectedLot.Value)) hidLotId.Value = hidSelectedLot.Value; lblLotNumber.Text = "Lot# " + Lots.getLotNumberByLotId(Convert.ToInt32(hidLotId.Value)); imgLotBarcode.Visible = true; imgLotBarcode.ImageUrl = "/Handlers/GetBarcodeImage.ashx?LotID=" + hidLotId.Value; } //dvLot.Visible = false; //dvInventoryAdd.Visible = true; gvAllTire.DataSource = Tire.getCompleteTireInfo_ByLotID(Convert.ToInt32(hidLotId.Value)); gvAllTire.DataBind(); } catch (Exception ex) { new SqlLog().InsertSqlLog(0, "addInventory.lnkLotSave_Click", ex); } }
protected void lnkbtnAddCreateLoad_Click(object sender, EventArgs e) { if (ddlLoadType.SelectedValue == "74") { dvSearchHauler.Visible = false; rfvHaul.Enabled = false; lblerrorPONumber.Text = string.Empty; lblErrorInvoiceNumber.Text = string.Empty; if (txtponumber.Text.Trim().ToString() == txtsealnumber.Text.Trim().ToString()) { if (txtinvoicenumber.Text.Trim().ToString() == txtladingnumber.Text.Trim().ToString()) { lblerrorPONumber.Text = "PO Number Seal Number are Same. !"; // lblerrorPONumber.Text = string.Empty; lblErrorInvoiceNumber.Text = "Invoice Number Bill Of Lading Number are Same. !"; } else { lblerrorPONumber.Text = "PO Number Seal Number are Same. !"; } } else { lblerrorPONumber.Text = string.Empty; if (txtinvoicenumber.Text.Trim().ToString() == txtladingnumber.Text.Trim().ToString()) { lblErrorInvoiceNumber.Text = "Invoice Number Bill Of Lading Number are Same. !"; } else { lblErrorInvoiceNumber.Text = string.Empty; BarCode br = new BarCode(); br.DateCreated = DateTime.Now.ToShortDateString(); br.OrganizationID = UserOrganizationId; br.BarCodeNumber = GenerateLotSerialNumber(); // Guid g = Guid.NewGuid(); string str = br.BarCodeNumber.ToString().Replace("-", ""); if (br.GenerateLotBarCodeImage(str)) { hdnLotBarCodeImageFileName.Value = str + ".gif"; imgLotBarcode.ImageUrl = String.Format("/images/temp/{0}.Gif", str); imgLotBarcode.Visible = true; //txtBrand.Focus(); } if (System.IO.File.Exists(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value)))) { br.Image = System.IO.File.ReadAllBytes(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value))); } lnkbtnAddCreateLoad.Visible = false; lnkContinue.Visible = true; int barcodeId = BarCode.Insert(br); int loadId = 0; loadId = Loads.InsertRecieveLoad(74, txtponumber.Text, txtinvoicenumber.Text, txtsealnumber.Text, txttrailernumber.Text, txtweight.Text, txtladingnumber.Text, UserOrganizationId, LoginMemberId, barcodeId, str, txtLoadnumber.Text, CatId); Response.Redirect("addInventory?LoadId=" + loadId); } } } else if (ddlLoadType.SelectedValue == "73" || ddlLoadType.SelectedValue == "75") { dvSearchHauler.Visible = true; rfvHaul.Enabled = true; lblerrorPONumber.Text = string.Empty; lblErrorInvoiceNumber.Text = string.Empty; if (txtponumber.Text.Trim().ToString() == txtsealnumber.Text.Trim().ToString()) { if (txtinvoicenumber.Text.Trim().ToString() == txtladingnumber.Text.Trim().ToString()) { lblerrorPONumber.Text = "PO Number Seal Number are Same. !"; // lblerrorPONumber.Text = string.Empty; lblErrorInvoiceNumber.Text = "Invoice Number Bill Of Lading Number are Same. !"; } else { lblerrorPONumber.Text = "PO Number Seal Number are Same. !"; } } else { lblerrorPONumber.Text = string.Empty; if (txtinvoicenumber.Text.Trim().ToString() == txtladingnumber.Text.Trim().ToString()) { lblErrorInvoiceNumber.Text = "Invoice Number Bill Of Lading Number are Same. !"; } else { lblErrorInvoiceNumber.Text = string.Empty; BarCode br = new BarCode(); br.DateCreated = DateTime.Now.ToShortDateString(); br.OrganizationID = UserOrganizationId; br.BarCodeNumber = GenerateLotSerialNumber(); // Guid g = Guid.NewGuid(); string str = br.BarCodeNumber.ToString().Replace("-", ""); if (br.GenerateLotBarCodeImage(str)) { hdnLotBarCodeImageFileName.Value = str + ".gif"; imgLotBarcode.ImageUrl = String.Format("/images/temp/{0}.Gif", str); imgLotBarcode.Visible = true; //txtBrand.Focus(); } if (System.IO.File.Exists(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value)))) { br.Image = System.IO.File.ReadAllBytes(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value))); } lnkbtnAddCreateLoad.Visible = false; lnkContinue.Visible = true; int barcodeId = BarCode.Insert(br); int loadId = 0; if (ddlLoadType.SelectedItem.Text.ToLower().Contains("transfer")) { string loadname = Guid.NewGuid().ToString().Substring(0, 6); loadId = Loads.InsertLoad(Conversion.ParseInt(ddlLoadType.SelectedValue), string.Empty, string.Empty, string.Empty, string.Empty, 0, string.Empty, string.Empty, UserOrganizationId, barcodeId, str, loadname, LoginMemberId, CatId, Conversion.ParseInt(ddlLot.SelectedValue), Conversion.ParseInt(ddlSpace.SelectedValue), Conversion.ParseInt(ddlLane.SelectedValue)); } else loadId = Loads.InsertLoad(Conversion.ParseInt(ddlLoadType.SelectedValue), txtponumber.Text.Trim(), txtinvoicenumber.Text.Trim(), txtsealnumber.Text.Trim(), txttrailernumber.Text.Trim(), Conversion.ParseInt(hidOrgID.Value), txtweight.Text.Trim(), txtladingnumber.Text.Trim(), UserOrganizationId, barcodeId, str, txtLoadnumber.Text.Trim(), LoginMemberId, CatId); Session["loadId"] = loadId.ToString(); // success messages are dispaleyed here lblerrorPONumber.Text = "PO Number Seal Number are Same. !"; } } // if (txtinvoicenumber.Text.Trim().ToString() == txtladingnumber.Text.Trim().ToString()) //{ // lblerrorPONumber.Text = string.Empty; // lblErrorInvoiceNumber.Text = "Invoice Number Bill Of Lading Number are Same. !"; //} //else //{ //} } else { BarCode br = new BarCode(); br.DateCreated = DateTime.Now.ToShortDateString(); br.OrganizationID = UserOrganizationId; br.BarCodeNumber = GenerateLotSerialNumber(); // Guid g = Guid.NewGuid(); string str = br.BarCodeNumber.ToString().Replace("-", ""); if (br.GenerateLotBarCodeImage(str)) { hdnLotBarCodeImageFileName.Value = str + ".gif"; imgLoadBarCodeTransfer.ImageUrl = String.Format("/images/temp/{0}.Gif", str); imgLoadBarCodeTransfer.Visible = true; //txtBrand.Focus(); } if (System.IO.File.Exists(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value)))) { br.Image = System.IO.File.ReadAllBytes(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value))); } lnkbtnAddCreateLoad.Visible = false; lnkContinue.Visible = true; int barcodeId = BarCode.Insert(br); int loadId = 0; if (ddlLoadType.SelectedItem.Text.ToLower().Contains("transfer")) { string loadname = Guid.NewGuid().ToString().Substring(0, 6); loadId = Loads.InsertLoad(Conversion.ParseInt(ddlLoadType.SelectedValue), string.Empty, string.Empty, string.Empty, string.Empty, 0, string.Empty, string.Empty, UserOrganizationId, barcodeId, str, loadname, LoginMemberId, CatId, Conversion.ParseInt(ddlLot.SelectedValue), Conversion.ParseInt(ddlSpace.SelectedValue), Conversion.ParseInt(ddlLane.SelectedValue)); } else loadId = Loads.InsertLoad(Conversion.ParseInt(ddlLoadType.SelectedValue), txtponumber.Text.Trim(), txtinvoicenumber.Text.Trim(), txtsealnumber.Text.Trim(), txttrailernumber.Text.Trim(), Conversion.ParseInt(hidOrgID.Value), txtweight.Text.Trim(), txtladingnumber.Text.Trim(), UserOrganizationId, barcodeId, str, txtLoadnumber.Text.Trim(), LoginMemberId, CatId); Session["loadId"] = loadId.ToString(); } /* lot.BarCodeId*/ //int id = BarCode.Insert(br); }
public void AddBarCode(string message, BarcodeType type, string encoding) { Barcode = new BarCode() { Type = type, Message = message, Encoding = encoding, AlternateText = null }; }
/// <summary> /// Storage Lot InfO Next button /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbkNextLot_Click(object sender, EventArgs e) { try { if( Lots.getAllLotStatusByOrganizationIdAndLotNumber(UserOrganizationId,Conversion.ParseInt(hndfacilityId.Value),txtParkingLot.Text.Trim())>0) { lblErrorLot.Text = "Storage Lot Already Exist!"; lblErrorLot.Visible = true; lblErrorLot.CssClass = "alert-danger custom-absolute-alert"; ScriptManager.RegisterStartupScript(this, GetType(), "fadeOut", "fadeOut();", true); return; } lblErrorLane.Text = string.Empty; lblErrorLot.Text = string.Empty; lblErrorSpace.Text = string.Empty; int id = 0; Lots lot = new Lots(); lot.LotNumber = txtParkingLot.Text.Trim(); //Guid.NewGuid().ToString().Substring(0, 6); lot.Quantity = 0; lot.OrganizationId = UserOrganizationId;// Convert.ToInt32(ddlStakeholder.SelectedValue); lot.DateCreated = DateTime.Now; lot.IsActive = true; lot.SpaceId = 0; lot.UserID = LoginMemberId;// currentUserInfo.UserId; lot.RoleID = UserOrganizationRoleId;// currentUserInfo.RoleId; lot.IsCompleted = true; BarCode br = new BarCode(); br.DateCreated = DateTime.Now.ToString(); br.OrganizationID = UserOrganizationId; br.BarCodeNumber = GenerateLotSerialNumber(); // Guid g = Guid.NewGuid(); string str = br.BarCodeNumber.ToString().Replace("-", ""); if (br.GenerateLotBarCodeImage(str)) { hdnLotBarCodeImageFileName.Value = str + ".gif"; //imgLotBarcode.ImageUrl = String.Format("/images/temp/{0}.Gif", str); //imgLotBarcode.Visible = true; } if (System.IO.File.Exists(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value)))) { br.Image = System.IO.File.ReadAllBytes(Server.MapPath(String.Format("/images/temp/{0}", hdnLotBarCodeImageFileName.Value))); } lot.BarCodeId = BarCode.Insert(br); lot.SubLot = false; lot.Permanent = true; lot.ProductCategoryId = CatId; string serialNumber; if (Request.QueryString["fid"] != null) { int facilityid = Convert.ToInt32(Request.QueryString["fid"]); serialNumber = Lots.insertLot(lot, out id, str, facilityid); LoadLots(1, facilityid); hidLotId.Value = id.ToString(); dvLotRecord.Visible = true; if (id > 0) { lblErrorLot.Text = "Storage Lot added successfully!"; lblErrorLot.Visible = true; lblErrorLot.CssClass = "alert-success custom-absolute-alert"; ScriptManager.RegisterStartupScript(this, GetType(), "fadeOut", "fadeOut();", true); txtParkingLot.Text = string.Empty; } } else if (Request.QueryString["fids"] != null) { int facilityid = Convert.ToInt32(Request.QueryString["fids"]); serialNumber = Lots.insertLot(lot, out id, str, facilityid); LoadLots(1, facilityid); hidLotId.Value = id.ToString(); dvLotRecord.Visible = true; if (id > 0) { lblErrorLot.Text = "Storage Lot added successfully!"; lblErrorLot.CssClass = "alert-success custom-absolute-alert"; lblErrorLot.Visible = true; ScriptManager.RegisterStartupScript(this, GetType(), "fadeOut", "fadeOut();", true); txtParkingLot.Text = string.Empty; } } else { serialNumber = Lots.insertLot(lot, out id, str, 0); hidLotId.Value = id.ToString(); dvLotRecord.Visible = true; if (id > 0) { lblErrorLot.Text = "Storage Lot added successfully!"; ScriptManager.RegisterStartupScript(this, GetType(), "fadeOut", "fadeOut();", true); lblErrorLot.CssClass = "alert-success custom-absolute-alert"; lblErrorLot.Visible = true; txtParkingLot.Text = string.Empty; } LoadLots(1); } // Response.Redirect("lots"); //dvSpaceRecord.Visible = true; } catch (Exception ex) { new SqlLog().InsertSqlLog(0, "addInventory.lnkLotSave_Click", ex); } }
public void Add(BarCode newBarCode) { List.Add(newBarCode); }
public void Push(string thisBarCode) { int indexCount = 0; int activeIndex = -1; BarCode tempBarCode = new BarCode(); string currBarCode; int currCount; tempBarCode = new BarCode(); tempBarCode.barCode = thisBarCode; tempBarCode.count = 1; if (thisBarCode.Length > 0) { foreach (BarCode bc in List) { if (bc.barCode == thisBarCode) { bc.incrBarCode(); activeIndex = indexCount; break; } indexCount++; } // BarCode found in list ... if (activeIndex >= 0) { tempBarCode = (BarCode)List[activeIndex]; currBarCode = tempBarCode.barCode; currCount = tempBarCode.count; } else // Barcode is not found, Add it to bottom { List.Add(tempBarCode); activeIndex = List.Count - 1; } // Move current entry to top ... for (int iCount = activeIndex; iCount > 0; iCount--) { List[iCount] = List[iCount - 1]; } List[0] = tempBarCode; } }
private static BarCode CreateBarCode() { var barCode = new BarCode { BarCodeValue = "000001032", DisplayStr = "Souvenir (Qx059)", AdditionalStr = "$ 138.00", UnitPrice = "$ 138.00" }; return barCode; }
public void AddBarCode(string message, BarcodeType type, string encoding) { Barcode = new BarCode(); Barcode.Type = type; Barcode.Message = message; Barcode.Encoding = encoding; Barcode.AlternateText = null; }
void HandleBarCodeEvent(object sender, BarCode.BarCodeEventArgs e) { if (currentObjectKey != null && userObjects[currentObjectKey] != null) { UserObject uo = userObjects[currentObjectKey]; if (uo.InvokeRequired) { uo.Invoke((MethodInvoker)delegate { uo.BarCodeScanned(e.Code); }); } else { uo.BarCodeScanned(e.Code); } } }