Пример #1
0
    public List <Package> GetPackageItems(String RegisterNo, int PackageID)
    {
        //0 检查科室 1 检验科室 2 功能科室
        String[]            Names       = new String[] { "医生检查项目", "抽血及其它化验项目", "功能检查项目" };
        GroupResultBusiness GroupResult = new GroupResultBusiness();
        DepartmentBusiness  Department  = new DepartmentBusiness();
        var q = from a in GroupResult.GetGroupResults(RegisterNo)
                join b in Department.GetDepartments() on a.DeptID equals b.DeptID
                group b by b.DeptKind into g
                select new Package {
            RegisterNo  = RegisterNo,
            GroupID     = Convert.ToInt32(g.Key),
            PackageName = Names[Convert.ToInt32(g.Key)] + g.Count() + "项"
        };
        //return q.ToList();
        //Added by pyf 2015-02-26 按23医院要求排序(化验项目 医生检查项目 功能项目)
        List <Package> Groups = q.ToList();
        List <Package> Result = new List <Package>();
        List <Package> Temps  = Groups.Where(p => p.GroupID == 1).ToList();

        if (Temps.Count > 0)
        {
            Result.AddRange(Temps);
        }
        Temps = Groups.Where(p => (p.GroupID == 0 || p.GroupID == 2)).ToList();
        Result.AddRange(Temps);
        //End of added
        return(Result);
    }
Пример #2
0
    /// <summary>
    /// 填充界面
    /// </summary>
    private void SetCheckedItemUI()
    {
        DepartmentBusiness dpt    = new DepartmentBusiness();
        CheckedItemEntity  Result = m_CheckedItem.GetCheckedItem(ItemID);

        if (Result == null)
        {
            return;
        }
        ItemID           = Result.ItemID.Value;
        txtItemName.Text = Result.ItemName;
        txtDeptID.Text   = Result.DeptID + "";

        txtDeptName.Text     = dpt.GetDepartment(Convert.ToInt32(Result.DeptID)).DeptName;
        txtMeasureUnit.Text  = Result.MeasureUnit;
        txtLowerLimit.Text   = Result.LowerLimit;
        txtUpperLimit.Text   = Result.UpperLimit;
        txtNormalTips.Text   = Result.NormalTips;
        txtLowerTips.Text    = Result.LowerTips;
        txtUpperTips.Text    = Result.UpperTips;
        drpSex.SelectedValue = Result.Sex;
        txtPACSCode.Text     = Result.PACSCode;
        txtLISCode.Text      = Result.LISCode;
        chkIsSummary.Checked = false;
        if (Result.IsSummary.HasValue)
        {
            chkIsSummary.Checked = Result.IsSummary.Value;
        }
    }
Пример #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        pnlRed.Visible    = false;
        pnlGreen.Visible  = false;
        pnlYellow.Visible = false;
        pnlBlue.Visible   = false;

        SB = new ServiceBusiness();
        AB = new AccountBusiness();
        EB = new EmployeeBusiness();
        DB = new DepartmentBusiness();
        CB = new CompanyBLL();
        OB = new OrderBusiness();

        GetRouteData();
        cvBillDate.ValueToCompare = DateTime.Now.Date.ToShortDateString();
        if (!IsPostBack)
        {
            loadData();
        }
        else
        {
            String script = WebHelper.Instance.GetJqueryScript("App_Themes/js/jquery/custom_jquery.js");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "MessageWarning", script, true);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        pnlRed.Visible    = false;
        pnlGreen.Visible  = false;
        pnlYellow.Visible = false;
        pnlBlue.Visible   = false;

        EB = new EmployeeBusiness();
        DB = new DepartmentBusiness();
        AB = new AccountBusiness();

        GetRouteData();
        loadData();
        Search();
        if (IsPostBack)
        {
            String script = WebHelper.Instance.GetJqueryScript("App_Themes/js/jquery/custom_jquery.js");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "MessageWarning", script, true);
        }
        else
        {
            ddlSearchBy.Items.Clear();
            ddlSearchBy.Items.Add("All");
            if (IsAdmin())
            {
                ddlSearchBy.Items.Add("Account");
            }
            ddlSearchBy.Items.Add("Employee");
            ddlSearchBy.Items.Add("Department");
        }
    }
