private void InsertWarehouse() { if (cboWarehouseDivision.SelectedIndex != 0) { WarehouseVO item = new WarehouseVO { Warehouse_Name = txtWarehouseName.Text, Warehouse_Division = Convert.ToInt32(cboWarehouseDivision.SelectedValue), Warehouse_Number = maskedWarehouseNumber.Text, Warehouse_Fax = maskedWarehouseFaxNumber.Text, Warehouse_Address = addrWarehouse.Address1 + " " + addrWarehouse.Address2, Warehouse_AddrNumber = addrWarehouse.Zipcode }; //MaskTextBox는 값이 없을 때 공백과 -만 남으므로 item 값을 null로 준다. if (item.Warehouse_Number.Replace("-", "").Trim().Length < 10) { item.Warehouse_Number = null; } if (item.Warehouse_Fax.Replace("-", "").Trim().Length < 10) { item.Warehouse_Fax = null; } try { StandardService service = new StandardService(); service.InsertWarehouse(item); } catch (Exception err) { Log.WriteError(err.Message, err); } } }