private string ToJson(aers_tbl_hospital tempModel)
        {
            string res = string.Empty;

            try
            {
                res += "{";
                res += "\"HospId\":\"" + tempModel.HospId + "\",";
                res += "\"HospName\":\"" + tempModel.HospName + "\",";
                res += "\"Address\":\"" + tempModel.Address + "\",";
                res += "\"Phone\":\"" + tempModel.Phone + "\",";
                res += "\"Contact\":\"" + tempModel.Contact + "\",";
                res += "\"Grade\":\"" + tempModel.Grade + "\",";
                res += "\"Validitytime\":\"" + tempModel.Validitytime + "\",";

                res += "\"IsFlag\":" + tempModel.IsFlag + ",";
                res += "\"Remarks\":\"" + tempModel.Remarks + "\",";
                res += "\"OperatorId\":\"" + tempModel.OperatorId + "\",";
                res += "\"OperatorDate\":\"" + tempModel.OperatorDate + "\",";
                res  = res.Substring(0, res.Length - 1) + "}";
            }
            catch (Exception e)
            {
                res = string.Empty;
            }
            return(res);
        }
Esempio n. 2
0
        public void DataBind(aers_tbl_hospdep data = null)
        {
            if (data == null)
            {
                hospdep = new aers_tbl_hospdep();
                txt_DisplayOrder.Text = "0";
                state = FormState.Add;
            }
            else
            {
                hospdep = data;
                state   = FormState.Modify;

                txt_HospdepName.Text  = hospdep.HospdepName;
                txt_HospId.Text       = hospdep.HospId;
                txt_DisplayOrder.Text = hospdep.DisplayOrder.ToString();
                txt_Remarks.Text      = hospdep.Remarks;

                aers_tbl_hospital hospital = dalhospital.hospitalFindAll().FirstOrDefault(o => o.HospId == hospdep.HospId);



                if (hospital != null)
                {
                    txt_HospId.EditValue = hospital.HospId;

                    this.txt_HospId.Text = hospital.HospName;
                    this.txt_HospId.Tag  = hospital.HospId;
                }
            }
        }
        public int Insert(aers_tbl_hospital data)
        {
            aers_sys_seedSqlMapDao dal = new aers_sys_seedSqlMapDao();

            data.HospId = dal.GetMaxID("hospital");

            String    stmtId = "aers_tbl_hospital_Insert";
            Hashtable ht     = new Hashtable();

            ht.Add("HospId", data.HospId);
            ht.Add("HospName", data.HospName);
            ht.Add("Address", data.Address);
            ht.Add("Phone", data.Phone);
            ht.Add("Contact", data.Contact);
            ht.Add("Grade", data.Grade);
            ht.Add("Validitytime", data.Validitytime);
            ht.Add("IsFlag", data.IsFlag);
            ht.Add("Remarks", data.Remarks);
            ht.Add("OperatorId", data.OperatorId);
            ht.Add("OperatorDate", data.OperatorDate);

            try
            {
                ExecuteInsert(stmtId, ht);
                return(1);
            }
            catch (Exception ex)
            {
                return(0);
            }
        }
        public void DataBind()
        {
            IList <aers_tbl_hospdep> list = dal.hospdepFindAll();

            IList <aers_tbl_hospital> listhospital = dalhospital.hospitalFindAll();


            foreach (aers_tbl_hospdep item in list)
            {
                aers_tbl_hospital hospital = listhospital.FirstOrDefault(o => o.HospId == item.HospId);
                if (hospital != null)
                {
                    item.HospName = hospital.HospName;
                }
            }


            string Pram = txtfind.Text.Trim();

            if (!string.IsNullOrEmpty(Pram))
            {
                list = list.Where(o => o.HospName.Contains(Pram) || o.HospdepName.Contains(Pram)).ToList();
            }

            this.gridControl1.DataSource = new BindingList <aers_tbl_hospdep>(list);;
            lblcount.Text = "共 " + list.Count + " 条";
        }
