コード例 #1
0
        private void RefreshValue()
        {
            txtCode.Text = _Category.Code;
            txtName.Text = _Category.Description;

            cmbAge.SelectedValue = _Category.Age != null ? _Category.Age : cmbAge.SelectedValue;

            cmbbackcolor.SelectedItem = _Category.BackColor != null ? _Category.BackColor : null;
            cmbforecolor.SelectedItem = _Category.ForeColor != null ? _Category.ForeColor : null;
            chkInactive.Checked       = _Category.Inactive;
            chkIsVat.Checked          = _Category.IsVat;

            EnumTax enuumTax = (EnumTax)Convert.ToInt32(_Category.VAT);

            cmbVat.SelectedValue = (int)enuumTax;

            chkPayout.Checked       = _Category.IsPayOut;
            chkSeperateSale.Checked = _Category.IsSeperateSale;
        }
コード例 #2
0
        private void RefreshValue()
        {
            txtCode.Text              = _Product.Code;
            txtName.Text              = _Product.ProductName;
            ctlBrand.SelectedID       = _Product.CompanyID;
            ctlCategory.SelectedID    = _Product.CategoryID;
            ctlModel.SelectedID       = 1;
            cboUnitType.SelectedValue = _Product.UnitType > 0 ? _Product.UnitType : 1;
            cboProType.SelectedValue  = _Product.ProductType > 0 ? _Product.ProductType : 3;
            numMinQTY.Value           = _Product.ShortQty;

            numGSTPerc.Value  = _Product.GSTPerc;
            numCGSTPerc.Value = _Product.CGSTPerc;
            numSGSTPerc.Value = _Product.SGSTPerc;
            numIGSTPerc.Value = _Product.IGSTPerc;

            numMaxQty.Value = _Product.MaxQty;
            EnumTax enuumTax = (EnumTax)Convert.ToInt32(_Product.Tax);

            cboTax.SelectedValue = (int)enuumTax;
            txtBarcode.Text      = _Product.BarCode;
            numCostPrice.Value   = _Product.CostPrice;
            numRetailPrice.Value = _Product.RetailPrice;

            if (!string.IsNullOrEmpty(_Product.CompressorWarrenty))
            {
                numCompressor.Value         = Convert.ToDecimal(_Product.CompressorWarrenty.Split(' ')[0]);
                cboCompressor.SelectedValue = (int)((EnumWarrantyType)Enum.Parse(typeof(EnumWarrantyType), _Product.CompressorWarrenty.Split(' ')[1]));
            }

            if (!string.IsNullOrEmpty(_Product.MotorWarrenty))
            {
                numMotor.Value         = Convert.ToDecimal(_Product.MotorWarrenty.Split(' ')[0]);
                cboMotor.SelectedValue = (int)((EnumWarrantyType)Enum.Parse(typeof(EnumWarrantyType), _Product.MotorWarrenty.Split(' ')[1]));
            }

            if (!string.IsNullOrEmpty(_Product.PanelWarrenty))
            {
                numPanel.Value         = Convert.ToDecimal(_Product.PanelWarrenty.Split(' ')[0]);
                cboPanel.SelectedValue = (int)((EnumWarrantyType)Enum.Parse(typeof(EnumWarrantyType), _Product.PanelWarrenty.Split(' ')[1]));
            }

            if (!string.IsNullOrEmpty(_Product.ServiceWarrenty))
            {
                numService.Value         = Convert.ToDecimal(_Product.ServiceWarrenty.Split(' ')[0]);
                cboService.SelectedValue = (int)((EnumWarrantyType)Enum.Parse(typeof(EnumWarrantyType), _Product.ServiceWarrenty.Split(' ')[1]));
            }

            if (!string.IsNullOrEmpty(_Product.SparePartsWarrenty))
            {
                numSpareparts.Value         = Convert.ToDecimal(_Product.SparePartsWarrenty.Split(' ')[0]);
                cboSpareparts.SelectedValue = (int)((EnumWarrantyType)Enum.Parse(typeof(EnumWarrantyType), _Product.SparePartsWarrenty.Split(' ')[1]));
            }
            if (_Product.BoxQty != default(decimal))
            {
                numBQty.Value = (decimal)_Product.BoxQty;
            }
            else
            {
                numBQty.Value = 0;
            }

            if (_Product.PhotoPath != null)
            {
                string path = _SystemInformation.ProductPhotoPath + "\\" + _Product.PhotoPath;
                if (File.Exists(path))
                {
                    pbxEmpPic.ImageLocation = _SystemInformation.ProductPhotoPath + "//" + _Product.PhotoPath;
                }
                else
                {
                    MessageBox.Show("Error Loading Product Picture" + Environment.NewLine + "Picture Not Found");
                }
            }
        }