예제 #1
0
        private bool SaveData()
        {
            bsArea.EndEdit();

            _area.AreaNo   = string.Format("{0}-{1}", txtAreaNoLeft.Text, txtAreaNoRight.Text);
            _area.AreaName = txtAreaName.Text;
            if (!CheckInput())
            {
                return(false);
            }
            //_area.AreaStatus = 1;
            //_area.IsDel = 1;
            _area.CreateTime = DateTime.Today;
            string strErr = string.Empty;

            if (Basic_Func.SaveArea(ref _area, ref strErr))
            {
                Common.Common_Func.ErrorMessage("货位保存成功!", "保存成功");
                bsArea.DataSource = _area;
                InitForm();
                _back = Common.Common_Func.ConvertToModel <AreaInfo>(_area);
                return(true);
            }
            else
            {
                Common.Common_Func.ErrorMessage(strErr, "保存失败");
                bsArea.DataSource = _area;
                return(false);
            }
        }