Esempio n. 5
0
        public void DataBind(aers_tbl_staff data = null)
        {
            if (data == null)
            {
                staff = new aers_tbl_staff();

                state = FormState.Add;
            }
            else
            {
                staff = data;
                state = FormState.Modify;

                txt_Name.Text = data.Name;
                txt_RoleState.SelectedValue = data.RoleState.ToString();
                txt_Sex.SelectedText        = data.Sex;
                txt_Phone.Text        = data.Phone;
                txt_StaffRemarks.Text = data.Remarks;


                aers_tbl_hospdep hospdep = dalhospdep.FindhospdepByDepId(staff.DepId);



                if (hospdep != null)
                {
                    aers_tbl_hospital listhosp = dalhospital.hospitalFindAll().FirstOrDefault(o => o.HospId == hospdep.HospId);

                    txt_HospId.EditValue = listhosp.HospId;

                    this.txt_HospdepId.Text = hospdep.HospdepName;
                    this.txt_HospdepId.Tag  = hospdep.HospdepId;
                }
            }
        }
Esempio n. 6
0
        public void SetPageData()
        {
            IList <aers_tbl_hospital> listhosp = new aers_tbl_events_ycSqlMapDao().hospitalFindAll();

            IList <aers_tbl_hospdep> listdep = new aers_tbl_hospdepSqlMapDao().hospdepFindAll();

            IList <aers_tbl_eventsresume> list = new aers_tbl_eventsresumeSqlMapDao().GetEventsresumeList().OrderByDescending(o => o.EveresId).ToList();

            IList <aers_sys_statecode> listcode = new aers_sys_statecodeSqlMapDao().FindAll();

            foreach (aers_tbl_eventsresume item in list)
            {
                aers_sys_statecode code = listcode.FirstOrDefault(o => o.ECodeValue == item.EveresName);
                if (code != null)
                {
                    item.EveresName = code.ECodeTag;
                }

                aers_tbl_hospital hosp = listhosp.FirstOrDefault(o => o.HospId == item.HospId);
                if (hosp != null)
                {
                    item.HospId = hosp.HospName;
                }
                aers_tbl_hospdep dep = listdep.FirstOrDefault(o => o.HospdepId == item.HospDepId);
                if (dep != null)
                {
                    item.HospDepId = dep.HospdepName;
                }

                switch (item.ExamineState.ToString())
                {
                case "0":
                    item.ExamineState = "审核中";
                    break;

                case "1":
                    item.ExamineState = "已审核";
                    break;

                case "2":
                    item.ExamineState = "未通过";
                    break;

                case "3":
                    item.ExamineState = "未上报";
                    break;

                default:
                    item.ExamineState = "--";
                    break;
                }
            }

            GridView1.DataSource = list;
            GridView1.DataBind();
        }
        public aers_tbl_hospital hospitalFindByHospId(string HospId)
        {
            String    stmtId = "aers_tbl_hospital_Find";
            Hashtable ht     = new Hashtable();

            ht.Add("HospId", HospId);

            aers_tbl_hospital result = ExecuteQueryForObject <aers_tbl_hospital>(stmtId, ht);

            return(result);
        }
        public int Delete(aers_tbl_hospital data)
        {
            String    stmtId = "aers_tbl_hospital_Delete";
            Hashtable ht     = new Hashtable();

            ht.Add("HospId", data.HospId);
            try
            {
                ExecuteDelete(stmtId, ht);
                return(1);
            }
            catch (Exception)
            {
                return(0);
            }
        }
