예제 #1
0
 public JsonResult AnalysisEmpCharge(string beginDate, string endDate)
 {
     List<dynamic> mepChargeList = new EmployeeRule().EmpChargeAnalysis(beginDate, endDate);
     var showList = from empc in mepChargeList
                    select new
                    {
                        name = empc.NAME,
                        y = Convert.ToDouble(string.IsNullOrEmpty(empc.FEECOUNT) ? 0 : empc.FEECOUNT)
                    };
     return Json(showList, JsonRequestBehavior.AllowGet);
 }
예제 #2
0
 public ContentResult GetEmployeeListByName(string q)
 {
     if (!string.IsNullOrEmpty(q))
     {
         q = q.Trim().ToUpper();
     }
     else
     {
         return Content(string.Empty);
     }
     var empList = new EmployeeRule().QueryEmployee(q);
     StringBuilder sbresult = new StringBuilder();
     foreach (dynamic p in empList)
     {
         sbresult.Append(p.NAME);
         sbresult.Append("|");
         sbresult.Append(p.ID);
         sbresult.Append("|");
         sbresult.Append(p.DEPTID);
         sbresult.Append("|");
         sbresult.Append(p.DEPTNAME);
         sbresult.Append("\n");
     }
     return Content(sbresult.ToString());
 }
예제 #3
0
 public ActionResult GetEmployee(string empID)
 {
     object empObj = new EmployeeRule().GetEmployee(empID);
     return Json(empObj, JsonRequestBehavior.AllowGet);
 }
예제 #4
0
 public ActionResult Search(EasyUIGridParamModel param, Employee emp)
 {
     int ItemCount = 0;
     List<dynamic> list = new EmployeeRule().GetSearchJson(param, emp, out ItemCount);
     var listResult = from m in list.ToList()
                      select new
                      {
                          ID = m.ID,
                          NAME = m.NAME,
                          SEX = m.SEX,
                          BIRTHDATE = m.BIRTHDATE,
                          CARDTYPE = m.CARDTYPE,
                          CARDID = m.CARDID,
                          ADDRESS = m.ADDRESS,
                          OfficePhone = m.OFFICEPHONE,
                          DEPTNAME = m.DEPTNAME,
                          CURRENTSTATUS = m.STATUS.Replace("1", "在职").Replace("3", "停职")
                      };
     return Json(new { total = ItemCount, rows = listResult.ToList() }, JsonRequestBehavior.AllowGet);
 }
예제 #5
0
 public ActionResult ModifyEmployee(Employee emp)
 {
     AjaxResult result = new AjaxResult();
     try
     {
         emp.PY = Pinyin.GetPinyin(emp.Name);
         bool flag = new EmployeeRule().Update(emp);
         if (flag)
         {
             result.Success = true;
             result.Message = "客户信息更新成功。";
         }
     }
     catch (Exception ex)
     {
         result.Success = false;
         result.Message = "客户信息更新失败:" + ex.Message;
     }
     return Json(result, JsonRequestBehavior.AllowGet);
 }
예제 #6
0
 public ActionResult GetEmployeesByName(string q)
 {
     List<dynamic> emps = new EmployeeRule().QueryEmployee(q);
     var empList = from emp in emps
                   select new
                   {
                       id = emp.ID,
                       text = emp.NAME
                   };
     return Json(empList, JsonRequestBehavior.AllowGet);
 }