Esempio n. 1
0
        private void SetStatus()
        {
            if (!MessageBoxEx.ShowQuestion(string.Format("确定要{0}吗?", btnStatus.Caption)))
            {
                if (model.status == ((int)DataSources.EnumStatus.Start).ToString())
                {
                    btnStatus.Caption = "启用";
                }
                else
                {
                    btnStatus.Caption = "停用";
                }
                return;
            }

            if (StatusSql())
            {
                MessageBoxEx.Show(btnStatus.Caption + "成功!");
                uc.BindgvWareHouseList();
                deleteMenuByTag(this.Tag.ToString(), uc.Name);
            }
            else
            {
                MessageBoxEx.ShowError(btnStatus.Caption + "失败!");
                if (model.status == ((int)DataSources.EnumStatus.Start).ToString())
                {
                    btnStatus.Caption = "启用";
                }
                else
                {
                    btnStatus.Caption = "停用";
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 保存事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void UCWareHouseAddOrEdit_SaveEvent(object sender, EventArgs e)
        {
            try
            {
                if (CheckDataInfo())
                {
                    if (!ValidateJudge())
                    {
                        return;
                    }

                    if (MessageBoxEx.Show("确认要保存吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
                    {
                        return;
                    }
                    string opName = "供应商档案操作";
                    List <SysSQLString> listSql = new List <SysSQLString>();

                    if (windowStatus == WindowStatus.Add || windowStatus == WindowStatus.Copy)
                    {
                        wareHouseId = Guid.NewGuid().ToString();
                        AddWareHouseSqlString(listSql, wareHouseId);
                        opName = "新增仓库档案";
                    }
                    else if (windowStatus == WindowStatus.Edit)
                    {
                        EditWareHouseSqlString(listSql, wareHouseId, tb_warehouse_Model);
                        opName = "修改仓库档案";
                    }
                    DealCargospace(listSql, wareHouseId);

                    ucAttr.TableName         = "tb_warehouse";
                    ucAttr.TableNameKeyValue = wareHouseId;
                    ucAttr.GetAttachmentSql(listSql);

                    if (DBHelper.BatchExeSQLStringMultiByTrans(opName, listSql))
                    {
                        MessageBoxEx.Show("保存成功!");
                        uc.BindgvWareHouseList();
                        deleteMenuByTag(this.Tag.ToString(), uc.Name);
                    }
                    else
                    {
                        MessageBoxEx.Show("保存失败!");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("操作失败!");
            }
        }