Esempio n. 9
0
        public void DataBind(aers_tbl_registereduser data = null)
        {
            if (data == null)
            {
                registereduser = new aers_tbl_registereduser();

                state = FormState.Add;
            }
            else
            {
                registereduser = data;
                state          = FormState.Modify;

                txt_LoginName.Text = data.LoginName;
                txt_Remarks.Text   = data.Remarks;



                staff = dalstaff.FindByRUid(data.ReguserId);

                if (staff != null)
                {
                    aers_tbl_hospdep hospdep = dalhospdep.FindhospdepByDepId(staff.DepId);

                    if (hospdep != null)
                    {
                        aers_tbl_hospital listhosp = dalhospital.hospitalFindAll().FirstOrDefault(o => o.HospId == hospdep.HospId);

                        txt_HospId.EditValue = listhosp.HospId;

                        this.txt_HospdepId.Text = hospdep.HospdepName;
                        this.txt_HospdepId.Tag  = hospdep.HospdepId;
                    }


                    txt_Name.Tag  = staff.StaffId;
                    txt_Name.Text = staff.Name;

                    txt_RoleState.Text    = staff.RoleState.ToString();
                    txt_Sex.SelectedValue = staff.Sex;
                    txt_Phone.Text        = staff.Phone;
                    txt_StaffRemarks.Text = staff.Remarks;
                }
            }
        }
