示例#1
0
        public override int Modify()
        {
            if (_entity == null)
            {
                MessageBox.Show("请先查询需要修改的记录。");
                return(0);
            }
            if (Check() == false)
            {
                return(0);
            }
            GetCallRecordFromUI();
            _entity.modifytime = DateTime.Now;
            _entity.modifyman  = FishEntity.Variable.User.username;

            bool isok = _bll.Update(_entity);

            if (isok)
            {
                FishBll.Bll.CompanyBll companyBll = new FishBll.Bll.CompanyBll();
                companyBll.UpdateCompnayLinkDate(_entity.customercode, _entity.weekestimate, _entity.monthestimate, _entity.currentdate.Value, _entity.BuyDate, _entity.nextdate.Value);
                FishBll.Bll.CustomerBll customerBll = new FishBll.Bll.CustomerBll();
                customerBll.UpdateLinkDate(_entity.linkmancode, _entity.currentdate.Value, _entity.id, _entity.nextdate.Value);

                AddDetail(_entity.id, false);

                MessageBox.Show("修改成功。");

                if (RefreshDataEvent != null)
                {
                    RefreshDataEvent(this, EventArgs.Empty);
                }
            }
            else
            {
                MessageBox.Show("修改失败。");
            }
            return(1);
        }