private int AddContainers(int JobId) { if (ViewState["BookingCntr"] != null) { Containers = (List <IBookingContainer>)ViewState["BookingCntr"]; } if (Containers.Count > 0) { foreach (BookingContainerEntity obj in Containers) { oJobBll = new JobBLL(); //oBookingContainerEntity = new BookingContainerEntity(); obj.BookingID = JobId; //oBookingContainerEntity.BookingContainerID = Convert.ToInt32(dt.Rows[i]["BookingContainerID"].ToString()); //oBookingContainerEntity.ContainerTypeID = Convert.ToInt32(dt.Rows[i]["ContainerTypeID"].ToString()); //oBookingContainerEntity.CntrSize = dt.Rows[i]["CntrSize"].ToString(); //oBookingContainerEntity.NoofContainers = Convert.ToInt32(dt.Rows[i]["NoofContainers"].ToString()); //oBookingContainerEntity.wtPerCntr = Convert.ToDecimal(dt.Rows[i]["wtPerCntr"].ToString()); int res = oJobBll.AddEditJobContainer(obj); if (res != 1) { return(res); } } return(1); } return(1); }