Ejemplo n.º 1
0
        /// <summary>
        /// 获取科常用排班类别
        /// </summary>
        /// <param name="deptID"></param>
        private void getDeptType(string deptID)
        {
            if (this.fpSpread2_Sheet1.RowCount > 0)
            {
                this.fpSpread2_Sheet1.Rows.Remove(0, this.fpSpread2_Sheet1.RowCount);
            }

            if (tabMgr == null)
            {
                tabMgr = new Neusoft.HISFC.BizProcess.Integrate.Registration.Tabulation();
            }
            ArrayList types = tabMgr.Query(deptID);


            if (types != null)
            {
                foreach (Neusoft.HISFC.Models.Registration.WorkType obj in types)
                {
                    this.fpSpread2_Sheet1.Rows.Add(this.fpSpread2_Sheet1.RowCount, 1);
                    int row = this.fpSpread2_Sheet1.RowCount - 1;

                    add(row, obj);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 生成排班类别列表
        /// </summary>
        private void initType()
        {
            if (this.fpSpread1_Sheet1.RowCount > 0)
            {
                this.fpSpread1_Sheet1.Rows.Remove(0, this.fpSpread1_Sheet1.RowCount);
            }

            if (tabMgr == null)
            {
                tabMgr = new Neusoft.HISFC.BizProcess.Integrate.Registration.Tabulation();
            }

            al = tabMgr.Query(Neusoft.HISFC.BizLogic.Operation.QueryState.All);
            ds.Tables["items"].Rows.Clear();

            if (al != null)
            {
                foreach (Neusoft.HISFC.Models.Registration.WorkType obj in al)
                {
                    fpSpread1_Sheet1.Rows.Add(this.fpSpread1_Sheet1.RowCount, 1);
                    int row = this.fpSpread1_Sheet1.RowCount - 1;

                    addfp1(row, obj);
                    ds.Tables["items"].Rows.Add(new object[]
                    {
                        obj.ID, obj.Name, obj.SpellCode
                    });
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 删除一行
        /// </summary>
        /// <param name="row"></param>
        private void del(int row)
        {
            if (row < 0 || this.fpSpread2_Sheet1.RowCount == 0)
            {
                return;
            }
            if (this.fpSpread2_Sheet1.Tag == null || this.fpSpread2_Sheet1.Tag.ToString() == "")
            {
                return;
            }

            if (MessageBox.Show("是否删除该排班类型?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)
                == DialogResult.No)
            {
                return;
            }

            //删除
            Neusoft.HISFC.Models.Registration.WorkType obj = this.fpSpread2_Sheet1.Rows[row].Tag as
                                                             Neusoft.HISFC.Models.Registration.WorkType;

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

            //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(this.deptManager.Connection);
            //t.BeginTransaction();

            if (tabMgr == null)
            {
                tabMgr = new Neusoft.HISFC.BizProcess.Integrate.Registration.Tabulation();
            }
            tabMgr.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            try
            {
                if (tabMgr.Delete(this.fpSpread2_Sheet1.Tag.ToString(), obj.ID) == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show(tabMgr.Err, "提示");
                    return;
                }
                Neusoft.FrameWork.Management.PublicTrans.Commit();
            }
            catch (Exception e)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show(e.Message, "提示");
                return;
            }

            this.fpSpread2_Sheet1.Rows.Remove(row, 1);

            MessageBox.Show("删除成功!", "提示");
        }
Ejemplo n.º 4
0
        protected override int OnSave(object sender, object neuObject)
        {
            if (this.fpSpread2_Sheet1.Tag == null || this.fpSpread2_Sheet1.Tag.ToString() == "")
            {
                MessageBox.Show("请先选择一个科室!", "提示");
                return(-1);
            }

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

            //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction();
            //t.BeginTransaction();
            try
            {
                if (this.tabMgr == null)
                {
                    this.tabMgr = new Neusoft.HISFC.BizProcess.Integrate.Registration.Tabulation();
                }
                tabMgr.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

                for (int i = 0; i < this.fpSpread2_Sheet1.RowCount; i++)
                {
                    Neusoft.HISFC.Models.Registration.WorkType obj = (Neusoft.HISFC.Models.Registration.WorkType) this.fpSpread2_Sheet1.Rows[i].Tag;
                    //先删除
                    if (tabMgr.Delete(this.fpSpread2_Sheet1.Tag.ToString(), obj.ID) == -1)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show(tabMgr.Err, "提示");
                        return(-1);
                    }

                    if (tabMgr.Insert(this.fpSpread2_Sheet1.Tag.ToString(), obj) == -1)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show(tabMgr.Err, "提示");
                        return(-1);
                    }
                }
                Neusoft.FrameWork.Management.PublicTrans.Commit();
            }
            catch (Exception e)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show(e.Message, "提示");
                return(-1);
            }

            MessageBox.Show("保存成功!", "提示");

            return(base.OnSave(sender, neuObject));
        }