Пример #5
0
        public IList <TreeItem> GetAllManagerDepartmentTree(decimal id)
        {
            try
            {
                decimal managerPersonId;
                if (id == 0)
                {
                    managerPersonId = BUser.CurrentUser.Person.ID;
                }
                else
                {
                    managerPersonId = id;
                }

                var manager = ManagerBusiness.GetManager(managerPersonId);
                IList <Department> departments = DepartmentBusiness.GetAllManagerDepartmentTree_JustOrgan(manager.ID);
                return(departments.Select(c => new TreeItem()
                {
                    id = (Int32)c.ID, parentid = (Int32)c.ParentID, text = c.Name
                }).ToList());
            }
            catch (Exception ex)
            {
                this.exceptionHandler.ApiHandleException("OverTimePersonController", ex);
                return(new List <TreeItem>());
            }
        }
Пример #6
0
        private void btnDepartment_Click(object sender, EventArgs e)
        {
            try
            {
                grdAll.DataSource = null;
                //xóa dữ liệu trên grid
                grdAll.Rows.Clear();
                grdAll.Columns.Clear();
                grdAll.Tag = btnDepartment.Tag;

                //Cột ID (ID)
                grdAll.Columns.Add(Utilities.UI.CreateGridTextColumn(LDepartment.Columns.Id, "ID",
                                                                     LDepartment.Columns.Id, null, true));

                //Cột SName
                grdAll.Columns.Add(Utilities.UI.CreateGridTextColumn(LDepartment.Columns.SName, "Tên Khoa",
                                                                     LDepartment.Columns.SName));

                //Cột SDesc
                grdAll.Columns.Add(Utilities.UI.CreateGridTextColumn(LDepartment.Columns.SDesc, "Mô tả",
                                                                     LDepartment.Columns.SDesc));

                grdAll.DataSource = DepartmentBusiness.GetAllDepartment();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            grdAll.DataSource = DepartmentBusiness.GetAllDepartment();
        }
Пример #7
0
        public SelectPageData GetOrganizations()
        {
            try
            {
                var    s2Param    = HttpUtility.ParseQueryString(Request.RequestUri.Query);
                var    pageNum    = s2Param["pageNum"];
                int    pageSize   = Convert.ToInt32(s2Param["pageSize"]);
                string searchTerm = s2Param["searchTerm"];
                int    pageIndex  = pageNum == null ? 0 : Convert.ToInt32(pageNum) - 1;

                IList <Department>      departments = DepartmentBusiness.GetAll().Where(c => c.DepartmentType == DepartmentType.Organization).ToList();
                IQueryable <SelectItem> result      = departments.Select(c => new SelectItem()
                {
                    id = Convert.ToInt32(c.ID), text = c.Name
                }).AsQueryable();

                if (searchTerm != null)
                {
                    result = result.Where(item => item.text.Contains(searchTerm.ToString()));
                }

                return(new SelectPageData
                {
                    items = result.Skip(pageIndex * pageSize).Take(pageSize),
                    total_count = departments.Count
                });
            }
            catch (Exception ex)
            {
                this.exceptionHandler.ApiHandleException("OverTimePersonController", ex);
                throw ex;
            }
        }
Пример #8
0
        public HttpResponseMessage GetAllManagerDepartmentTreeByMelliCode(string code)
        {
            try
            {
                var person = PersonBusinesss.GetByBarcode(code);
                if (person == null)
                {
                    return(Request.CreateResponse(HttpStatusCode.OK, new List <TreeItem>()));
                }

                decimal managerPersonId = person.ID;

                var manager = ManagerBusiness.GetManager(managerPersonId);
                IList <Department> departments = DepartmentBusiness.GetAllManagerDepartmentTree_JustOrgan(manager.ID);

                var result = departments.Select(c => new TreeItem()
                {
                    id = (Int32)c.ID, parentid = (Int32)c.ParentID, text = c.Name
                }).ToList();
                return(Request.CreateResponse(HttpStatusCode.OK, result));
            }
            catch (UIValidationExceptions ex)
            {
                this.exceptionHandler.ApiHandleException("DepartmentController", ex);
                return(Request.CreateResponse(HttpStatusCode.NotFound, ex.ExceptionList.Count > 0 ? ex.ExceptionList[0].Message : ex.Message));
            }
            catch (Exception ex)
            {
                this.exceptionHandler.ApiHandleException("DepartmentController", ex);
                return(Request.CreateResponse(HttpStatusCode.NotFound, ex.Message));
            }
        }
Пример #9
0
    private List <Package> GetPackageItems(String RegisterNo, int PackageID)
    {
        //0 检查科室 1 检验科室 2 功能科室
        String[]                      Names = new String[] { "抽血及其它化验项目", "医生检查项目", "功能检查项目" };
        List <Package>                List  = new List <Package>();
        List <DepartmentEntity>       Departments;
        List <PackageGroupViewEntity> Groups;

        using (PackageBusiness Business = new PackageBusiness()) {
            Groups = Business.GetPackageGroups(PackageID);
        }
        using (DepartmentBusiness Depart = new DepartmentBusiness()) {
            Departments = Depart.GetDepartments();
        }
        var q = from a in Groups
                join b in Departments on a.DeptID equals b.DeptID
                group b by b.DeptKind into g
                select new Package {
            RegisterNo  = RegisterNo,
            GroupID     = Convert.ToInt32(g.Key),
            PackageName = Names[Convert.ToInt32(g.Key)] + g.Count() + "项"
        };

        return(q.ToList());
    }
Пример #10
0
        public SelectPageData GetOrganizations()
        {
            var s2Param = HttpUtility.ParseQueryString(Request.RequestUri.Query);
            var page    = s2Param["page"];
            var size    = s2Param["size"];
            var q       = s2Param["q"];

            int pageIndex = page == null ? 0 : Convert.ToInt32(page) - 1;
            int pageSize  = Convert.ToInt32(size);

            IList <Department>      departments = DepartmentBusiness.GetAll().Where(c => c.DepartmentType == DepartmentType.Organization).ToList();
            IQueryable <SelectItem> result      = departments.Select(c => new SelectItem()
            {
                id = Convert.ToInt32(c.ID), text = c.Name
            }).AsQueryable();

            if (q != null)
            {
                result = result.Where(item => item.text.Contains(q.ToString()));
            }

            return(new SelectPageData
            {
                items = result.Skip(pageIndex * pageSize).Take(pageSize),
                total_count = departments.Count
            });
        }
Пример #11
0
 public List <Department> GetAllDepartment()
 {
     using (SCContext context = new SCContext(_contextName)) {
         IUnitOfWork        uow = new UnitOfWork(context);
         DepartmentBusiness departmentBusiness = new DepartmentBusiness(uow);
         var departments = departmentBusiness.GetAllDepartment();
         return(departments.ToList());
     }
 }
Пример #12
0
 public Department GetDepartmentByCode(string code)
 {
     using (SCContext context = new SCContext(_contextName)) {
         IUnitOfWork        uow = new UnitOfWork(context);
         DepartmentBusiness departmentBusiness = new DepartmentBusiness(uow);
         var department = departmentBusiness.GetDepartmentByCode(code);
         return(department);
     }
 }
Пример #13
0
 private void ClientInitial()
 {
     using (DepartmentBusiness Department = new DepartmentBusiness()) {
         int RecordCount = 0;
         drpDepts.DataSource     = Department.GetDepartments(1, 100, out RecordCount);
         drpDepts.DataValueField = "DeptID";
         drpDepts.DataTextField  = "DeptName";
         drpDepts.DataBind();
     }
 }
Пример #14
0
 public override void DataBind()
 {
     using (DepartmentBusiness Department = new DepartmentBusiness()) {
         int RecordCount = 0;
         DepartmentRepeater.DataSource = Department.GetDepartments(Pager.CurrentPageIndex,
                                                                   Pager.PageSize, out RecordCount);
         Pager.RecordCount = RecordCount;
         base.DataBind();
     }
 }
Пример #15
0
 public bool DeleteDepartment(long id)
 {
     using (SCContext context = new SCContext(_contextName)) {
         IUnitOfWork        uow = new UnitOfWork(context);
         DepartmentBusiness departmentBusiness = new DepartmentBusiness(uow);
         bool success = departmentBusiness.DeleteDepartment(id);
         uow.SaveChanges();
         return(success);
     }
 }
Пример #16
0
 public bool SaveDepartment(Department department)
 {
     using (SCContext context = new SCContext(_contextName)) {
         IUnitOfWork        uow = new UnitOfWork(context);
         DepartmentBusiness departmentBusiness = new DepartmentBusiness(uow);
         bool saved = departmentBusiness.SaveDepartment(department);
         uow.SaveChanges();
         return(saved);
     }
 }
Пример #17
0
        public IList <TreeItem> GetAllManagerDepartmentTree()
        {
            var personId = BUser.CurrentUser.Person.ID;
            var manager  = ManagerBusiness.GetManager(personId);
            IList <Department> departments = DepartmentBusiness.GetAllManagerDepartmentTree(personId);

            return(departments.Select(c => new TreeItem()
            {
                id = (Int32)c.ID, parentid = (Int32)c.ParentID, text = c.Name
            }).ToList());
        }
Пример #18
0
        static void Main(string[] args)
        {
            IDepartmentBusiness idb  = new DepartmentBusiness();
            List <Department>   list = idb.LoadEntities(s => true).ToList();

            foreach (var dep in list)
            {
                Console.WriteLine(dep.DNo + "-------------" + dep.DName);
            }
            Console.ReadKey();
        }
Пример #19
0
 /// <summary>
 /// 系统用户数据绑定
 /// </summary>
 public override void DataBind()
 {
     int recordCount = 0;
     UserRepeater.DataSource = m_User.GetSysUsers(Pager.CurrentPageIndex, Pager.PageSize, out recordCount);
     Pager.RecordCount = recordCount;
     using (DepartmentBusiness Dept = new DepartmentBusiness()) {
         drpDeparts.DataSource = Dept.GetDepartments();
         drpDeparts.DataTextField = "DeptName";
         drpDeparts.DataValueField = "DeptNo";
     }
     base.DataBind();
 }
Пример #20
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            ICourseDataAccess courseDataAccess = new CourseDataAccess();
            ICourseBusiness   courseBusiness   = new CourseBusiness(courseDataAccess);

            IDepartmentDataAccess departmentDataAccess = new DepartmentDataAccess();
            IDepartmentBusiness   departmentBusiness   = new DepartmentBusiness(departmentDataAccess);
            ICourseViewModel      courseViewModel      = new CourseViewModel(courseBusiness, departmentBusiness);

            Application.Run(new CourseRead(courseViewModel));
        }
