Пример #1
0
        private void UpdateFactory()
        {
            if (cboFactoryDivision.SelectedIndex != 0)
            {
                FactoryVO item = new FactoryVO
                {
                    Factory_ID         = code,
                    Factory_Name       = txtFactoryName.Text,
                    Factory_Division   = Convert.ToInt32(cboFactoryDivision.SelectedValue),
                    Factory_Number     = maskedFactoryNumber.Text,
                    Factory_Fax        = maskedFactoryFaxNumber.Text,
                    Factory_Address    = addrFactory.Address1 + " " + addrFactory.Address2,
                    Factory_AddrNumber = addrFactory.Zipcode
                };

                if (item.Factory_Fax.Replace("-", "").Trim().Length < 10)
                {
                    item.Factory_Fax = null;
                }

                try
                {
                    StandardService service = new StandardService();
                    service.UpdateFactory(item);
                }
                catch (Exception err)
                {
                    Log.WriteError(err.Message, err);
                }
            }
        }