/// <summary>
        /// 填充FP控件
        /// </summary>
        /// <param name="abList"></param>
        private void FillFP(List <Neusoft.HISFC.Models.Order.Medical.Ability> abList)
        {
            if (abList == null)
            {
                this.fpAbility_Sheet1.RowCount = 0;

                return;
            }
            this.fpAbility_Sheet1.RowCount = 0;
            for (int rowCount = 0; rowCount < abList.Count; rowCount++)
            {
                Neusoft.HISFC.Models.Order.Medical.Ability abtemp = new Neusoft.HISFC.Models.Order.Medical.Ability();
                //根据记录行数动态加载FarPoint的行,每次循环加一行

                this.fpAbility_Sheet1.Rows.Add(rowCount, 1);
                abtemp = abList[rowCount] as Neusoft.HISFC.Models.Order.Medical.Ability;
                //赋值查询结果到FarPoint对应的单元格中

                this.fpAbility_Sheet1.Cells[rowCount, 0].Text  = abtemp.Employee.ID;
                this.fpAbility_Sheet1.Cells[rowCount, 1].Text  = abtemp.Employee.Name;
                this.fpAbility_Sheet1.Cells[rowCount, 2].Text  = this.ehDept.GetName(abtemp.Employee.Dept.ID);
                this.fpAbility_Sheet1.Cells[rowCount, 3].Text  = this.ehLevel.GetName(abtemp.Employee.Level.ID);
                this.fpAbility_Sheet1.Cells[rowCount, 4].Text  = this.ehSpeciality.GetName(abtemp.Speciality.ID);
                this.fpAbility_Sheet1.Cells[rowCount, 5].Text  = abtemp.VocationCardNO;
                this.fpAbility_Sheet1.Cells[rowCount, 6].Text  = abtemp.AbilityCardNO;
                this.fpAbility_Sheet1.Cells[rowCount, 7].Text  = this.ehVocationType.GetName(abtemp.VocationType.ID);
                this.fpAbility_Sheet1.Cells[rowCount, 8].Text  = abtemp.VocationArea;
                this.fpAbility_Sheet1.Cells[rowCount, 9].Text  = abtemp.Remark;
                this.fpAbility_Sheet1.Cells[rowCount, 10].Text = abtemp.ID;
                this.fpAbility_Sheet1.Cells[rowCount, 11].Text = abtemp.Employee.Birthday.ToString();
                this.fpAbility_Sheet1.Cells[rowCount, 12].Text = abtemp.Employee.Sex.Name;
                this.fpAbility_Sheet1.Cells[rowCount, 13].Text = this.ehEdu.GetName(abtemp.Employee.GraduateSchool.ID);
            }
        }
예제 #2
0
        /// <summary>
        /// 插入一条资质信息

        /// </summary>
        /// <param name="ability">资质实体</param>
        /// <returns>成功 1 失败 -1</returns>
        public int InsertAbility(Neusoft.HISFC.Models.Order.Medical.Ability ability)
        {
            return(this.UpdateSingleTable("Medical.Ability.Insert",
                                          ability.Employee.ID.ToString(), ability.Speciality.ID,
                                          ability.VocationCardNO, ability.AbilityCardNO,
                                          ability.VocationType.ID, ability.VocationArea, ability.Remark));
        }