Пример #21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        pnlRed.Visible    = false;
        pnlGreen.Visible  = false;
        pnlYellow.Visible = false;
        pnlBlue.Visible   = false;

        DB = new DepartmentBusiness();

        String script = WebHelper.Instance.GetJqueryScript("App_Themes/js/jquery/custom_jquery.js");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "MessageWarning", script, true);
    }
Пример #22
0
    /// <summary>
    /// 系统用户数据绑定
    /// </summary>
    public override void DataBind()
    {
        int recordCount = 0;

        UserRepeater.DataSource = m_User.GetSysUsers(Pager.CurrentPageIndex, Pager.PageSize, out recordCount);
        using (DepartmentBusiness Dept = new DepartmentBusiness()) {
            drpDeparts.DataSource     = Dept.GetDepartments();
            drpDeparts.DataTextField  = "DeptName";
            drpDeparts.DataValueField = "DeptID";
        }
        Pager.RecordCount = recordCount;
        base.DataBind();
    }
Пример #23
0
        private void Dispose(bool dispose)
        {
            if (dispose)
            {
                if (_departmentBusiness != null)
                {
                    //_connection.Dispose();
                    _departmentBusiness = null;
                }

                if (_archiveBusiness != null)
                {
                    _archiveBusiness = null;
                }
                if (_eventBusiness != null)
                {
                    _eventBusiness = null;
                }
                if (_imageBusiness != null)
                {
                    _imageBusiness = null;
                }
                if (_imgPhotoGalleryBusiness != null)
                {
                    _imgPhotoGalleryBusiness = null;
                }
                if (_photoGalleryBusiness != null)
                {
                    _photoGalleryBusiness = null;
                }
                if (_videoBusiness != null)
                {
                    _videoBusiness = null;
                }
                if (_repositoryContext != null)
                {
                    _repositoryContext.Dispose();
                    _repositoryContext = null;
                }
                if (_instance != null)
                {
                    _instance = null;
                }
            }
        }
