public static void UpdateVesselPlan(int vpID, string vesselName, string vesselEnglishName, int vesselType, string voyageNumber, string importOrExportFlag, DateTime arrivePlanTime, DateTime?arriveActualTime, DateTime departurePlanTime, DateTime?departureActualTime, string berthPlan, string berthActual, bool isCustomsClosing, int status, string csi, DateTime containerBeginTime, DateTime containerDeadline, string agency, int portOfCallID, bool isActive, string remark) { string sql = @"UPDATE [VesselPlan] SET VesselName = @vesselName, VesselEnglishName = @vesselEnglishName, VesselType=@vesselType, VoyageNumber=@voyageNumber, ImportOrExportFlag = @importOrExportFlag, ArrivePlanTime = @arrivePlanTime, ArriveActualTime = @arriveActualTime, DeparturePlanTime = @departurePlanTime,DepartureActualTime = @departureActualTime BerthPlan = @berthPlan, BerthActual=@berthActual, IsCustomsClosing=@isCustomsClosing, CSI=@csi, ContainerBeginTime=containerBeginTime, ContainerDeadline=@containerDeadline Status=@status, Agency=@agency, PortOfCallID=@portOfCallID, IsActive=@isActive, Remark=@remark WHERE ID = @vpID"; SqlParameter[] para = { new SqlParameter("@vpID", vpID), new SqlParameter("@vesselName", vesselName), new SqlParameter("@vesselEnglishName", vesselEnglishName), new SqlParameter("@vesselType", vesselType), new SqlParameter("@voyageNumber", voyageNumber), new SqlParameter("@importOrExportFlag", importOrExportFlag), new SqlParameter("@arrivePlanTime", arrivePlanTime), new SqlParameter("@arriveActualTime", arriveActualTime.HasValue ? (object)arriveActualTime.Value : (object)DBNull.Value), new SqlParameter("@departurePlanTime", departurePlanTime), new SqlParameter("@departureActualTime", departureActualTime.HasValue ? (object)departureActualTime.Value : (object)DBNull.Value), new SqlParameter("@berthPlan", berthPlan), new SqlParameter("@berthActual", berthActual), new SqlParameter("@isCustomsClosing", isCustomsClosing), new SqlParameter("@status", status), new SqlParameter("@csi", csi), new SqlParameter("@containerBeginTime", containerBeginTime), new SqlParameter("@containerDeadline", containerDeadline), new SqlParameter("@agency", agency), new SqlParameter("@PortOfCallID", portOfCallID), new SqlParameter("@isActive", isActive), new SqlParameter("@remark", remark) }; SqlHelper.ExecuteNonQuery(ConnectStringMsSql.GetConnection(), CommandType.Text, sql, para); }
public static void UpdateContainer(int cID, string containerNo, DateTime arriveTime, DateTime departureTime, string arriveType, string departureType, string customsClearance, int vesselID, DateTime arrivalContainerTime, DateTime customsClearanceTime, DateTime stowageTime, DateTime vesselTime, DateTime planTime, DateTime planAcceptedTime, string vesselName, string voyageNumber, string billOfLadingNum, DateTime arrivalPortTime, DateTime sendPackingListTime, DateTime planAarrangeTime, string acceptanceNo, bool isActive, string remark) { string sql = @"UPDATE [Container] SET containerNo = @containerNo, ArriveTime = @arriveTime, DepartureTime=@departureTime, ArriveType = @arriveType, DepartureType = @departureType, CustomsClearance=@customsClearance VesselID=@vesselID, ArrivalContainerTime = @arrivalContainerTime, CustomsClearanceTime = @customsClearanceTime, StowageTime = @stowageTime, VesselTime = @vesselTime, PlanTime = @planTime, PlanAcceptedTime=@planAcceptedTime, VesselName=@vesselName, VoyageNumber = @voyageNumber, BillOfLadingNum = @billOfLadingNum, ArrivalPortTime = @arrivalPortTime, SendPackingListTime = @sendPackingListTime, PlanAarrangeTime = @planAarrangeTime AcceptanceNo=@acceptanceNo WHERE ID = @cID"; SqlParameter[] para = { new SqlParameter("@cID", cID), new SqlParameter("@containerNo", containerNo), new SqlParameter("@arriveTime", arriveTime), new SqlParameter("@departureTime", departureTime), new SqlParameter("@arriveType", arriveType), new SqlParameter("@departureType", departureType), new SqlParameter("@customsClearance", customsClearance), new SqlParameter("@vesselID", vesselID), new SqlParameter("@arrivalContainerTime", arrivalContainerTime), new SqlParameter("@customsClearanceTime", customsClearanceTime), new SqlParameter("@stowageTime", stowageTime), new SqlParameter("@vesselTime", vesselTime), new SqlParameter("@planTime", planTime), new SqlParameter("@planAcceptedTime", planAcceptedTime), new SqlParameter("@vesselName", vesselName), new SqlParameter("@voyageNumber", voyageNumber), new SqlParameter("@billOfLadingNum", billOfLadingNum), new SqlParameter("@arrivalPortTime", arrivalPortTime), new SqlParameter("@sendPackingListTime", sendPackingListTime), new SqlParameter("@planAarrangeTime", planAarrangeTime), new SqlParameter("@acceptanceNo", acceptanceNo), new SqlParameter("@isActive", isActive), new SqlParameter("@remark", remark), }; SqlHelper.ExecuteNonQuery(ConnectStringMsSql.GetConnection(), CommandType.Text, sql, para); }
public static void InsertVesselPlan(int vpID, string vesselName, string vesselEnglishName, int vesselType, string voyageNumber, string importOrExportFlag, DateTime arrivePlanTime, DateTime?arriveActualTime, DateTime departurePlanTime, DateTime?departureActualTime, string berthPlan, string berthActual, bool isCustomsClosing, int status, string csi, DateTime containerBeginTime, DateTime containerDeadline, string agency, int portOfCallID, bool isActive, string remark) { string sql = @"INSERT INTO [VesselPlan] (VesselName, VesselEnglishName, VesselType, VoyageNumber, ImportOrExportFlag, ArrivePlanTime, ArriveActualTime, DeparturePlanTime, DepartureActualTime, BerthPlan, BerthActual, IsCustomsClosing, Status, CSI, ContainerBeginTime, ContainerDeadline, Agency, PortOfCallID, IsActive, Remark) VALUES (@vesselName, @vesselEnglishName, @vesselType, @voyageNumber, @importOrExportFlag, @arrivePlanTime, @arriveActualTime, @departurePlanTime, @departureActualTime, @berthPlan, @berthActual, @isCustomsClosing, @status, @csi, @containerBeginTime, @containerDeadline, @agency, @portOfCallID, @isActive, @remark)"; SqlParameter[] para = { new SqlParameter(), new SqlParameter("@vesselName", vesselName), new SqlParameter("@vesselEnglishName", vesselEnglishName), new SqlParameter("@vesselType", vesselType), new SqlParameter("@voyageNumber", voyageNumber), new SqlParameter("@importOrExportFlag", importOrExportFlag), new SqlParameter("@arrivePlanTime", arrivePlanTime), new SqlParameter("@arriveActualTime", arriveActualTime.HasValue ? (object)arriveActualTime.Value : (object)DBNull.Value), new SqlParameter("@departurePlanTime", departurePlanTime), new SqlParameter("@departureActualTime",departureActualTime.HasValue ? (object)departureActualTime.Value : (object)DBNull.Value), new SqlParameter("@berthPlan", berthPlan), new SqlParameter("@berthActual", berthActual), new SqlParameter("@isCustomsClosing", isCustomsClosing), new SqlParameter("@status", status), new SqlParameter("@csi", csi), new SqlParameter("@containerBeginTime", containerBeginTime), new SqlParameter("@containerDeadline", containerDeadline), new SqlParameter("@agency", agency), new SqlParameter("@portOfCallID", portOfCallID), new SqlParameter("@isActive", isActive), new SqlParameter("@remark", remark) }; SqlHelper.ExecuteNonQuery(ConnectStringMsSql.GetConnection(), CommandType.Text, sql, para); }
public static void DeleteVesselPlan(int vpID) { string sql = "DELETE FROM [VesselPlan] WHERE ID = @vpID"; SqlParameter[] para = { new SqlParameter("@vpID", vpID) }; SqlHelper.ExecuteNonQuery(ConnectStringMsSql.GetConnection(), CommandType.Text, sql, para); }
public static void DeleteTruck(int tID) { string sql = "DELETE FROM [Truck] WHERE ID = @tID"; SqlParameter[] para = { new SqlParameter("@ctID", tID) }; SqlHelper.ExecuteNonQuery(ConnectStringMsSql.GetConnection(), CommandType.Text, sql, para); }
public static void UpdateTruck(int tID, string truckNo, DateTime arriveYardTime, DateTime departureYardTime, bool isActive, string remark) { string sql = @"UPDATE [Truck] SET TruckNo = @truckNo, ArriveYardTime = @arriveYardTime, DepartureYardTime=@departureYardTime, IsActive=@isActive, Remark=@remark WHERE ID = @tID"; SqlParameter[] para = { new SqlParameter("@tID", tID), new SqlParameter("@truckNo", truckNo), new SqlParameter("@arriveYardTime", arriveYardTime), new SqlParameter("@departureYardTime", departureYardTime), new SqlParameter("@isActive", isActive), new SqlParameter("@remark", remark) }; SqlHelper.ExecuteNonQuery(ConnectStringMsSql.GetConnection(), CommandType.Text, sql, para); }
public static void InsertTruck(int tID, string truckNo, DateTime arriveYardTime, DateTime departureYardTime, bool isActive, string remark) { string sql = @"INSERT INTO [Truck] (TruckNo, ArriveYardTime, DepartureYardTime, IsActive, Remark) VALUES (@truckNo, @arriveYardTime, @departureYardTime, isActive, remark"; SqlParameter[] para = { new SqlParameter(), new SqlParameter("@truckNo", truckNo), new SqlParameter("@arriveYardTime", arriveYardTime), new SqlParameter("@departureYardTime",departureYardTime), new SqlParameter("@isActive", isActive), new SqlParameter("@remark", remark) }; SqlHelper.ExecuteNonQuery(ConnectStringMsSql.GetConnection(), CommandType.Text, sql, para); }
public static DataTable GetTrucks() { string sql = @"SELECT ID, truckNo, ArriveYardTime, DepartureYardTime, IsActive, Remark FROM [Truck] ORDER BY ID DESC"; DataSet ds = SqlHelper.ExecuteDataset(ConnectStringMsSql.GetConnection(), CommandType.Text, sql); if (ds.Tables[0].Rows.Count == 0) { return(null); } else { return(ds.Tables[0]); } }
public static DataTable GetVesselPlans() { string sql = @"SELECT ID, VesselName, VesselEnglishName, VesselType, VoyageNumber, ImportOrExportFlag, ArrivePlanTime, ArriveActualTime, DeparturePlanTime, DepartureActualTime, BerthPlan, BerthActual, IsCustomsClosing, Status, CSI, ContainerBeginTime, ContainerDeadline, Agency, PortOfCallID, IsActive, Remark FROM [VesselPlan] ORDER BY ID DESC"; DataSet ds = SqlHelper.ExecuteDataset(ConnectStringMsSql.GetConnection(), CommandType.Text, sql); if (ds.Tables[0].Rows.Count == 0) { return(null); } else { return(ds.Tables[0]); } }
public static DataRow GetVesselPlanByID(int vpID) { string sql = @"SELECT ID, VesselName, VesselEnglishName, VesselType, VoyageNumber, ImportOrExportFlag, ArrivePlanTime, ArriveActualTime, DeparturePlanTime, DepartureActualTime, BerthPlan, BerthActual, IsCustomsClosing, Status, CSI, ContainerBeginTime, ContainerDeadline, Agency, PortOfCallID, IsActive, Remark FROM VesselPlan WHERE (ID = @vpID)"; DataSet ds = SqlHelper.ExecuteDataset(ConnectStringMsSql.GetConnection(), CommandType.Text, sql, new SqlParameter("@vpID", vpID)); if (ds.Tables[0].Rows.Count == 0) { return(null); } else { return(ds.Tables[0].Rows[0]); } }
public static DataTable GetContainers() { string sql = @"SELECT ID, ContainerNo, ArriveTime, DepartureTime, ArriveType, DepartureType, CustomsClearance, VesselID, ArrivalContainerTime, CustomsClearanceTime, StowageTime, VesselTime, PlanTime, PlanAcceptedTime, VesselName, VoyageNumber, BillOfLadingNum, ArrivalPortTime, SendPackingListTime, PlanAarrangeTime, AcceptanceNo, IsActive, Remark FROM [Container] ORDER BY ID DESC"; DataSet ds = SqlHelper.ExecuteDataset(ConnectStringMsSql.GetConnection(), CommandType.Text, sql); if (ds.Tables[0].Rows.Count == 0) { return(null); } else { return(ds.Tables[0]); } }