public int UpdateCheckState(string strModelCode, string orderID, string strCheckStates, ref string strMsg) { int i = -1; try { using (FBCommonBLL bll = new FBCommonBLL()) { i = bll.UpdateCheckState(strModelCode, orderID, strCheckStates, ref strMsg); } } catch (Exception ex) { strMsg = "单据审核异常,请联系管理员"; throw ex; } // 把消息通过异常机制返回 if (!string.IsNullOrWhiteSpace(strMsg)) { SystemBLL.Debug("审核" + strModelCode + "的单据[" + orderID + "]失败,提示消息为:" + strMsg); throw new Exception(strMsg); } return(i); }
/// <summary> /// 构造函数 /// </summary> public PerfSchemeSettingController() { bll = new PerfSchemeSettingBLL(); appraisebll = new AppraiseSeetingBLL(); dicbll = new DictionaryBLL(); sysbll = new SystemBLL(); yearBll = new YearSettingBLL(); }
public ActionResult settime(FormCollection cl) { string dt = cl["opentime"]; if (SystemBLL.System_UpdateOpenTime(dt)) { Session["opentime"] = dt; } return(RedirectToAction("Index", "Home")); }
/// <summary> /// 数据还原 /// </summary> /// <returns></returns> public ActionResult RestoreDataBase() { try { SystemBLL.RestoreDataBase(); return(Content("yes")); } catch (Exception ex) { return(Content(ex.Message)); } }
public void powerGridViewDataBind(int pageIndex) { int allRecordCount; List <IDataItem> list = this.GetControlValue(); SystemBLL BLL = new SystemBLL(); DataTable dt = BLL.GetStLog(list, this.gridView.PageSize, pageIndex, out allRecordCount, DropScsfcg.SelectedValue); this.gridView.RecordCount = allRecordCount; this.gridView.PageIndex = pageIndex; this.gridView.DataSource = dt; this.gridView.DataBind(); }
public ActionResult Login(string userName, string password) { var userInfo = SystemBLL.System_Login(userName, password); if (userInfo == null) { ModelState.AddModelError("", "Login Failed!"); return(View()); } Session["uid"] = userInfo.userid; FormsAuthentication.SetAuthCookie("isLogin", false); return(RedirectToAction("Index", "Home")); }
protected void Button1_Click(object sender, EventArgs e) { string fileName = "ToExcel" + DateTime.Now.ToString("yyyyMMddhhMMss") + ".xls"; string filepath = AppDomain.CurrentDomain.BaseDirectory + "Z_ToExcel\\" + fileName; string start = startdate.Text; string end = enddate.Text; SystemBLL BLL = new SystemBLL(); DataSet ds = BLL.GetDs(start, end); SaveExcel_Fb1(fileName, ds, this, filepath); filepath = "http://218.90.162.110:8889//Z_ToExcel//" + fileName; this.WindowLocation(filepath); }
public List <T_FB_BUDGETACCOUNT> FetchSalaryBudget(string companyID, string departmentID) { string subjectID = string.Empty; T_FB_SYSTEMSETTINGS setting = SystemBLL.GetSetting(null); if (setting != null) { subjectID = setting.SALARYSUBJECTID; } if (string.IsNullOrEmpty(subjectID)) { return(new List <T_FB_BUDGETACCOUNT>()); } return(FetchBudgetAccount(subjectID, companyID, departmentID, BudgetAccountBLL.AccountObjectType.Deaprtment)); }
public ActionResult GetOrgsJson(bool forSearch = true) { SystemBLL bll = new SystemBLL(); var orgs = bll.GetOrgs(null); var items = new Dictionary <string, string>(); if (forSearch) { items.Add("", "不限考核主体"); } foreach (var item in orgs) { items.Add(item.ORGID, item.ORGNAME); } return(ToJsonResult(SetComboBoxValue(items))); }
public ActionResult Login(string userName, string password) { var userInfo = SystemBLL.System_Login(userName, password); string facultyName = SystemBLL.System_GetFaculty(userInfo.facultyid); if (userInfo == null) { ModelState.AddModelError("", "Login Failed!"); return(View()); } Session["uid"] = userInfo.userid; Session["uname"] = userInfo.username; Session["ufacultyid"] = userInfo.facultyid; Session["uroleid"] = userInfo.roleid; Session["opentime"] = userInfo.opentime.ToString(); Session["facultyname"] = facultyName; FormsAuthentication.SetAuthCookie("isLogin", false); return(RedirectToAction("Index", "Home")); }
public bool HRPersonPostChanged(T_HR_EMPLOYEEPOSTCHANGE personChange, ref string message) { try { using (FBCommonBLL bll = new FBCommonBLL()) { var setting = SystemBLL.GetSetting(null); var qePostID = QueryExpression.Equal(FieldName.OwnerPostID, personChange.FROMPOSTID); var qeOwnerID = QueryExpression.Equal(FieldName.OwnerID, personChange.T_HR_EMPLOYEE.EMPLOYEEID); var qeSubjectID = QueryExpression.Equal("T_FB_SUBJECT.SUBJECTID", setting.MONEYASSIGNSUBJECTID); qePostID.RelatedExpression = qeOwnerID; qeOwnerID.RelatedExpression = qeSubjectID; var entity = bll.GetEntity <T_FB_BUDGETACCOUNT>(qePostID); if (entity != null) { entity.OWNERCOMPANYID = personChange.TOCOMPANYID; entity.OWNERDEPARTMENTID = personChange.TODEPARTMENTID; entity.OWNERPOSTID = personChange.TOPOSTID; entity.OWNERID = personChange.T_HR_EMPLOYEE.EMPLOYEEID; bll.BassBllSave(entity, FBEntityState.Modified); } return(true); } } catch (Exception ex) { message = "修改异动后的预算活动经费数据异常!"; Tracer.Debug(message + " 异常信息: " + ex.ToString()); return(false); } }
protected void Page_Load(object sender, EventArgs e) { try { string loginName = Request.QueryString["loginid"];//获取用户帐号 SystemBLL BLL = new SystemBLL(); if (!string.IsNullOrEmpty(loginName)) { FunctionResult <AppUser> result = BLL.InitAppUserByLoginName(loginName); if (result.Status != FunctionResultStatus.Error) { Session[ConfigManager.GetSignInAppUserSessionName()] = result.Result; LoginManager.SetLoginID(result.Result.UserID); Response.Redirect("MainPage/Index.aspx"); } else { Response.Clear(); Response.Write("您在本系统里没有权限!"); Response.Flush(); Response.End(); } } else { Response.Clear(); Response.Write("非法访问,请从局OA系统登录!"); Response.Flush(); Response.End(); } } catch (Exception ex) { } }
public T_FB_EXTENSIONALORDER UpdateExtensionOrder(string strModelCode, string orderID, string strCheckStates, ref string strMsg) { using (FBCommonBLL fbCommonBLL = new FBCommonBLL()) { try { SystemBLL.Debug("UpdateExtensionOrder方法已被调用,参数:strModelCode: " + strModelCode + ", orderID: " + orderID + ", strCheckStates: " + strCheckStates); QueryExpression queryExpression = QueryExpression.Equal("ORDERID", orderID); if (strModelCode == "Travel") { QueryExpression tempQE = QueryExpression.Equal("TravelSubject", "1"); tempQE.RelatedExpression = QueryExpression.Equal("EXTENSIONALTYPECODE", "CCPX"); queryExpression.RelatedExpression = tempQE; } //查出保存的外部单据 queryExpression.QueryType = typeof(T_FB_EXTENSIONALORDER).Name; queryExpression.IsNoTracking = true; List <FBEntity> listDetail = fbCommonBLL.QueryFBEntities(queryExpression); //如果存在外部单据 if (listDetail.Count > 0) { var saveFBEntity = listDetail[0]; saveFBEntity.Entity.SetValue("CHECKSTATES", Decimal.Parse(strCheckStates)); saveFBEntity.FBEntityState = FBEntityState.Modified; //var temp = fbCommonBLL.FBCommSaveEntity(listDetail[0]); SaveResult temp = new SaveResult(); try { temp.FBEntity = fbCommonBLL.SaveT_FB_EXTENSIONALORDER(listDetail[0]); temp.Successful = true; } catch (Exception ex) { temp.Exception = ex.Message; temp.Successful = false; } if (temp.Successful) { return(temp.FBEntity.Entity as T_FB_EXTENSIONALORDER); } else { strMsg = temp.Exception; } } else { strMsg = "没有可操作的数据"; } } catch (Exception ex) { strMsg = ex.Message; if (!(ex is FBBLLException)) { // strMsg = "单据审核异常,请联系管理员"; Tracer.Debug("审核" + strModelCode + "的单据[" + orderID + "]出现异常,错误消息为:" + ex.ToString()); } } return(null); } }
public int UpdateCheckState(string strModelCode, string orderID, string strCheckStates, ref string strMsg) { int i = -1; try { SystemBLL.Debug("UpdateCheckState方法已被调用,参数:strModelCode: " + strModelCode + ", orderID: " + orderID + ", strCheckStates: " + strCheckStates); // begin 用于出差报销、事项审批的手机提交 if (strModelCode == "Travel") { var tempResult = UpdateExtensionOrder(strModelCode, orderID, strCheckStates, ref strMsg); return((tempResult == null) ? -1 : 1); } // end FBCommonService fbCommonService = new FBCommonService(); List <EntityInfo> EntityInfoList = fbCommonService.GetEntityInfoList(); if (EntityInfoList == null) { strMsg = "预算服务初始化异常,请重试。"; return(-1); } if (EntityInfoList.Count() == 0) { strMsg = "预算服务初始化异常,请重试。"; return(-1); } string strTypeName = ""; string strKeyName = ""; CheckStates cs = CheckStates.UnSubmit; switch (strCheckStates) { case "1": cs = CheckStates.Approving; break; case "2": cs = CheckStates.Approved; break; case "3": cs = CheckStates.UnApproved; break; default: break; } var entityInfo = EntityInfoList.Where(t => t.Type == strModelCode).FirstOrDefault(); strTypeName = entityInfo.Type; strKeyName = entityInfo.KeyName; /////add 2012.12.12 /////传入报销月份为时间去和当前时间判断,如果不在同一年 /////说明该报销单是跨年的,则不能进行审核操作,即当年的报销单只能在当年进行报销 //if (dNewCheckStates == FBAEnums.CheckStates.Approved || dNewCheckStates == FBAEnums.CheckStates.Approving) //{ // if (IsOverYear(entity.BUDGETARYMONTH)) // { // strMsg = "报销单跨年后只能终审不通过(财务规定)"; // Tracer.Debug(strMsg); // return; // } //} using (FBCommonBLL bllCommon = new FBCommonBLL()) { bllCommon.BeginTransaction(); SystemBLL.Debug("BeginTransaction " + strModelCode + " 的单据[" + orderID + "]"); try { QueryExpression qe = QueryExpression.Equal(strKeyName, orderID); qe.QueryType = strTypeName; var data = qe.Query(bllCommon); var order = data.FirstOrDefault(); if (order == null) { strMsg = "没有可操作的数据"; return(-1); } bllCommon.AuditFBEntityWithoutFlow(order, cs, ref strMsg); i = 1; if (string.IsNullOrEmpty(strMsg)) { bllCommon.CommitTransaction(); SystemBLL.Debug("CommitTransaction " + strModelCode + " 的单据[" + orderID + "]"); } else { bllCommon.RollbackTransaction(); SystemBLL.Debug("RollbackTransaction 审核" + strModelCode + "的单据[" + orderID + "]失败,提示消息为:" + strMsg); } } catch (Exception ex) { bllCommon.RollbackTransaction(); SystemBLL.Debug("RollbackTransaction 审核" + strModelCode + "的单据[" + orderID + "]失败,提示消息为:" + strMsg); throw ex; } } } catch (Exception ex) { strMsg = "单据审核异常,请联系管理员"; throw ex; } // 把消息通过异常机制返回 if (!string.IsNullOrWhiteSpace(strMsg)) { SystemBLL.Debug("审核" + strModelCode + "的单据[" + orderID + "]失败,提示消息为:" + strMsg); throw new Exception(strMsg); } return(i); }
public ActionResult Register(UserAccount acc) { SystemBLL.System_CreateNewAccount(acc); return(RedirectToAction("Index", "manager")); }
// GET: Manager public ActionResult Index() { List <StructureAccountToRender> obj = SystemBLL.System_GetListInfoAccount(); return(View(obj)); }
public ActionResult DeleteAccount(int id) { SystemBLL.System_DeteleNewAccount(id); return(RedirectToAction("Index", "Manager")); }
private static void Init() { try { // 初始化OrderBLL SystemBLL.InitOrderBLL(); List<EntityInfo> listResult = new List<EntityInfo>(); List<XElement> listEntityXml = new List<XElement>(); System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); // string path = ConfigurationManager.AppSettings["UIXml"]; string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; doc.Load(path + "\\FB_UI_Config.xml"); XmlNodeList list = doc.SelectNodes("FB/Orders/Order"); foreach (XmlNode node in list) { XElement xOrder = GetXOrder(node); listEntityXml.Add(xOrder); XmlNode nodeEntity = node.SelectSingleNode("OrderEntity/Entity"); if (nodeEntity != null) { EntityInfo eInfo = new EntityInfo(); eInfo.EntityCode = node.Attributes["Type"].Value; eInfo.Type = nodeEntity.Attributes["Type"].Value; eInfo.KeyName = nodeEntity.Attributes["KeyName"].Value; if (nodeEntity.Attributes["CodeName"] != null) { eInfo.CodeName = nodeEntity.Attributes["CodeName"].Value; } listResult.Add(eInfo); } } FBCommonBLL.FBCommonEntityList = listResult; // 预算设置 list = doc.SelectNodes("FB/Settings/Setting"); foreach (XmlNode node in list) { SystemBLL.Settings.Add(node.Attributes["Key"].Value, node.Attributes["Value"].Value); } FBCommonBLL.FBServiceUrl = ConfigurationManager.AppSettings["FBServiceUrl"]; SystemBLL.DebugMode = ConfigurationManager.AppSettings["FBDebugMode"] == "True" ? true : false; #region beyond, 元数据模版 Dictionary<string, XElement> dictXE = new Dictionary<string, XElement>(); System.IO.DirectoryInfo dirInfo = new System.IO.DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory + @"xml\"); dirInfo.GetFiles().ToList().ForEach(item => { XElement xeroot = XElement.Load(item.FullName); XElement xe = xeroot; dictXE.Add(item.Name.ToLower().Replace(".xml", ""), xe); }); AuditBLL.dictXML_XE = dictXE; #endregion } catch (Exception ex) { Tracer.Debug("系统初始化失败" + ex.ToString()); } }