Пример #24
0
    public List <GroupItem> GetGroupItems(String RegisterNo, int PackageID)
    {
        ItemGroupBusiness   ItemGroup   = new ItemGroupBusiness();
        GroupResultBusiness GroupResult = new GroupResultBusiness();
        DepartmentBusiness  Department  = new DepartmentBusiness();
        var q = from a in GroupResult.GetGroupResults(RegisterNo)
                join b in ItemGroup.GetItemGroups() on a.ID.GroupID equals b.GroupID
                join c in Department.GetDepartments() on a.DeptID equals c.DeptID
                select new GroupItem {
            RegisterNo = RegisterNo,
            GroupID    = Convert.ToInt32(c.DeptKind),
            GroupName  = a.GroupName,
            Clinical   = b.Clinical,
            Notice     = b.Notice,
            Price      = b.Price.Value
        };

        q = q.OrderBy(p => p.GroupID);
        return(q.ToList());
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        pnlRed.Visible    = false;
        pnlGreen.Visible  = false;
        pnlYellow.Visible = false;
        pnlBlue.Visible   = false;

        EB = new EmployeeBusiness();
        RB = new RoleBusiness();
        AB = new AccountBusiness();
        DB = new DepartmentBusiness();

        if (!IsPostBack)
        {
            loadData();
        }
        GetRouteData();
        String script = WebHelper.Instance.GetJqueryScript("App_Themes/js/jquery/custom_jquery.js");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "MessageWarning", script, true);
    }
