示例#1
0
        private void SaveQtyInfo()
        {
            RT2020.DAL.Product oItem = RT2020.DAL.Product.Load(this.ProductId);
            if (oItem != null)
            {
                oItem.MaxOnLoanQty = Convert.ToDecimal((quantity.txtMaxOLNQty.Text == string.Empty) ? "0" : quantity.txtMaxOLNQty.Text);

                oItem.ModifiedBy = RT2020.DAL.Common.Config.CurrentUserId;
                oItem.ModifiedOn = DateTime.Now;
                oItem.Save();
            }
        }
示例#2
0
        private void SaveOrderInfo()
        {
            RT2020.DAL.Product oItem = RT2020.DAL.Product.Load(this.ProductId);
            if (oItem != null)
            {
                oItem.AlternateItem = order.txtVendorItemNum.Text; // Vendor Item Number
                oItem.ReorderLevel  = Convert.ToDecimal((order.txtReorderLevel.Text == string.Empty) ? "0" : order.txtReorderLevel.Text);
                oItem.ReorderQty    = Convert.ToDecimal((order.txtReorderQuantity.Text == string.Empty) ? "0" : order.txtReorderQuantity.Text);

                oItem.ModifiedBy = RT2020.DAL.Common.Config.CurrentUserId;
                oItem.ModifiedOn = DateTime.Now;
                oItem.Save();
            }
        }
示例#3
0
        public bool SaveRec(Guid productId)
        {
            bool result = false;

            RT2020.DAL.Product oProduct = RT2020.DAL.Product.Load(productId);
            if (oProduct != null)
            {
                oProduct.MaxOnLoanQty = Convert.ToDecimal((txtMaxOLNQty.Text == string.Empty) ? "0" : txtMaxOLNQty.Text);

                oProduct.ModifiedBy = RT2020.DAL.Common.Config.CurrentUserId;
                oProduct.ModifiedOn = DateTime.Now;
                oProduct.Save();

                _ProductId = productId;
                result     = true;
            }

            return(result);
        }
示例#4
0
        public bool SaveRec(Guid productId)
        {
            bool result = false;

            RT2020.DAL.Product oProduct = RT2020.DAL.Product.Load(productId);
            if (oProduct != null)
            {
                oProduct.AlternateItem = txtVendorItemNum.Text; // Vendor Item Number
                oProduct.ReorderLevel  = Convert.ToDecimal((txtReorderLevel.Text == String.Empty) ? "0" : txtReorderLevel.Text);
                oProduct.ReorderQty    = Convert.ToDecimal((txtReorderQuantity.Text == String.Empty) ? "0" : txtReorderQuantity.Text);

                oProduct.ModifiedBy = RT2020.DAL.Common.Config.CurrentUserId;
                oProduct.ModifiedOn = DateTime.Now;
                oProduct.Save();

                _ProductId = productId;
                result     = true;
            }
            return(result);
        }
