Ejemplo n.º 1
0
		private void SaveRecord()
		{
			ProductSubGroupDetails clsDetails = new ProductSubGroupDetails();

			clsDetails.ProductSubGroupID = Convert.ToInt16(lblProductSubGroupID.Text);
			clsDetails.ProductGroupID = Convert.ToInt32(cboGroup.SelectedItem.Value);
			clsDetails.ProductSubGroupCode = txtProductSubGroupCode.Text;
			clsDetails.ProductSubGroupName = txtProductSubGroupName.Text;
			clsDetails.BaseUnitID = Convert.ToInt32(cboProductSubGroupUnit.SelectedItem.Value);
			clsDetails.Price = Convert.ToDecimal(txtProductPrice.Text);
			clsDetails.PurchasePrice = Convert.ToDecimal(txtPurchasePrice.Text);
			clsDetails.IncludeInSubtotalDiscount = chkIncludeInSubtotalDiscount.Checked;
			clsDetails.VAT = Convert.ToDecimal(txtVAT.Text);
			clsDetails.EVAT = Convert.ToDecimal(txtEVAT.Text);
			clsDetails.LocalTax = Convert.ToDecimal(txtLocalTax.Text);
			
			ProductSubGroup clsProductSubGroup = new ProductSubGroup();
			clsProductSubGroup.Update(clsDetails);
			clsProductSubGroup.CommitAndDispose();
		}
Ejemplo n.º 2
0
		private void SaveRecord()
		{
			ProductSubGroupDetails clsDetails = new ProductSubGroupDetails();

			clsDetails.ProductSubGroupID = Convert.ToInt16(lblProductSubGroupID.Text);
			clsDetails.ProductGroupID = Convert.ToInt32(cboGroup.SelectedItem.Value);
			clsDetails.ProductSubGroupCode = txtProductSubGroupCode.Text;
			clsDetails.ProductSubGroupName = txtProductSubGroupName.Text;
			clsDetails.BaseUnitID = Convert.ToInt32(cboProductSubGroupUnit.SelectedItem.Value);
			clsDetails.Price = Convert.ToDecimal(txtProductPrice.Text);
			clsDetails.PurchasePrice = Convert.ToDecimal(txtPurchasePrice.Text);
			clsDetails.IncludeInSubtotalDiscount = chkIncludeInSubtotalDiscount.Checked;
			clsDetails.VAT = Convert.ToDecimal(txtVAT.Text);
			clsDetails.EVAT = Convert.ToDecimal(txtEVAT.Text);
			clsDetails.LocalTax = Convert.ToDecimal(txtLocalTax.Text);
            clsDetails.SequenceNo = Int32.Parse(txtSequenceNo.Text);
            clsDetails.ImagePath = lblImagePath.Text;

            string strfile = "";
            string strfolder = "/RetailPlus/temp/uploaded/subgroupimages/";
            for (int i = 0; i < Request.Files.Count; i++)
            {
                HttpPostedFile pfile = Request.Files[i];
                if (pfile.ContentLength > 0)
                {
                    strfile = Server.MapPath(strfolder + System.IO.Path.GetFileName(pfile.FileName));

                    if (!System.IO.Directory.Exists(Server.MapPath(strfolder)))
                        System.IO.Directory.CreateDirectory(Server.MapPath(strfolder));

                    if (System.IO.File.Exists(strfile))
                        System.IO.File.Delete(strfile);

                    pfile.SaveAs(strfile);
                    clsDetails.ImagePath = pfile.FileName;
                }
            }
			
			ProductSubGroup clsProductSubGroup = new ProductSubGroup();
			clsProductSubGroup.Update(clsDetails);
			clsProductSubGroup.CommitAndDispose();
		}