Beispiel #1
0
        /// <summary>
        /// 获取审核历史
        /// </summary>
        /// <param name="id"></param>
        /// <param name="page"></param>
        /// <param name="rows"></param>
        /// <param name="search"></param>
        /// <param name="sidx"></param>
        /// <param name="sord"></param>
        /// <returns></returns>
        public ActionResult AuditHistroy(string id, int page, int rows, string search, string sidx, string sord)
        {
            string VerfiyKey = Request["verfiykey"];
            string DataCode  = Request["DataCode"];

            if (!string.IsNullOrEmpty(VerfiyKey) || !string.IsNullOrEmpty(DataCode))
            {
                var list = atInstance.VerfiyProcessRecords(VerfiyKey, DataCode).ToList();

                //审核人名称替换
                //审核结果字典替换
                foreach (var item in list)
                {
                    var stuffModel = stuffInstance.GetModel(" AND Emp_Code='" + item.VRecord_Owner + "' ");
                    var dictModel  = dictInstance.GetModel(" AND Dict_Key='AuditFlag' AND Dict_Code='" + item.VRecord_Flag + "'");
                    item.VRecord_Owner = stuffModel != null ? stuffModel.Emp_Name : item.VRecord_Owner;
                    item.VRecord_Flag  = dictModel != null ? dictModel.Dict_Name : item.VRecord_Flag;
                    item.DeptName      = stuffModel != null ? stuffModel.Emp_Dept_Name : "";
                }

                var model  = list.AsQueryable <VerifyProcess_Records>();
                var result = model.ToJqGridData(page, rows, null, search, null);
                return(JavaScript(JsonConvert.SerializeObject(result, new JsonDateConverter("yyyy-MM-dd HH:mm"))));
            }
            else
            {
                return(JavaScript(""));
            }
        }
Beispiel #2
0
        //登陆
        public ActionResult LoginBtn()
        {
            //TODO:corporation
            string result   = "fail";
            string msg      = string.Empty;
            string company  = Request["company"];
            string userName = Request["userName"];
            string userPwd  = Request["pwd"];

            //string userRole = Request["role"];
            //string result = "";
            if (!Net.CheckConn())
            {
                return(Json(new { result = result, msg = "无法连接到服务器!请检查网络情况。" }));
            }

            try
            {
                if (userName == null || userPwd == null)
                {
                    result = "fail";
                    msg    = "用户名或密码不能为空";
                    //return Content("Null");
                }
                else
                {
                    Session.RemoveAll();
                    Session.Clear();
                    //TODO:1.4
                    //得到公司
                    // string pwd = Md5.MD5(userPwd.Replace('\'', '"'));
                    string pwd = userPwd;
                    //角色Stuff_LoginType and Stuff_LoginType='" + userRole + "'
                    HR_Stuff = instanceHR_Stuff.GetModel(" and Emp_LoginID='" + userName.Replace('\'', '"') + "' and Emp_LoginPwd='" + pwd + "'");


                    if (HR_Stuff == null)
                    {
                        result = "fail";
                        msg    = "用户名或密码不正确 ";
                    }
                    else
                    {
                        //用户名
                        this.SetSession <string>("UserName", HR_Stuff.Emp_Name);
                        //员工编码
                        this.SetSession <string>("UserId", HR_Stuff.Emp_Code);
                        //员工登录名
                        this.SetSession <string>("LoginName", HR_Stuff.Emp_LoginID);
                        //登录IP
                        this.SetSession <string>("IP", HttpContext.Request.UserHostAddress);

                        //部门信息
                        Bse_Department = instanceDepartment.GetModel(" and Dept_Code='" + HR_Stuff.Emp_Dept_Code + "'");
                        if (Bse_Department != null)
                        {
                            //部门id
                            this.SetSession <string>("DeptId", Bse_Department.Dept_Code.ToString());
                            //部门名称
                            this.SetSession <string>("DeptName", Bse_Department.Dept_Name);
                            //用户角色//hack
                            this.SetSession <string>("UserRole", "");
                            //DODO:hao


                            //Bse_Department fagTemp = instanceBse_Department.GetModel(" and Dept_Code='" + Bse_Department.Dept_PCode.ToString() + "'");
                            //while (!string.IsNullOrEmpty(fagTemp.Dept_PCode))
                            //{
                            //    fagTemp = instanceBse_Department.GetModel(" and Dept_Code='" + fagTemp.Dept_PCode + "'");
                            //}
                            //string companyUser = fagTemp.Dept_Name.ToString();
                            ////公司编码
                            //string companyCode = fagTemp.Dept_Code.ToString();
                            ////this.SetSession<string>("Company", company);
                            //this.SetSession<string>("CompanyCode", companyCode);
                            //部门编码
                            // this.SetSession<string>("DeptCode", Bse_Department.Dept_Code);

                            //TODO:得到公司问题
                            //companyCode=new BLL.Bll_Bse_Department().GetCompanyName("" + Bse_Department.Dept_Code + "");

                            //this.SetSession<string>("Company", companyUser);

                            result = "success";

                            msg = "";
                        }
                        else
                        {
                            result = "fail";
                            msg    = "用户信息配置错误";
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                result = "fail";
                // msg = "网络连接不通,请重试";
                msg = ex.Message;
                // PlateLog.Write("连接异常:", PlateLog.LogMessageType.Error,ex);
            }
            //QX.Log.PlateLog.WriteOp
            //写入登录日志
            Bll_Comm.LoginLog(userName, msg);

            return(Json(new { result = result, msg = msg }));
        }