public ActionResult AddBusinessTrip(string id) //在修改时传递的为contractid { if (id == "-1") //-1为添加 { return(View(new BTApply())); } else//否则为修改 { V_HR_BTWithDepName bt = entities.V_HR_BTWithDepName.Find(id); if (bt == null) { return(HttpNotFound()); } BTApply btt = new BTApply(); btt.ID = bt.ID; btt.StaffID = bt.StaffID; btt.Name = bt.Name; btt.Department = bt.Department; btt.BTPlace = bt.BTPlace; btt.StartTime = Convert.ToDateTime(bt.StartTime); btt.EndTime = Convert.ToDateTime(bt.EndTime); btt.StartTimeStr = btt.StartTime.ToString("yyyy-MM-dd HH:mm"); btt.EndTimeStr = btt.EndTime.ToString("yyyy-MM-dd HH:mm"); btt.TimeSpan = bt.TimeSpan; btt.BTReason = bt.BTReason; btt.Valid = Convert.ToBoolean(bt.Valid); btt.Remark = bt.Remark; btt.CreaterName = bt.CreaterName; btt.CreateTime = Convert.ToDateTime(bt.CreateTime); btt.EditorName = bt.EditorName; btt.EditeTime = Convert.ToDateTime(bt.EditeTime); btt.OperationListID = bt.OperationListID; if (btt.OperationListID != null) { btt.CheckFlowId = btt.GetCheckFlowId; } btt.LastID = bt.LastID; btt.BTEdit = Convert.ToBoolean(bt.BTEdit); btt.BTDelete = Convert.ToBoolean(bt.BTDelete); btt.EditOrDelete = bt.EditOrDelete; return(View(btt)); } }
public ActionResult BusinessTripRemove(string id) { V_HR_BTWithDepName bt = entities.V_HR_BTWithDepName.Find(id); if (bt != null) { BTApply btt = new BTApply(); btt.ID = bt.ID; btt.StaffID = bt.StaffID; btt.Name = bt.Name; btt.Department = bt.Department; btt.BTPlace = bt.BTPlace; btt.StartTime = Convert.ToDateTime(bt.StartTime); btt.EndTime = Convert.ToDateTime(bt.EndTime); btt.StartTimeStr = btt.StartTime.ToString("yyyy-MM-dd HH:mm"); btt.EndTimeStr = btt.EndTime.ToString("yyyy-MM-dd HH:mm"); btt.TimeSpan = bt.TimeSpan; btt.BTReason = bt.BTReason; btt.Valid = Convert.ToBoolean(bt.Valid); btt.Remark = bt.Remark; btt.CreaterName = bt.CreaterName; btt.CreateTime = Convert.ToDateTime(bt.CreateTime); btt.EditorName = bt.EditorName; btt.EditeTime = Convert.ToDateTime(bt.EditeTime); btt.OperationListID = bt.OperationListID; //if (btt.OperationListID != null) // btt.CheckFlowId = btt.GetCheckFlowId; btt.LastID = bt.LastID; btt.BTEdit = Convert.ToBoolean(bt.BTEdit); btt.BTDelete = Convert.ToBoolean(bt.BTDelete); btt.EditOrDelete = bt.EditOrDelete; return(View(btt)); } else { return(HttpNotFound()); } }