예제 #3
0
        /// <summary>
        /// 查询返回资质实体类列表

        /// </summary>
        /// <param name="sqlIndex">SQL语句索引</param>
        /// <param name="args">传入字段</param>
        /// <returns>成功 Ability列表 失败 null</returns>
        private List <Neusoft.HISFC.Models.Order.Medical.Ability> QueryBySql(string sqlIndex, params string[] args)
        {
            string sql = string.Empty;

            if (this.Sql.GetSql(sqlIndex, ref sql) == -1)
            {
                this.Err = "没有找到索引为:" + sqlIndex + "的SQL语句";

                return(null);
            }
            if (this.ExecQuery(sql, args) == -1)
            {
                this.Err     = "执行SQL语句出错!" + this.Err;
                this.ErrCode = "-1";

                return(null);
            }

            List <Neusoft.HISFC.Models.Order.Medical.Ability> al = new List <Neusoft.HISFC.Models.Order.Medical.Ability>();

            try
            {
                while (this.Reader.Read())
                {
                    Neusoft.HISFC.Models.Order.Medical.Ability fection = new Neusoft.HISFC.Models.Order.Medical.Ability();

                    fection.Employee.ID     = this.Reader[0].ToString();
                    fection.Speciality.ID   = this.Reader[1].ToString();
                    fection.VocationCardNO  = this.Reader[2].ToString();
                    fection.AbilityCardNO   = this.Reader[3].ToString();
                    fection.VocationType.ID = this.Reader[4].ToString();
                    fection.VocationArea    = this.Reader[5].ToString();
                    fection.Remark          = this.Reader[6].ToString();
                    fection.ID                         = this.Reader[7].ToString();
                    fection.Employee.Name              = this.Reader[8].ToString();
                    fection.Employee.Dept.ID           = this.Reader[9].ToString();
                    fection.Employee.Birthday          = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[10].ToString());
                    fection.Employee.Sex.ID            = this.Reader[11].ToString();
                    fection.Employee.GraduateSchool.ID = this.Reader[12].ToString();
                    fection.Employee.Level.ID          = this.Reader[13].ToString();

                    al.Add(fection);
                }
            }

            catch (System.Exception ex)
            {
                this.Err     = "获得资质信息时出错!" + ex.Message;
                this.ErrCode = "-1";

                return(null);
            }
            finally
            {
                this.Reader.Close();
            }
            return(al);
        }
        private Neusoft.HISFC.Models.Order.Medical.Ability FillObj()
        {
            Neusoft.HISFC.Models.Order.Medical.Ability abtemp = new Neusoft.HISFC.Models.Order.Medical.Ability();

            abtemp.Speciality.ID   = cbSpeciality.Tag.ToString();
            abtemp.VocationType.ID = cbVocationType.Tag.ToString();
            abtemp.VocationArea    = tbVocationArea.Text;
            abtemp.VocationCardNO  = tbVocationCardNO.Text;
            abtemp.AbilityCardNO   = tbAbilityCardNO.Text;
            abtemp.Remark          = tbRemark.Text;
            abtemp.Employee.ID     = tbEmplCode.Text;
            abtemp.ID = this.happenNO;

            return(abtemp);
        }
        private void SaveAbility()
        {
            if (this.CheckControlsValid() == -1)
            {
                return;
            }

            if (CheckDataValid() == false)
            {
                return;
            }

            Neusoft.HISFC.Models.Order.Medical.Ability abilityFC = new Neusoft.HISFC.Models.Order.Medical.Ability();
            abilityFC = this.FillObj();
            if (abilityFC == null)
            {
                MessageBox.Show("获取资质实体出错!");

                return;
            }

            if (this.happenNO == "-1")
            {
                if (aby.InsertAbility(abilityFC) == -1)
                {
                    MessageBox.Show("更新资质信息失败!" + aby.Err);

                    return;
                }
            }
            else
            {
                if (aby.UpdateAbility(abilityFC) == -1)
                {
                    MessageBox.Show("更新资质信息失败!" + aby.Err);

                    return;
                }
            }
            MessageBox.Show("更新资质信息成功!", "提示", MessageBoxButtons.OK);
            List <Neusoft.HISFC.Models.Order.Medical.Ability> abList = new List <Neusoft.HISFC.Models.Order.Medical.Ability>();

            abList = aby.QueryAbilityByPersonID(abilityFC.Employee.ID);
            FillFP(abList);
        }
예제 #6
0
        /// <summary>
        /// 修改一条资质信息

        /// </summary>
        /// <param name="ability">资质实体</param>
        /// <returns>成功 1 失败 -1 没有更新到数据 0</returns>
        public int UpdateAbility(Neusoft.HISFC.Models.Order.Medical.Ability ability)
        {
            return(this.UpdateSingleTable("Medical.Ability.Update",
                                          ability.ID, ability.Speciality.ID, ability.VocationCardNO,
                                          ability.AbilityCardNO, ability.VocationType.ID, ability.VocationArea, ability.Remark));
        }