示例#5
0
        private void CreateProducts(ListViewItem listItem)
        {
            if (Verify())
            {
                string a1 = listItem.SubItems[1].Text;
                string a2 = listItem.SubItems[2].Text;
                string a3 = listItem.SubItems[3].Text;

                System.Guid a1Id = (DAL.Common.Utility.IsGUID(listItem.SubItems[4].Text)) ? new Guid(listItem.SubItems[4].Text) : System.Guid.Empty;
                System.Guid a2Id = (DAL.Common.Utility.IsGUID(listItem.SubItems[5].Text)) ? new Guid(listItem.SubItems[5].Text) : System.Guid.Empty;
                System.Guid a3Id = (DAL.Common.Utility.IsGUID(listItem.SubItems[6].Text)) ? new Guid(listItem.SubItems[6].Text) : System.Guid.Empty;

                string prodCode = txtStkCode.Text.Trim() + a1 + a2 + a3;
                if (prodCode.Length <= 22)
                {
                    StringBuilder sql = new StringBuilder();
                    sql.Append(" STKCODE = '").Append(txtStkCode.Text.Trim()).Append("' ");
                    sql.Append(" AND APPENDIX1 = '").Append(a1.Trim()).Append("' ");
                    sql.Append(" AND APPENDIX2 = '").Append(a2.Trim()).Append("' ");
                    sql.Append(" AND APPENDIX3 = '").Append(a3.Trim()).Append("' ");

                    RT2020.DAL.Product oItem = RT2020.DAL.Product.LoadWhere(sql.ToString());
                    if (oItem == null)
                    {
                        oItem = new RT2020.DAL.Product();

                        oItem.STKCODE   = txtStkCode.Text;
                        oItem.APPENDIX1 = a1;
                        oItem.APPENDIX2 = a2;
                        oItem.APPENDIX3 = a3;

                        if (cboItemStatus.Text == "HOLD")
                        {
                            oItem.Status = Convert.ToInt32(DAL.Common.Enums.Status.Draft.ToString("d"));
                        }
                        else if (cboItemStatus.Text == "POST")
                        {
                            oItem.Status = Convert.ToInt32(DAL.Common.Enums.Status.Active.ToString("d"));
                        }

                        oItem.CLASS1 = general.cboClass1.Text;
                        oItem.CLASS2 = general.cboClass2.Text;
                        oItem.CLASS3 = general.cboClass3.Text;
                        oItem.CLASS4 = general.cboClass4.Text;
                        oItem.CLASS5 = general.cboClass5.Text;
                        oItem.CLASS6 = general.cboClass6.Text;

                        oItem.ProductName     = general.txtProductName.Text;
                        oItem.ProductName_Chs = general.txtProductNameChs.Text;
                        oItem.ProductName_Cht = general.txtProductNameCht.Text;
                        oItem.Remarks         = general.txtRemarks.Text;

                        oItem.NormalDiscount = Convert.ToDecimal((general.txtRetailDiscount.Text == string.Empty) ? "0" : general.txtRetailDiscount.Text);
                        oItem.UOM            = general.txtUnit.Text;
                        oItem.NatureId       = new Guid(general.cboNature.SelectedValue.ToString());

                        oItem.FixedPriceItem = false;

                        // Download Packets
                        oItem.DownloadToPOS     = general.chkRetailItem.Checked;
                        oItem.DownloadToCounter = general.chkCounterItem.Checked;

                        oItem.CreatedBy  = DAL.Common.Config.CurrentUserId;
                        oItem.CreatedOn  = DateTime.Now;
                        oItem.ModifiedBy = DAL.Common.Config.CurrentUserId;
                        oItem.ModifiedOn = DateTime.Now;

                        oItem.Save();

                        SaveProductBarcode(oItem.ProductId, prodCode);

                        // Appendix / Class
                        System.Guid c1Id = (general.cboClass1.SelectedValue != null) ? new Guid(general.cboClass1.SelectedValue.ToString()) : System.Guid.Empty;
                        System.Guid c2Id = (general.cboClass2.SelectedValue != null) ? new Guid(general.cboClass2.SelectedValue.ToString()) : System.Guid.Empty;
                        System.Guid c3Id = (general.cboClass3.SelectedValue != null) ? new Guid(general.cboClass3.SelectedValue.ToString()) : System.Guid.Empty;
                        System.Guid c4Id = (general.cboClass4.SelectedValue != null) ? new Guid(general.cboClass4.SelectedValue.ToString()) : System.Guid.Empty;
                        System.Guid c5Id = (general.cboClass5.SelectedValue != null) ? new Guid(general.cboClass5.SelectedValue.ToString()) : System.Guid.Empty;
                        System.Guid c6Id = (general.cboClass6.SelectedValue != null) ? new Guid(general.cboClass6.SelectedValue.ToString()) : System.Guid.Empty;
                        SaveProductCode(oItem.ProductId, a1Id, a2Id, a3Id, c1Id, c2Id, c3Id, c4Id, c5Id, c6Id);

                        // Product Price
                        SaveProductSupplement(oItem.ProductId);
                        SaveProductPrice(oItem.ProductId);

                        // Remarks
                        SaveProductRemarks(oItem.ProductId);

                        SaveCurrentSummary(oItem.ProductId);
                    }
                }
            }
        }