// Remarks private void LoadProductRemarks() { string sql = "ProductId = '" + productId.ToString() + "'"; ProductRemarks oRemarks = ProductRemarks.LoadWhere(sql); if (oRemarks != null) { txtBin_X.Text = oRemarks.BinX; txtBin_Y.Text = oRemarks.BinY; txtBin_Z.Text = oRemarks.BinZ; chkRetailItem.Checked = oRemarks.DownloadToShop; chkOffDisplayItem.Checked = oRemarks.OffDisplayItem; chkCounterItem.Checked = oRemarks.DownloadToCounter; txtRemarks1.Text = oRemarks.REMARK1; txtRemarks2.Text = oRemarks.REMARK2; txtRemarks3.Text = oRemarks.REMARK3; txtRemarks4.Text = oRemarks.REMARK4; txtRemarks5.Text = oRemarks.REMARK5; txtRemarks6.Text = oRemarks.REMARK6; txtMemo.Text = oRemarks.Notes; txtPhoto.Text = oRemarks.Photo; } }
private void SaveProductRemarks(Guid productId) { string sql = "ProductId = '" + productId.ToString() + "'"; ProductRemarks oRemarks = ProductRemarks.LoadWhere(sql); if (oRemarks == null) { oRemarks = new ProductRemarks(); oRemarks.ProductId = productId; } oRemarks.BinX = general.txtBin_X.Text; oRemarks.BinY = general.txtBin_Y.Text; oRemarks.BinZ = general.txtBin_Z.Text; oRemarks.DownloadToShop = general.chkRetailItem.Checked; oRemarks.OffDisplayItem = general.chkOffDisplayItem.Checked; oRemarks.DownloadToCounter = general.chkCounterItem.Checked; oRemarks.REMARK1 = general.txtRemarks1.Text; oRemarks.REMARK2 = general.txtRemarks2.Text; oRemarks.REMARK3 = general.txtRemarks3.Text; oRemarks.REMARK4 = general.txtRemarks4.Text; oRemarks.REMARK5 = general.txtRemarks5.Text; oRemarks.REMARK6 = general.txtRemarks6.Text; oRemarks.Save(); }
private void SaveProductRemarks(Guid productId) { string sql = "ProductId = '" + productId.ToString() + "'"; ProductRemarks oRemarks = ProductRemarks.LoadWhere(sql); if (oRemarks == null) { oRemarks = new ProductRemarks(); oRemarks.ProductId = productId; } oRemarks.BinX = txtBin_X.Text; oRemarks.BinY = txtBin_Y.Text; oRemarks.BinZ = txtBin_Z.Text; oRemarks.DownloadToShop = chkRetailItem.Checked; oRemarks.OffDisplayItem = chkOffDisplayItem.Checked; oRemarks.DownloadToCounter = chkCounterItem.Checked; oRemarks.REMARK1 = txtRemarks1.Text; oRemarks.REMARK2 = txtRemarks2.Text; oRemarks.REMARK3 = txtRemarks3.Text; oRemarks.REMARK4 = txtRemarks4.Text; oRemarks.REMARK5 = txtRemarks5.Text; oRemarks.REMARK6 = txtRemarks6.Text; oRemarks.Notes = txtNotes.Text; oRemarks.Photo = txtPicFileName.Text; oRemarks.Save(); }
private void DeleteRemarks(string sql) { ProductRemarksCollection oRemarksList = ProductRemarks.LoadCollection(sql); foreach (ProductRemarks oRemarks in oRemarksList) { oRemarks.Delete(); } }
private void ShowRec() { string sql = "ProductId = '" + _ProductId.ToString() + "'"; ProductRemarks oRemarks = ProductRemarks.LoadWhere(sql); if (oRemarks != null) { txtMemo.Text = oRemarks.Notes; txtPicFileName.Text = oRemarks.Photo; } }
// Remarks private void LoadProductRemarks() { string sql = "ProductId = '" + _ProductId.ToString() + "'"; ProductRemarks oRemarks = ProductRemarks.LoadWhere(sql); if (oRemarks != null) { general.txtBin_X.Text = oRemarks.BinX; general.txtBin_Y.Text = oRemarks.BinY; general.txtBin_Z.Text = oRemarks.BinZ; general.chkRetailItem.Checked = oRemarks.DownloadToShop; general.chkOffDisplayItem.Checked = oRemarks.OffDisplayItem; general.chkCounterItem.Checked = oRemarks.DownloadToCounter; general.txtRemarks1.Text = oRemarks.REMARK1; general.txtRemarks2.Text = oRemarks.REMARK2; general.txtRemarks3.Text = oRemarks.REMARK3; general.txtRemarks4.Text = oRemarks.REMARK4; general.txtRemarks5.Text = oRemarks.REMARK5; general.txtRemarks6.Text = oRemarks.REMARK6; //misc.txtMemo.Text = oRemarks.Notes; // 2009.12.29 david: 如果为网络路径,则直接显示。 //string photoPath = Path.Combine(Path.Combine(Context.Config.GetDirectory("RTImages"), "Product"), oRemarks.Photo); //try //{ // Uri uri = new Uri(oRemarks.Photo); // if (uri.IsUnc) // { // misc.imgProductPic.ImageName = uri.LocalPath; // } // else // { // misc.imgProductPic.ImageName = photoPath; // } //} //catch { } //finally //{ // misc.imgProductPic.ImageName = photoPath; //} //misc.txtPicFileName.Text = oRemarks.Photo; } }
private void SaveProductRemarks(Guid productId) { string sql = "ProductId = '" + productId.ToString() + "'"; ProductRemarks oRemarks = ProductRemarks.LoadWhere(sql); if (oRemarks == null) { oRemarks = new ProductRemarks(); oRemarks.ProductId = productId; } oRemarks.BinX = general.txtBin_X.Text; oRemarks.BinY = general.txtBin_Y.Text; oRemarks.BinZ = general.txtBin_Z.Text; oRemarks.DownloadToShop = general.chkRetailItem.Checked; oRemarks.OffDisplayItem = general.chkOffDisplayItem.Checked; oRemarks.DownloadToCounter = general.chkCounterItem.Checked; oRemarks.REMARK1 = general.txtRemarks1.Text; oRemarks.REMARK2 = general.txtRemarks2.Text; oRemarks.REMARK3 = general.txtRemarks3.Text; oRemarks.REMARK4 = general.txtRemarks4.Text; oRemarks.REMARK5 = general.txtRemarks5.Text; oRemarks.REMARK6 = general.txtRemarks6.Text; oRemarks.Notes = misc.txtMemo.Text; if (string.IsNullOrEmpty(oRemarks.Photo)) { oRemarks.Photo = misc.txtPicFileName.Text; } else if (oRemarks.Photo != misc.txtPicFileName.Text) { oRemarks.Photo5 = oRemarks.Photo4; oRemarks.Photo4 = oRemarks.Photo3; oRemarks.Photo3 = oRemarks.Photo2; oRemarks.Photo2 = oRemarks.Photo; oRemarks.Photo = misc.txtPicFileName.Text; } oRemarks.Save(); }
private Guid SaveGeneralInfo(Guid productId) { Guid result = System.Guid.Empty; RT2008.DAL.Product oItem = RT2008.DAL.Product.Load(productId); if (oItem != null) { string sql = "ProductId = '" + productId.ToString() + "'"; ProductRemarks oRemarks = ProductRemarks.LoadWhere(sql); if (chkUpdateClass1.Checked) { oItem.CLASS1 = cboClass1.Text; } if (chkUpdateClass2.Checked) { oItem.CLASS2 = cboClass2.Text; } if (chkUpdateClass3.Checked) { oItem.CLASS3 = cboClass3.Text; } if (chkUpdateClass4.Checked) { oItem.CLASS4 = cboClass4.Text; } if (chkUpdateClass5.Checked) { oItem.CLASS5 = cboClass5.Text; } if (chkUpdateClass6.Checked) { oItem.CLASS6 = cboClass6.Text; } if (chkUpdateProductName.Checked) { oItem.ProductName = txtProductName.Text; } if (chkUpdateProductNameChs.Checked) { oItem.ProductName_Chs = txtProductNameChs.Text; } if (chkUpdateProductNameCht.Checked) { oItem.ProductName_Cht = txtProductNameCht.Text; } if (chkUpdateRemarks.Checked) { oItem.Remarks = txtRemarks.Text; } // 2013.12.24 paulus: dbo.Prodct 也有對應的 fields if (chkUpdateWholesales.Checked) { oItem.WholesalePrice = Convert.ToDecimal((txtWholesalesPrice.Text == string.Empty) ? "0" : txtWholesalesPrice.Text); } if (chkUpdateOriginalRetail.Checked) { oItem.OriginalRetailPrice = Convert.ToDecimal((txtOriginalRetailPrice.Text == string.Empty) ? "0" : txtOriginalRetailPrice.Text); } if (chkUpdateCurrentRetail.Checked) { oItem.RetailPrice = Convert.ToDecimal((txtCurrentRetailPrice.Text == string.Empty) ? "0" : txtCurrentRetailPrice.Text); } if (chkUpdateRetailDiscount.Checked) { oItem.NormalDiscount = Convert.ToDecimal((txtRetailDiscount.Text == string.Empty) ? "0" : txtRetailDiscount.Text); } if (chkUpdateUnit.Checked) { oItem.UOM = txtUnit.Text; } if (chkUpdateNature.Checked) { oItem.NatureId = new Guid(cboNature.SelectedValue.ToString()); } if (chkUpdateVendorItem.Checked) { oItem.AlternateItem = txtVendorItemNum.Text; // Vendor Item Number } if (chkUpdateReorderLevel.Checked) { oItem.ReorderLevel = Convert.ToDecimal((txtReorderLevel.Text == string.Empty) ? "0" : txtReorderLevel.Text); } if (chkUpdateReorderQuantiry.Checked) { oItem.ReorderQty = Convert.ToDecimal((txtReorderQuantity.Text == string.Empty) ? "0" : txtReorderQuantity.Text); } //tabDiscountInfo if (chkFixedPriceItem.Checked) { oItem.FixedPriceItem = (cboFixedPriceItem.SelectedIndex == 1) ? true : false; } // Download Packets oItem.DownloadToPOS = oRemarks.DownloadToShop; oItem.DownloadToCounter = oRemarks.DownloadToCounter; if (chkUpdateRetailItem.Checked) { oItem.DownloadToPOS = chkRetailItem.Checked; } if (chkUpdateCounterItem.Checked) { oItem.DownloadToCounter = chkCounterItem.Checked; } // Download Packets if (chkRetailItem.Checked) { oItem.DownloadToPOS = true; } if (chkCounterItem.Checked) { oItem.DownloadToCounter = true; } oItem.ModifiedBy = DAL.Common.Config.CurrentUserId; oItem.ModifiedOn = DateTime.Now; oItem.Save(); // Appendix / Class SaveProductCode(oItem.ProductId, new Guid(cboClass1.SelectedValue.ToString()), new Guid(cboClass2.SelectedValue.ToString()), new Guid(cboClass3.SelectedValue.ToString()), new Guid(cboClass4.SelectedValue.ToString()), new Guid(cboClass5.SelectedValue.ToString()), new Guid(cboClass6.SelectedValue.ToString())); // Product Price SaveProductSupplement(oItem.ProductId); SaveProductPrice(oItem.ProductId); // Remarks SaveProductRemarks(oItem.ProductId); result = oItem.ProductId; } return(result); }
private void SaveProductRemarks(Guid productId) { string sql = "ProductId = '" + productId.ToString() + "'"; ProductRemarks oRemarks = ProductRemarks.LoadWhere(sql); if (oRemarks != null) { if (chkUpdateBinX.Checked) { oRemarks.BinX = txtBin_X.Text; } if (chkUpdateBinY.Checked) { oRemarks.BinY = txtBin_Y.Text; } if (chkUpdateBinZ.Checked) { oRemarks.BinZ = txtBin_Z.Text; } if (chkUpdateRetailItem.Checked) { oRemarks.DownloadToShop = chkRetailItem.Checked; } if (chkUpdateOffDisplayItem.Checked) { oRemarks.OffDisplayItem = chkOffDisplayItem.Checked; } if (chkUpdateCounterItem.Checked) { oRemarks.DownloadToCounter = chkCounterItem.Checked; } if (chkUpdateRemarks1.Checked) { oRemarks.REMARK1 = txtRemarks1.Text; } if (chkUpdateRemarks2.Checked) { oRemarks.REMARK2 = txtRemarks2.Text; } if (chkUpdateRemarks3.Checked) { oRemarks.REMARK3 = txtRemarks3.Text; } if (chkUpdateRemarks4.Checked) { oRemarks.REMARK4 = txtRemarks4.Text; } if (chkUpdateRemarks5.Checked) { oRemarks.REMARK5 = txtRemarks5.Text; } if (chkUpdateRemarks6.Checked) { oRemarks.REMARK6 = txtRemarks6.Text; } if (chkUpdatePhoto.Checked) { oRemarks.Photo = txtPhoto.Text; } if (chkUpdateMemo.Checked) { oRemarks.Notes = txtMemo.Text; } oRemarks.Save(); } }