Пример #26
0
        //Update and Insert data in LDepartment
        public void UpdateDepartment()
        {
            LDepartment pitems;
            string      Name      = "";
            var         dataTable = grdAll.DataSource as DataTable;

            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                DataRow dr = dataTable.Rows[i];
                object  c  = dr[LDepartment.Columns.SName];
                //Kiểm tra trạng thái của dòng:
                if ((dr.RowState == DataRowState.Modified) || (dr.RowState == DataRowState.Added))
                {
                    Name = dr[LDepartment.Columns.SName].ToString();

                    if ((Name == ""))
                    {
                        SetTextForWarning(MsgEror);
                        continue;
                    }
                }
                if (dr.RowState == DataRowState.Modified)
                {
                    pitems       = new LDepartment(dr[LDepartment.Columns.Id]);
                    pitems.SName = Name;
                    pitems.SDesc = dr[LDepartment.Columns.SDesc].ToString();
                    DepartmentBusiness.UpdateDepartment(pitems);
                    SetTextForWarning(MsgUpdate);
                }
                else if (dr.RowState == DataRowState.Added)
                {
                    pitems       = new LDepartment();
                    pitems.SName = Name;
                    pitems.SDesc = dr[LDepartment.Columns.SDesc].ToString();
                    dr[LDepartment.Columns.Id] = DepartmentBusiness.InsertDepartment(pitems);
                    SetTextForWarning(MsgNew);
                }
            }
            dataTable.AcceptChanges();
        }
    private void loadInfoPreview()
    {
        AB         = new AccountBusiness();
        account    = AB.GetAccount(Page.User.Identity.Name);
        EB         = new EmployeeBusiness();
        employee   = EB.GetEmployee(account.Employee_Id);
        DB         = new DepartmentBusiness();
        department = DB.GetDepartment(employee.Department_Id);

        imgAvatar.ImageUrl    = WebHelper.Instance.GetImageURL(employee.Employee_Avatar, 128, 128, false);
        imgAvatar.PostBackUrl = WebHelper.Instance.GetURL() + "Account";
        lblUserName.Text      = account.Account_UserName;
        lblRole.Text          = account.Role_Name;
        lblFirstName.Text     = employee.Employee_FirtName;
        lblLastName.Text      = employee.Employee_LastName;
        lblEmail.Text         = employee.Employee_Email;
        lblAddress.Text       = employee.Employee_Address;
        lblPhoneNumber.Text   = employee.Employee_PhoneNumber;
        if (employee.Employee_DateOfBirth.ToShortDateString().Equals("1/1/1900"))
        {
            lblDOB.Text = "";
        }
        else
        {
            lblDOB.Text = employee.Employee_DateOfBirth.ToShortDateString();
        }
        if (employee.Employee_Gender)
        {
            lblGender.Text = "Male";
        }
        else
        {
            lblGender.Text = "Female";
        }
        hplnkModifyProfile.NavigateUrl = WebHelper.Instance.GetURL() + "Account";
        lblDepartmentName.Text         = department.Department_Name;
        lblDescription.Text            = department.Department_Description;
    }
