public ActionResult Form2(string id) { DepartmentBLL deptBll = new DepartmentBLL(); Operator user = OperatorProvider.Provider.Current(); var dept = deptBll.GetEntity(user.DeptId); if (dept == null) { user.DeptCode = "0"; } else if (dept.Nature == "部门") { var pdept = deptBll.GetEntity(dept.ParentId); user.DeptCode = pdept == null ? dept.EnCode : pdept.EnCode; } var model = new ToolInventoryEntity(); model.ID = Guid.NewGuid().ToString(); model.CreateDate = DateTime.Now; model.DeptId = user.DeptId; model.DeptCode = user.DeptCode == null ? "0" : user.DeptCode; if (!string.IsNullOrEmpty(id)) { model = tibll.GetEntity(id); } var entity = new DataItemBLL().GetEntityByName("工器具类型"); var list = new DataItemDetailBLL().GetList(entity.ItemId); ViewData["types"] = list.Select(x => new SelectListItem() { Value = x.ItemName, Text = x.ItemName }); return(View(model)); }
private void btnSave_Click(object sender, EventArgs e) { if (txtDepartment.Text.Trim() == "") { MessageBox.Show("Please fill the name field"); } else { DEPARTMENT department = new DEPARTMENT(); if (!isUpdated) { department.DepartamentName = txtDepartment.Text; BLL.DepartmentBLL.AddDepartment(department); MessageBox.Show("Department added!"); txtDepartment.Clear(); } else { DialogResult dialogResult = MessageBox.Show("Are you sure?", "Warning", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { department.ID = detail.ID; department.DepartamentName = txtDepartment.Text; DepartmentBLL.UpdateDepartment(department); MessageBox.Show("Department updated!"); this.Close(); } } } }
public IActionResult Update(int DepartmentId, string Name, string Address) { DepartmentBLL bll = new DepartmentBLL(); bll.Update(DepartmentId, Name, Address); return(RedirectToAction("Index")); }
public IActionResult Insert(string Name, string Address) { DepartmentBLL bll = new DepartmentBLL(); bll.Insert(Name, Address); return(RedirectToAction("Index")); }
private void BindDept() { ddlDept.DataTextField = "Name"; ddlDept.DataValueField = "ID"; ddlDept.DataSource = DepartmentBLL.GetDeptList(); ddlDept.DataBind(); }
/// <summary> /// 工余安健环 /// </summary> /// <param name="deptid"></param> /// <param name="year"></param> /// <param name="month"></param> /// <param name="type">1 交通,2用电,3防火,4体力操作,5其他</param> /// <returns></returns> public ActionResult GetFiveData(string deptid, string year, string month, int type) { try { var searchDept = new DepartmentBLL().GetList().FirstOrDefault(p => p.DepartmentId == deptid); if (searchDept == null) { searchDept = new DepartmentEntity(); } DataTable dt = new SelfEvaluateBLL().GetFiveData(searchDept.DeptCode, year, month, type); List <HseKeyValue> kv = new List <HseKeyValue>(); if (dt.Rows != null && dt.Rows.Count > 0) { var drEnumerator = dt.Rows.GetEnumerator(); while (drEnumerator.MoveNext()) { DataRow drCurrent = drEnumerator.Current as DataRow; string key = drCurrent["KEY"] == null ? "" : drCurrent["KEY"].ToString(); if (!string.IsNullOrWhiteSpace(key)) { kv.Add(new HseKeyValue(key, drCurrent["COUNT"] == null ? 0 : Convert.ToInt32(drCurrent["COUNT"]))); } } } return(Json(new { Code = 0, Data = kv })); } catch (Exception ex) { return(Json(new { Code = -1, ex.Message })); } }
/// <summary> /// 删除公司 /// </summary> /// <param name="entity">公司ID</param> /// <returns></returns> public void CompanyDelete(string id) { try { var entitys = (from ent in dal.GetTable() where ent.COMPANYID == id select ent); if (entitys.Count() > 0) { var entity = entitys.FirstOrDefault(); DepartmentBLL departBll = new DepartmentBLL(); if (GetChildOrgCount(entity.COMPANYID) > 0) { throw new Exception("当前公司有下级公司,不能删除!"); } else { if (departBll.GetDepartCount(entity.COMPANYID) > 0) { throw new Exception("当前公司下有部门,不能删除!"); } else { dal.Delete(entity); CacheManager.RemoveCache("T_HR_COMPANY"); } } } } catch (Exception ex) { throw (ex); } }
public ViewResult Detail(string id) { var categories = new List <SelectListItem>() { new SelectListItem() { Value = "材料费", Text = "材料费" }, new SelectListItem() { Value = "修理费", Text = "修理费" } }; ViewData["categories"] = categories; var user = OperatorProvider.Provider.Current(); var deptbll = new DepartmentBLL(); var dept = deptbll.GetEntity(user.DeptId); if (dept == null) { dept = deptbll.GetRootDepartment(); } var subdepts = deptbll.GetChildDepartments(user.DeptId); var depts = subdepts.OrderBy(x => x.EnCode).Select(x => new SelectListItem() { Value = x.DepartmentId, Text = x.FullName }).ToList(); ViewData["depts"] = depts; ViewBag.id = id; var itemdetialbll = new DataItemDetailBLL(); var itembll = new DataItemBLL(); var main = itembll.GetEntityByName("费用专业类型"); var content = itemdetialbll.GetList(main.ItemId).ToList(); var professionals = content.Select(x => new SelectListItem() { Value = x.ItemValue, Text = x.ItemName }).ToList(); professionals.Insert(0, new SelectListItem() { Value = "", Text = "==请选择==" }); ViewData["professionals"] = professionals; var now = DateTime.Now; var record = new CostRecordEntity() { RecordMonth = new DateTime(now.Year, now.Month, 1), RecordUserId = user.UserId, RecordUser = user.UserName, RecordDeptId = dept.DepartmentId, RecordDept = dept.FullName, RecordTime = DateTime.Now }; return(View(record)); }
protected void gvDept_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "del") { lnkBtn.Visible = true; bType.Visible = true; chkBudgetType.Items.Clear(); BindBudgetType(); int index = int.Parse(e.CommandArgument.ToString()); int key = Convert.ToInt32(gvDept.DataKeys[index].Value.ToString()); hidbudget.Value = key.ToString(); Department dd = DepartmentBLL.GetDepartment(key); lbDept.Text = dd.Name; hidbudget.Value = key.ToString(); List <DeptBudgetItem> bd = LookUpBLL.GetDeptMenuItem(key).ToList(); if (bd.Count() > 0) { foreach (DeptBudgetItem d in bd) { foreach (ListItem l in chkBudgetType.Items) { if (d.MenuItemId.ToString() == l.Value) { l.Selected = true; } } } } } } catch (Exception ex) { } }
/// <summary> /// 获取方案ID /// </summary> /// <param name="sType">0 公司 , 1 部门 ,2 岗位</param> /// <param name="ID"></param> /// <returns></returns> public string GetSolutionIDByIDType(int sType, string ID) { SalarySolutionAssignBLL bll = new SalarySolutionAssignBLL(); string solutionID = bll.GetSolutionIDByAssignObjectID(ID); if (string.IsNullOrEmpty(solutionID)) { if (sType == 2) { PostBLL pbll = new PostBLL(); T_HR_POST post = pbll.GetPostById(ID); solutionID = bll.GetSolutionIDByAssignObjectID(post.T_HR_DEPARTMENT.DEPARTMENTID); if (string.IsNullOrEmpty(solutionID)) { solutionID = bll.GetSolutionIDByAssignObjectID(post.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID); } } else if (sType == 1) { DepartmentBLL dbll = new DepartmentBLL(); T_HR_DEPARTMENT department = dbll.GetDepartmentById(ID); solutionID = bll.GetSolutionIDByAssignObjectID(department.T_HR_COMPANY.COMPANYID); } } return(solutionID); }
private void yxm_SelectedIndexChanged(object sender, EventArgs e)//院系改变,课程下拉框数据源改变 { DepartmentBLL departmentBLL = new DepartmentBLL(); CourseBLL courseBLL = new CourseBLL(); kc.DataSource = courseBLL.deptnoGetcname(departmentBLL.GetDeptno(yxm.Text)); }
public void DepartmentDelete(string depID, ref string strMsg) { using (DepartmentBLL bll = new DepartmentBLL()) { bll.DepartmentDelete(depID, ref strMsg); } }
public void DepartmentCancel(T_HR_DEPARTMENT entity, ref string strMsg) { using (DepartmentBLL bll = new DepartmentBLL()) { bll.DepartmentCancel(entity, ref strMsg); } }
public Dictionary <string, string> GetFatherByDepartmentID(string departmentID) { using (DepartmentBLL bll = new DepartmentBLL()) { return(bll.GetFatherByDepartmentID(departmentID)); } }
public void DepartmentIndexUpdate(T_HR_DEPARTMENT depart, ref string strMsg) { using (DepartmentBLL bll = new DepartmentBLL()) { bll.DepartmentIndexUpdate(depart, ref strMsg); } }
public List <string> GetChildDepartmentBydepartmentID(List <string> departmentIDs) { using (DepartmentBLL bll = new DepartmentBLL()) { return(bll.GetChildDepartmentBydepartmentID(departmentIDs)); } }
public T_HR_DEPARTMENT GetDepartmentById(string depID) { using (DepartmentBLL bll = new DepartmentBLL()) { return(bll.GetDepartmentById(depID)); } }
public bool AddBatchOrgInfo(List <V_ORGANIZATIONINFO> listOrgInfo, string companyID, ref string strMsg) { using (DepartmentBLL bll = new DepartmentBLL()) { return(bll.AddBatchOrgInfo(listOrgInfo, companyID, ref strMsg)); } }
public List <V_DEPARTMENTSWITHCOMPANY> GetDepartmentByCompanyIDs(string strCompanyId) { using (DepartmentBLL departmentBll = new DepartmentBLL()) { return(departmentBll.GetDepartmentByCompanyIDs(strCompanyId)); } }
private void InitDeptInfo() { //Department currentDepartment = DBManager.GetDepartmentInfo(deptCode); DepartmentBLL bll = new DepartmentBLL(); DepartmentInfo currentDepartment = bll.GetDepartmentInfo(deptCode); txtCode.Text = currentDepartment.Code; txtDepartment.Text = currentDepartment.DeptName; txtAbbreviation.Text = currentDepartment.Abbreviation; rblState.SelectedIndex = rblState.Items.IndexOf(rblState.Items.FindByValue(currentDepartment.State.ToString())); ddlDepts.SelectedIndex = ddlDepts.Items.IndexOf(ddlDepts.Items.FindByValue(currentDepartment.ParentCode)); ddlDeptType.SelectedIndex = ddlDeptType.Items.IndexOf(ddlDeptType.Items.FindByValue(currentDepartment.DeptTypeCode)); txtOrderNo.Text = currentDepartment.OrderNo.ToString(); hfOriDeptCode.Value = currentDepartment.ParentCode; //DataTable dt = DBManager.GetSubDepartments(currentDepartment.ParentCode); //IList<DepartmentInfo> dt = bll.GetSubDepartments(orgCode, deptCode); if (currentDepartment.ParentCode == "R0") { rblState.Enabled = false; ddlDepts.Enabled = false; txtOrderNo.Enabled = false; } else { rblState.Enabled = true; ddlDepts.Enabled = true; txtOrderNo.Enabled = true; } }
public async Task <IActionResult> Edit([Bind("DeptCode,DeptName,DeptDesc,CompanyCode,Id,Is_Active,Created_Date,Created_By,Updated_Date,Updated_By")] M_Department m_Department) { if (ModelState.IsValid) { m_Department.Updated_By = await base.CurrentUserId(); ResultObject resultObj; try { using (var deptBll = new DepartmentBLL()) { resultObj = await deptBll.UpdateDepartment(m_Department); _cache.Remove("CACHE_MASTER_DEPARTMENT"); } return(Json(new { success = true, data = (M_Department)resultObj.ObjectValue, message = "Department Update." })); } catch (Exception ex) { return(Json(new { success = false, data = m_Department, message = ex.Message })); } } var err = ModelState.Values.SelectMany(x => x.Errors).Select(x => x.ErrorMessage).ToList(); return(Json(new { success = false, errors = err, data = m_Department, message = "Update Failed" })); }
/// <summary> /// 获取参与率 /// </summary> /// <param name="form">Year 年份 DeptId 部门ID</param> /// <returns></returns> public ActionResult GetCYLCount(FormCollection form) { var year = form["Year"]; var deptid = form["DeptId"]; try { string deptEncode = string.Empty; if (!string.IsNullOrWhiteSpace(deptid)) { var serchDept = new DepartmentBLL().GetEntity(deptid); if (serchDept != null) { deptEncode = serchDept.EnCode; } else { return(Json(new { Code = -1, Message = "未找到要查询的部门" })); } } else { //为空则查全厂,也就是当前的用户的所在组织的Code deptEncode = OperatorProvider.Provider.Current().OrganizeCode; } List <HseKeyValue> data = new HseObserveBLL().GetCYLData(year, deptEncode); return(Json(new { Code = 0, Data = data })); } catch (Exception ex) { return(Json(new { Code = -1, ex.Message })); } }
public JsonResult GetSummaryData(FormCollection fc) { var year = int.Parse(fc.Get("year")); var deptid = fc.Get("deptid"); var deptbll = new DepartmentBLL(); var teams = deptbll.GetSubDepartments(deptid, "班组"); var databll = new DataItemDetailBLL(); var dataitems = databll.GetDataItems("费用类型"); var budgetbll = new BudgetBLL(); var budget = budgetbll.GetBudgetSummary(year, teams.Select(x => x.DepartmentId).ToArray()); var costbll = new CostBLL(); var cost = costbll.GetCostSummary(year, teams.Select(x => x.DepartmentId).ToArray()); var result = new List <BudgetSummaryModel>(); result.AddRange(dataitems.GroupJoin(budget, x => x.ItemValue, y => y.Category, (x, y) => new BudgetSummaryModel { Category = x.ItemValue + "预算", Data = new decimal[] { y.Sum(z => z.Budget1), y.Sum(z => z.Budget2), y.Sum(z => z.Budget3), y.Sum(z => z.Budget4), y.Sum(z => z.Budget5), y.Sum(z => z.Budget6), y.Sum(z => z.Budget7), y.Sum(z => z.Budget8), y.Sum(z => z.Budget9), y.Sum(z => z.Budget10), y.Sum(z => z.Budget11), y.Sum(z => z.Budget12), } })); result.AddRange(dataitems.GroupJoin(cost, x => x.ItemValue, y => y.Category, (x, y) => new BudgetSummaryModel { Category = x.ItemValue + "支出", Data = new decimal[] { y.Where(z => z.Month == 1).Sum(z => z.Amount), y.Where(z => z.Month == 2).Sum(z => z.Amount), y.Where(z => z.Month == 3).Sum(z => z.Amount), y.Where(z => z.Month == 4).Sum(z => z.Amount), y.Where(z => z.Month == 5).Sum(z => z.Amount), y.Where(z => z.Month == 6).Sum(z => z.Amount), y.Where(z => z.Month == 7).Sum(z => z.Amount), y.Where(z => z.Month == 8).Sum(z => z.Amount), y.Where(z => z.Month == 9).Sum(z => z.Amount), y.Where(z => z.Month == 10).Sum(z => z.Amount), y.Where(z => z.Month == 11).Sum(z => z.Amount), y.Where(z => z.Month == 12).Sum(z => z.Amount), } })); result = result.OrderBy(x => x.Category).ToList(); return(Json(result)); }
public JsonResult GetSubjectByDepartment(int DepartmentID) { DepartmentInfo info = DepartmentBLL.GetList(a => a.ID == DepartmentID).FirstOrDefault(); if (null == info) { return(Json(new APIJson(-1, "请选择学校"))); } var listSubject = info.DepartmentTypeInfo .SelectMany(a => a.SubjectInfo) .Distinct(); if (!PowerActionBLL.PowerCheck(PowerInfo.P_评课管理.PP组织调研.PPP听评课管理.查看所有学科)) { var CurrentUserListSubjectID = CurrentUser.SubjectInfo.Select(a => a.ID); listSubject = listSubject.Where(a => CurrentUserListSubjectID.Contains(a.ID)); } var result = listSubject.OrderBy(a => a.Name).Select(a => new { a.ID, a.Name }); return(Json(new APIJson(0, "", result))); }
private void FrmDepartmentList_Load(object sender, EventArgs e) { list = DepartmentBLL.GetDepartments(); dataGridView1.DataSource = list; dataGridView1.Columns[0].HeaderText = "Department ID"; dataGridView1.Columns[1].HeaderText = "Departmetn Name"; }
/// <summary> /// 给栏目绑定指标 页面 /// </summary> /// <param name="keyValue">栏目Id</param> /// <param name="indexType">所属平台 0web平台 1安卓平台 2App</param> /// <param name="Templet">所属栏目</param> /// <returns></returns> public ActionResult TerminalBindForm(string keyValue, int indexType, int Templet) { Operator user = OperatorProvider.Provider.Current(); DepartmentEntity userdept = new DepartmentBLL().GetCompany(user.DeptId); TerminalDataSetBLL dataSetBLL = new TerminalDataSetBLL(); List <TerminalDataSetEntity> indexlist = new List <TerminalDataSetEntity>(); indexlist = dataSetBLL.GetList().Where(p => p.IsOpen == 1).ToList(); //if (indexType == 2) //{ // indexlist = dataSetBLL.GetList().Where(p => p.IsOpen == 1 && (p.DataSetType == indexType.ToString() )).ToList(); //所有的手机APP指标 //} //else //{ // indexlist = dataSetBLL.GetList().Where(p => p.IsOpen == 1 && (p.DataSetType == indexType.ToString() || p.DataSetType == null)).ToList(); //所有的终端指标 //} //查询本IndexType的栏目 var titleIds = manageBLL.GetList(userdept.DepartmentId, indexType).Where(x => x.Templet == Templet).Select(x => x.Id); //查找所有的关联关系 IIndexAssocationBLL indexAssocationBLL = new IIndexAssocationBLL(); List <IndexAssocationEntity> indices = indexAssocationBLL.GetListByTitleId(titleIds.ToArray()); //先剔除非本IndexType的关联关系 indices = indices.Where(x => titleIds.Contains(x.TitleId)).ToList(); //查询未被其他标题绑定的指标 var BindIds = indices.Where(x => x.TitleId != keyValue).Select(p => p.DataSetId); //非当前标题 已经的被帮的指标 var thisBindIds = indices.Where(x => x.TitleId == keyValue).Select(p => p.DataSetId); //当前标题绑定的指标 var data = indexlist.Where(x => !BindIds.Contains(x.Id)).ToList(); //当前标题 可显示的指标 ViewBag.ChceckIds = thisBindIds.ToList(); ViewBag.TitleId = keyValue; return(View(data)); }
public ActionResult GetEngineerDeptList() { DepartmentBLL deptbll = new DepartmentBLL(); Operator curUser = OperatorProvider.Provider.Current(); string roleNames = curUser.RoleName; //分页获取数据 Pagination pagination = new Pagination(); pagination.page = 1; // int.Parse(dy.page ?? "1"); pagination.rows = 9000; //int.Parse(dy.rows ?? "1"); pagination.p_kid = "departmentid"; pagination.p_fields = @" organizeid,parentid,encode,fullname,shortname,nature "; pagination.p_tablename = @"base_department"; pagination.sidx = "encode"; //排序字段 pagination.sord = "desc"; //排序方式 pagination.conditionJson = " nature='承包商' "; if (curUser.IsSystem || curUser.RoleName.Contains("厂级部门用户") || curUser.RoleName.Contains("公司级用户") || curUser.RoleName.Contains("公司管理员")) { pagination.conditionJson += string.Format(" and encode like '{0}%' ", curUser.OrganizeCode); } else if (curUser.RoleName.Contains("承包商级用户")) { pagination.conditionJson += string.Format(" and departmentid ='{0}'", curUser.DeptId); } else { pagination.conditionJson += string.Format(" and departmentid in(select distinct(e.outprojectid) from epg_outsouringengineer e where e.engineerletdeptid='{0}')", curUser.DeptId); } var data = deptbll.GetPageList(pagination, ""); return(Content(data.ToJson())); }
private void btnSave_Click(object sender, EventArgs e) { if (txtDepartment.Text.Trim() == "") { MessageBox.Show("Please fill the Department Field"); } else { Department department = new Department(); if (!isUpdate) { department.DepartmentName = txtDepartment.Text; BLL.DepartmentBLL.AddDepartment(department); MessageBox.Show("The Department was created"); } else { DialogResult result = MessageBox.Show("Are you sure?", "Warning", MessageBoxButtons.YesNo); if (DialogResult.Yes == result) { department.ID = detail.ID; department.DepartmentName = txtDepartment.Text; DepartmentBLL.UpdateDepartment(department); MessageBox.Show("The Department was updated"); this.Close(); } } } }
private void btnOk_Click(object sender, EventArgs e) { var departmentName = txtDepartmentName.Text.Trim(); if (this.ValidateChildren(ValidationConstraints.Enabled) == false) { return; } CResult <bool> result; var bll = new DepartmentBLL(); if (_isEdit) { result = bll.UpdateDepartment(departmentName, _departmentID); } else { result = bll.AddDepartment(departmentName); } if (result.Code > 0) { DlgHelper.ShowAlertMsgBox(result.Msg); return; } this.Close(); if (CallBack != null) { CallBack(); } }
public ActionResult AdminWindos() { Operator user = ERCHTMS.Code.OperatorProvider.Provider.Current(); string bzUrl = detailBLL.GetItemValue("bzWebUrl"); string bzIndex = detailBLL.GetItemValue("bzIndex"); //var doshboard = detailBLL.GetItemValue("班组首页"); //string args = BSFramework.Util.DESEncrypt.Encrypt(string.Concat(user.Account, "^" + doshboard + "^", System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "^DLBZ")); //ViewBag.doshboard = bzUrl + "login/signin?args=" + args; ViewBag.bzUrl = bzUrl; ViewBag.bzIndex = bzIndex; if (user == null) { WebHelper.WriteCookie("login_error", "Overdue");//登录已超时,请重新登录 return(RedirectToAction("Index", "Login")); } //是否配置违章管理模块 DataTable dt = new DepartmentBLL().GetDataTable(string.Format("select count(1) from base_appsettingassociation a where a.deptid='{0}' and a.moduleid in(select id from BASE_MENUCONFIG t where t.modulecode='PECCANCY_ADD')", user.OrganizeId)); ViewBag.IsWz = dt.Rows[0][0].ToString(); //是否配置问题管理模块 dt = new DepartmentBLL().GetDataTable(string.Format("select count(1) from base_appsettingassociation a where a.deptid='{0}' and a.moduleid in(select id from BASE_MENUCONFIG t where t.modulecode='QUESTION_ADD')", user.OrganizeId)); ViewBag.IsWt = dt.Rows[0][0].ToString(); return(View()); }
public Dictionary<string, string> GetFatherByDepartmentID(string departmentID) { using (DepartmentBLL bll = new DepartmentBLL()) { return bll.GetFatherByDepartmentID(departmentID); } }
public T_HR_DEPARTMENT GetDepartmentById(string depID) { using (DepartmentBLL bll = new DepartmentBLL()) { return bll.GetDepartmentById(depID); } }
public List<T_HR_DEPARTMENT> DepartmentPaging(int pageIndex, int pageSize, string sort, string filterString, IList<object> paras, ref int pageCount, string userID, string checkState) { using (DepartmentBLL bll = new DepartmentBLL()) { var ents = bll.DepartmentPaging(pageIndex, pageSize, sort, filterString, paras, ref pageCount, userID, checkState); if (ents != null) { return ents.Count() > 0 ? ents.ToList() : null; } else { return null; } } // return ents.Count() > 0 ? ents.ToList() : null; }
public List<string> GetChildDepartmentBydepartmentID(List<string> departmentIDs) { using (DepartmentBLL bll = new DepartmentBLL()) { return bll.GetChildDepartmentBydepartmentID(departmentIDs); } }
public List<T_HR_DEPARTMENT> GetDepartmentByEntityPerm(string userID, string perm, string entity) { using (DepartmentBLL bll = new DepartmentBLL()) { IQueryable<T_HR_DEPARTMENT> ents = null; if (string.IsNullOrEmpty(perm) || string.IsNullOrEmpty(entity)) ents = bll.GetDepartmentActived(userID); else ents = bll.GetDepartmentActived(userID, perm, entity); return ents.Count() > 0 ? ents.ToList() : null; } }
public List<T_HR_DEPARTMENT> GetDepartmentWithSpecifiedTime(string startDate) { using (DepartmentBLL bll = new DepartmentBLL()) { var ents = bll.GetDepartmentWithSpecifiedTime(startDate); if (ents != null) { return ents.Count() > 0 ? ents.ToList() : null; } else { return null; } } }
public List<SMT.HRM.CustomModel.V_DEPARTMENT> GetDepartmentViewByDateAndUser(string startDate, string userID) { using (DepartmentBLL bll = new DepartmentBLL()) { var ents = bll.GetDepartmentViewByDateAndUser(startDate, userID); if (ents != null) { return ents.Count() > 0 ? ents.ToList() : null; } else { return null; } } }
public List<T_HR_DEPARTMENT> GetDepartmentAll(string userID) { using (DepartmentBLL bll = new DepartmentBLL()) { var ents = bll.GetDepartmentAll(userID); return ents.Count() > 0 ? ents.ToList() : null; } }
public List<T_HR_DEPARTMENT> GetDepartmentActivedByCompanyIDAndUserID(string companyID, string userID) { using (DepartmentBLL bll = new DepartmentBLL()) { var ents = bll.GetDepartmentActivedByCompanyIDAndUserID(companyID, userID); return ents.Count() > 0 ? ents.ToList() : null; } }
public List<V_DEPARTMENTSWITHCOMPANY> GetDepartmentByCompanyIDs(string strCompanyId) { using (DepartmentBLL departmentBll = new DepartmentBLL()) { return departmentBll.GetDepartmentByCompanyIDs(strCompanyId); } }
public List<V_ORGANIZATIONINFO> ImportOrgInfo(UploadFileModel uploadFile, string companyID, Dictionary<string, string> empInfoDic) { using (DepartmentBLL bll = new DepartmentBLL()) { string strPath = SaveFile(uploadFile);//获取文件路径 string strPhysicalPath = HttpContext.Current.Server.MapPath(strPath);//到时测试strPath为空是是否报错 return bll.ImportOrgInfo(strPhysicalPath, companyID, empInfoDic); } }
public List<SMT.HRM.CustomModel.V_DEPARTMENT> GetAllDepartmentView(string userID) { using (DepartmentBLL bll = new DepartmentBLL()) { var ents = bll.GetAllDepartmentView(userID); return ents.Count() > 0 ? ents.ToList() : null; } }
public List<SMT.HRM.CustomModel.V_DEPARTMENT> GetDepartmentViewByApproval(string userID, string perm, string entity) { using (DepartmentBLL bll = new DepartmentBLL()) { var ents = bll.GetDepartmentView(userID, perm, entity); return ents.Count() > 0 ? ents.ToList() : null; } }
public bool AddBatchOrgInfo(List<V_ORGANIZATIONINFO> listOrgInfo,string companyID, ref string strMsg) { using (DepartmentBLL bll = new DepartmentBLL()) { return bll.AddBatchOrgInfo(listOrgInfo,companyID,ref strMsg); } }
/// <summary> /// 通过模块名查找使用流程 /// </summary> /// <param name="CompanyID"></param> /// <param name="DepartID"></param> /// <param name="ModelCode"></param> /// <param name="FlowType"></param> /// <returns></returns> public static List<FLOW_MODELFLOWRELATION_T> GetFlowByModelName(string CompanyID, string DepartID, string ModelCode, string FlowType, ref FlowUser user) { try { //Flow_ModelFlowRelation_TDAL Dal = new Flow_ModelFlowRelation_TDAL(); //以部门查找流程 Tracer.Debug("以部门查找流程FLOW_MODELFLOWRELATION_TDAL.GetFlowByModelName:OrgType='1' ;CompanyID=" + CompanyID + ";DepartID=" + DepartID + ";FlowType=" + FlowType + ""); List<FLOW_MODELFLOWRELATION_T> xoml = FLOW_MODELFLOWRELATION_TDAL.GetFlowByModelName(CompanyID, DepartID, ModelCode, FlowType, "1"); if (xoml != null && xoml.Count > 0) //找到匹配流程返回 { #region 写日志 if (user != null) { if (CompanyID == user.CompayID && DepartID == user.DepartmentID) { Tracer.Debug("FormID=" + user.FormID + ";找到公司[ " + user.CompayName + " ]下部门[ " + user.DepartmentName + " ]的匹配流程返回"); } } #endregion return xoml; } //部门的上级机构(一般是公司)查找流程 if (user != null) { Tracer.Debug("FormID=" + user.FormID + ";没有找到公司[ " + user.CompayName + " ]下部门[ " + user.DepartmentName + " ]的匹配流程返回,继续部门的上级机构查找流程"); } //OrganizationServiceClient Organization = new OrganizationServiceClient(); Dictionary<string, string> OrganizationList = new Dictionary<string, string>(); using (DepartmentBLL bll = new DepartmentBLL()) { OrganizationList = bll.GetFatherByDepartmentID(DepartID); } Tracer.Debug("FormID=" + user.FormID + ";继续查找部门的上级机构"); if (OrganizationList == null || OrganizationList.Count <= 0) { string info = "FormID=" + user.FormID + ";没有找到所在部门的上级机构"; #region 写日志 if (user != null) { if (DepartID == user.DepartmentID) { info = "FormID=" + user.FormID + ";没有找到所在部门[ " + user.DepartmentName + " ]的上一级上级机构"; Tracer.Debug(info); } } #endregion throw new Exception("没有找到所在部门[ " + user.DepartmentName + " ]的上一级上级机构"); } foreach (var item in OrganizationList) { if (item.Value == "0") { xoml = FLOW_MODELFLOWRELATION_TDAL.GetFlowByModelName(CompanyID, item.Key, ModelCode, FlowType, "0"); //如果上级机构是公司直接查询公司关联流程并返回 #region 写日志 if (user.CompayID == CompanyID) { Tracer.Debug("FormID=" + user.FormID + ";找到所在部门[ " + user.DepartmentName + " ]的上一级上级机构 [" + user.CompayName + "]"); } else { Tracer.Debug("FormID=" + user.FormID + ";找到所在部门[ " + user.DepartmentName + " ]的上一级上级机构 "); } #endregion return xoml; } xoml = FLOW_MODELFLOWRELATION_TDAL.GetFlowByModelName(CompanyID, item.Key, ModelCode, FlowType, "1"); if (xoml != null && xoml.Count > 0) //找到匹配流程返回 { #region 写日志 if (user.CompayID == CompanyID) { Tracer.Debug("FormID=" + user.FormID + ";找到所在部门[ " + user.DepartmentName + " ]的上一级上级机构 [" + user.CompayName + "]"); } else { Tracer.Debug("FormID=" + user.FormID + ";找到所在部门[ " + user.DepartmentName + " ]的上一级上级机构 "); } #endregion return xoml; } } return xoml; } catch (Exception ex) { Tracer.Debug("FlowBLL->GetFlowByModelName:" + ex.Message); throw new Exception("GetFlowByModelName:" + ex.Message);// return null; } }