예제 #1
0
        private void btn_Save_Click(object sender, EventArgs e)
        {
            #region 保存
            if (!this.SaveCheck(this.opState))
            {
                return;
            }

            InventoryDAL invDAL = new InventoryDAL();

            if (opState == OpState.Add)
            {
                this.inv = new Inventory();
                this.SetData(inv);
                if (FTPOperate(this.opState))
                {
                    invDAL.Add(inv);
                }
            }
            else if (opState == OpState.Update)
            {
                this.SetData(inv);
                if (FTPOperate(this.opState))
                {
                    invDAL.Update(inv);
                }
            }

            this.opState = OpState.Browse;
            this.SetTextBoxState(gpHead, this.opState);
            this.SetTextBoxState(gpBody, this.opState);
            this.btn_Save.Enabled    = false;
            this.btn_Edit.Enabled    = true;
            this.TabCtrl.SelectedTab = tab_files;
            this.invAddress          = FTPConfig.FtpAddress + "/" + inv.InvCode;
            this.GetFTPFileList(inv.InvCode);
            this._saved = true;
            #endregion
        }