Пример #28
0
    private List <GroupItem> GetGroupItems(String RegisterNo, int PackageID)
    {
        List <DepartmentEntity>       Departments;
        List <PackageGroupViewEntity> Groups;

        using (PackageBusiness Business = new PackageBusiness()) {
            Groups = Business.GetPackageGroups(PackageID);
        }
        using (DepartmentBusiness Depart = new DepartmentBusiness()) {
            Departments = Depart.GetDepartments();
        }
        var q = from a in Groups
                join b in Departments on a.DeptID equals b.DeptID
                select new GroupItem {
            RegisterNo = RegisterNo,
            GroupID    = Convert.ToInt32(b.DeptKind),
            GroupName  = a.GroupName,
            Clinical   = a.Clinical,
            Notice     = a.Notice
        };

        return(q.ToList());
    }
Пример #29
0
        //Xóa dữ liệu trên bảng LDepartment
        private void DeleteDepartment()
        {
            try
            {
                DataGridViewRow currentRow = grdAll.CurrentRow;

                if (currentRow != null)
                {
                    string pid = Utilities.UI.GetCellValue(currentRow.Cells[LDepartment.Columns.Id]);
                    if (pid != "")
                    {
                        if (
                            MessageBox.Show("Bạn có muốn xóa ?", "Thông báo", MessageBoxButtons.YesNo,
                                            MessageBoxIcon.Question) ==
                            DialogResult.Yes)
                        {
                            DepartmentBusiness.DeleteDepartment(Convert.ToInt32(pid));
                            grdAll.Rows.Remove(currentRow);
                            SetTextForWarning(MsgDelete);
                        }
                    }
                    else
                    {
                        SetTextForWarning(MsgEror);
                    }
                }
            }
            catch (Exception ex)
            {
                SetTextForWarning(MsgEror);
            }
            finally
            {
                (grdAll.DataSource as DataTable).AcceptChanges();
            }
        }
Пример #30
0
        private void FrmPatientInfor_Load(object sender, EventArgs e)
        {
            setValivariable();

            LoadDataComboBox(cboDepartment, DepartmentBusiness.GetAllDepartment(), LDepartment.Columns.SName,
                             LDepartment.Columns.Id, -1);

            LoadDataComboBox(cboObject, ObjectBusiness.GetAllObject(), LObjectType.Columns.SName, LObjectType.Columns.Id,
                             0);
            cboObject.SelectedIndex = 0;
            cboSex.SelectedIndex    = 0;
            switch (sFlow)
            {
            case "LIST":
                if (em_Action == action.Update)
                {
                    GetData();
                }
                break;
            }
            txtName.Focus();
            txtName.SelectAll();
            //GenerateNewSid();
        }
 protected override void OnUnload(EventArgs e)
 {
     m_Dept.Dispose();
     m_Dept = null;
     base.OnUnload(e);
 }
Пример #32
0
 protected override void OnUnload(EventArgs e)
 {
     m_Dept.Dispose();
     m_Dept = null;
     base.OnUnload(e);
 }
 protected override void OnInit(EventArgs e)
 {
     m_Dept = new DepartmentBusiness();
     base.OnInit(e);
 }