Esempio n. 10
0
        private void picdelete_Click(object sender, EventArgs e)
        {
            if (this.gridView1.FocusedRowHandle >= 0)
            {
                aers_tbl_hospital data = this.gridView1.GetRow(this.gridView1.FocusedRowHandle) as aers_tbl_hospital;

                if ((MessageBox.Show("确定要删除吗?", "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes))
                {
                    int i = dal.Delete(data);
                    if (i > 0)
                    {
                        DataBind();
                    }
                    else
                    {
                        MessageBox.Show("删除失败!");
                    }
                }
            }
        }
        public int Update(aers_tbl_hospital data)
        {
            String    stmtId = "aers_tbl_hospital_Update";
            Hashtable ht     = new Hashtable();

            ht.Add("HospId", data.HospId);
            ht.Add("HospName", data.HospName);
            ht.Add("Address", data.Address);
            ht.Add("Phone", data.Phone);
            ht.Add("Contact", data.Contact);
            ht.Add("Grade", data.Grade);
            ht.Add("Validitytime", data.Validitytime);
            ht.Add("IsFlag", data.IsFlag);
            ht.Add("Remarks", data.Remarks);
            ht.Add("OperatorId", data.OperatorId);
            ht.Add("OperatorDate", data.OperatorDate);

            int i = ExecuteUpdate(stmtId, ht);

            return(i);
        }
Esempio n. 12
0
        public void DataBind(aers_tbl_hospital data = null)
        {
            if (data == null)
            {
                hospital = new aers_tbl_hospital();

                state = FormState.Add;
            }
            else
            {
                hospital = data;
                state    = FormState.Modify;

                txt_HospName.Text         = hospital.HospName;
                txt_Grade.Text            = hospital.Grade;
                txt_Address.Text          = hospital.Address;
                txt_Phone.Text            = hospital.Phone;
                txt_Contact.Text          = hospital.Contact;
                txt_Remarks.Text          = hospital.Remarks;
                txt_Validitytime.DateTime = hospital.Validitytime;
            }
        }
Esempio n. 13
0
        protected void btn2_Click(object sender, EventArgs e)
        {
            aers_tbl_events_ycSqlMapDao dal      = new aers_tbl_events_ycSqlMapDao();
            IList <aers_tbl_hospital>   listhosp = dal.hospitalFindAll();



            aers_tbl_eventsresumeSqlMapDao dao  = new aers_tbl_eventsresumeSqlMapDao();
            IList <aers_tbl_eventsresume>  list = dao.GetEventsresumeList().OrderByDescending(o => o.EveresId).ToList();


            foreach (aers_tbl_eventsresume item in list)
            {
                aers_tbl_hospital hosp = listhosp.FirstOrDefault(o => o.HospId == item.HospId);
                if (hosp != null)
                {
                    item.HospId = hosp.HospName;
                }
            }

            GridView1.DataSource = list;
            GridView1.DataBind();
        }
        /// <summary>
        /// 根据注册用户编码查询注册用户信息
        /// </summary>
        /// <param name="reguserId">注册用户编码</param>
        /// <returns>注册用户信息实体</returns>
        public IList <aers_tbl_registereduser> FindAll(string HospID)
        {
            String    stmtId = "aers_tbl_registereduser_FindAll";
            Hashtable ht     = new Hashtable();

            if (!string.IsNullOrEmpty(HospID))
            {
                stmtId = "aers_tbl_registereduser_ByHospId";
                ht.Add("HospId", HospID);
            }

            IList <aers_tbl_registereduser> list = ExecuteQueryForList <aers_tbl_registereduser>(stmtId, ht);


            aers_tbl_registereduserSqlMapDao dal         = new aers_tbl_registereduserSqlMapDao();
            aers_tbl_staffSqlMapDao          dalstaff    = new aers_tbl_staffSqlMapDao();
            aers_tbl_events_ycSqlMapDao      dalhospital = new aers_tbl_events_ycSqlMapDao();
            aers_tbl_hospdepSqlMapDao        dalhospdep  = new aers_tbl_hospdepSqlMapDao();

            IList <aers_tbl_hospital> listhospital = dalhospital.hospitalFindAll();
            IList <aers_tbl_hospdep>  listhospdep  = dalhospdep.hospdepFindAll();

            IList <aers_tbl_staff> liststaff = dalstaff.staffFindAll();


            foreach (aers_tbl_registereduser item in list)
            {
                if (item.LoginName == null)
                {
                    item.LoginName = "";
                }

                aers_tbl_staff sta = liststaff.FirstOrDefault(o => o.ReguserId == item.ReguserId);

                if (sta != null)
                {
                    item.StaffId      = sta.StaffId;
                    item.DepId        = sta.DepId;
                    item.Name         = sta.Name;
                    item.RoleState    = sta.RoleState;
                    item.Position     = sta.Position;
                    item.Phone        = sta.Phone;
                    item.Address      = sta.Address;
                    item.IDNumber     = sta.IDNumber;
                    item.StaffRemarks = sta.Remarks;

                    if (sta.RoleState != null)
                    {
                        if (sta.RoleState.Contains("147"))
                        {
                            item.RoleState = "省厅";
                        }
                        else if (sta.RoleState.Contains("148"))
                        {
                            item.RoleState = "区域";
                        }
                        else if (sta.RoleState.Contains("145"))
                        {
                            item.RoleState = "护理部";
                        }
                        else if (sta.RoleState.Contains("146"))
                        {
                            item.RoleState = "护士长";
                        }
                        else if (sta.RoleState.Contains("402"))
                        {
                            item.RoleState = "护士";
                        }
                        else
                        {
                            item.RoleState = "未知状态";
                        }
                    }



                    if (sta.Sex == "107")
                    {
                        item.Sex = "女";
                    }
                    else if (sta.Sex == "108")
                    {
                        item.Sex = "男";
                    }
                    else
                    {
                        item.Sex = "未知";
                    }
                }
                else
                {
                    item.StaffId      = "";
                    item.DepId        = "";
                    item.Name         = "";
                    item.Position     = "";
                    item.Phone        = "";
                    item.Address      = "";
                    item.IDNumber     = "";
                    item.StaffRemarks = "";
                    item.RoleState    = "";
                    item.Sex          = "";
                    item.RoleState    = "未知状态";
                }



                aers_tbl_hospdep of = listhospdep.FirstOrDefault(o => o.HospdepId == item.DepId);
                if (of != null)
                {
                    item.HospdepName = of.HospdepName;


                    aers_tbl_hospital hosp = listhospital.FirstOrDefault(o => o.HospId == of.HospId);
                    if (hosp != null)
                    {
                        item.HospId          = hosp.HospId;
                        item.HospName        = hosp.HospName;
                        item.hospitalAddress = hosp.Address;
                        item.hospitalPhone   = hosp.Phone;
                        item.Contact         = hosp.Contact;
                        item.Grade           = hosp.Grade;
                        item.Validitytime    = hosp.Validitytime;
                    }
                }
                else
                {
                    item.HospdepName     = "";
                    item.HospId          = "";
                    item.HospName        = "";
                    item.hospitalAddress = "";
                    item.hospitalPhone   = "";
                    item.Contact         = "";
                    item.Grade           = "";
                }
            }

            return(list);
        }