public string InsertTaskDetails(GET_TASK_DETAILS_Result objGET_TASK_DETAILS_Result) { using (TaskManagerEntities db = new TaskManagerEntities()) { var vInsertTaskDetails = db.INSERT_TASK_DETAILS(objGET_TASK_DETAILS_Result.Task_ID, objGET_TASK_DETAILS_Result.Parent_ID, objGET_TASK_DETAILS_Result.Task, objGET_TASK_DETAILS_Result.Start_Date, objGET_TASK_DETAILS_Result.End_Date, objGET_TASK_DETAILS_Result.Priority); db.SaveChanges(); return(Convert.ToString(vInsertTaskDetails)); } }
/// <summary> /// /// </summary> /// <param name="objGET_TASK_DETAILS_Result"></param> /// <returns></returns> public string InsertTaskDetails(Get_Task_Details_Result objGET_TASK_DETAILS_Result) { using (TaskManagerEntities db = new TaskManagerEntities()) { objGET_TASK_DETAILS_Result.Task_ID = objGET_TASK_DETAILS_Result.Task_ID == null ? "0" : objGET_TASK_DETAILS_Result.Task_ID; if (objGET_TASK_DETAILS_Result.Task_ID == null || objGET_TASK_DETAILS_Result.Task_ID == "") { objGET_TASK_DETAILS_Result.Task_ID = "0"; } if (objGET_TASK_DETAILS_Result.Parent_ID == null || objGET_TASK_DETAILS_Result.Parent_ID == "") { objGET_TASK_DETAILS_Result.Parent_ID = "0"; } var vInsertTaskDetails = db.INSERT_TASK_DETAILS(Convert.ToInt32(objGET_TASK_DETAILS_Result.Task_ID), Convert.ToInt32(objGET_TASK_DETAILS_Result.Parent_ID), objGET_TASK_DETAILS_Result.Task, objGET_TASK_DETAILS_Result.Start_Date, objGET_TASK_DETAILS_Result.End_Date, objGET_TASK_DETAILS_Result.Priority); db.SaveChanges(); return(Convert.ToString(vInsertTaskDetails)); } }