Esempio n. 1
0
        /// <summary>
        /// 添加手术间
        /// </summary>
        /// <param name="room"></param>
        /// <returns></returns>
        public int AddOpsRoom(OpsRoom room)
        {
            string strSql = string.Empty, strValid = string.Empty;

            strSql = string.Empty;
            if (this.Sql.GetSql("Operator.OpsTableManage.AddOpsRooms.1", ref strSql) == -1)
            {
                return(-1);
            }
            try
            {
                if (room.IsValid)
                {
                    strValid = "1";
                }
                else
                {
                    strValid = "0";
                }

                strSql = string.Format(strSql, room.ID, room.Name, room.InputCode, room.DeptID,
                                       strValid, room.OperCode);
            }
            catch (Exception ex)
            {
                this.Err     = ex.Message;
                this.ErrCode = ex.Message;
                return(-1);
            }
            if (strSql == null)
            {
                return(-1);
            }
            return(this.ExecNoQuery(strSql));
        }
Esempio n. 2
0
        private int Save()
        {
            this.ucTableSpread1.Update();

            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();

            //Neusoft.FrameWork.Management.Transaction trans = new Neusoft.FrameWork.Management.Transaction(Neusoft.FrameWork.Management.Connection.Instance);
            //trans.BeginTransaction();
            Environment.TableManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            if (this.ucTableSpread1.ValidState() == -1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                return(-1);
            }
            foreach (string id in this.modified)
            {
                foreach (TreeNode node in this.treeView1.Nodes[0].Nodes)
                {
                    OpsRoom room = node.Tag as OpsRoom;
                    if (room.ID == id)
                    {
                        foreach (OpsTable table in room.Tables)
                        {
                            if (!table.IsOK())
                            {
                                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                                MessageBox.Show(table.InvalidInfo + ",请确认后重试!"
                                                , "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                return(-1);
                            }
                        }
                        if (Environment.TableManager.DelOpsTables(id) == -1)
                        {
                        }

                        if (Environment.TableManager.AddOpsTable(room.Tables) == -1)
                        {
                            Neusoft.FrameWork.Management.PublicTrans.RollBack();
                            MessageBox.Show("保存手术台失败!\n请与系统管理员联系。" + Environment.TableManager.Err
                                            , "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            return(-1);
                        }
                    }
                }
            }

            this.modified.Clear();
            Neusoft.FrameWork.Management.PublicTrans.Commit();
            MessageBox.Show("保存成功");
            return(0);
        }
Esempio n. 3
0
        public override void ToolStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            if (e.ClickedItem.Text == "增加")
            {
                if (this.CurrentRoom == null)
                {
                    MessageBox.Show("请先选择手术房间!");
                    return;
                }
                this.ucTableSpread1.AddItem();
            }
            else if (e.ClickedItem.Text == "删除")
            {
                this.ucTableSpread1.DeleteItem();
                if (CurrentRoom == null)
                {
                    MessageBox.Show("请选择手术房间");
                    return;
                }
                if (!this.modified.Contains(this.CurrentRoom.ID))
                {
                    this.modified.Add(this.CurrentRoom.ID);
                }
            }
            else if (e.ClickedItem.Text == "增加房间")
            {
                this.DialogRoom.Room  = new OpsRoom();
                this.DialogRoom.IsNew = true;

                if (this.DialogRoom.ShowDialog() == DialogResult.OK)
                {
                    OpsRoom room = this.DialogRoom.Room.Clone();

                    this.ucTableSpread1.Reset();
                    TreeNode node = new TreeNode(room.Name, 1, 1);
                    node.Tag = room;
                    this.treeView1.Nodes[0].Nodes.Add(node);
                    this.modified.Add(room.ID);
                }
            }
            else if (e.ClickedItem.Text == "删除房间")
            {
                if (this.CurrentRoom == null)
                {
                    return;
                }

                if (MessageBox.Show("删除手术间将同时删除其下面的手术台,是否确认删除手术间:" + this.CurrentRoom.Name + "?",
                                    "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question,
                                    MessageBoxDefaultButton.Button2) == DialogResult.No)
                {
                    return;
                }
                if (Environment.TableManager.DelOpsRoom(this.CurrentRoom) == -1)
                {
                    MessageBox.Show("删除手术间失败!\n请与系统管理员联系。" + Environment.TableManager.Err, "提示",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                }

                this.treeView1.Nodes.Remove(this.treeView1.SelectedNode);
            }
            base.ToolStrip_ItemClicked(sender, e);
        }
Esempio n. 4
0
 /// <summary>
 /// 清空
 /// </summary>
 public void Reset()
 {
     this.fpSpread1_Sheet1.RowCount = 0;
     this.room = null;
 }