Esempio n. 1
0
 public bool DeletePostion(CompanyPositionSetInfo positionSetInfo)
 {
     using (EntityContext context = new EntityContext())
     {
         context.Delete <CompanyPositionSetInfo>("hr.company.deletePositions", positionSetInfo);
     }
     return(true);
 }
Esempio n. 2
0
        public ActionResult DeletePosition(CompanyPositionSetInfo positionSetInfo)
        {
            bool   pass   = new Manager.EmployeeManager().DeletePostion(positionSetInfo);
            Object result = new
            {
                success = pass,
                data    = pass ? "成功" : "失败"
            };
            JsonResult jsonResult = Json(result, JsonRequestBehavior.AllowGet);

            return(jsonResult);
        }
Esempio n. 3
0
        public bool SavePosition(CompanyPositionSetInfo positionSetInfo)
        {
            bool pass = true;

            using (EntityContext context = new EntityContext())
            {
                try
                {
                    context.BeginTransaction();
                    context.Delete <CompanyPositionSetInfo>("hr.company.deletePositions", positionSetInfo);
                    context.Save <CompanyPositionSetInfo>("hr.company.insertPosition", positionSetInfo);
                    context.Commit();
                }
                catch
                {
                    pass = false;
                    context.Rollback();
                }
            }
            return(pass);
        }