public void UpdateApproveData(tblApprove ap) { PSESEntities db = new PSESEntities(); // tblApprove tmp = GetAllApprove().Where(a => a.ID == ap.ID).FirstOrDefault(); int number = (int)ap.ApproveState; if (ap.GM + ap.HR + ap.PM + ap.ST == 4) { number = 2; } db.SP_UpdateApprove(number, ap.ID, ap.HR, ap.GM, ap.PM, ap.ST); }