Пример #1
0
        public static int UpdateBowCaseWorkOrderSetup(int iD, bool customBow, string customDescription, int currentCaseNumber, bool complete)
        {
            string databaseConnection = "";

            if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Development")
            {
                databaseConnection = @"BTIntranetMySQLConnectionDevelopment";
            }
            else if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Production")
            {
                databaseConnection = @"BTIntranetMySQLConnectionProduction";
            }
            else
            {
                databaseConnection = @"BTIntranetMySQLConnectionProduction";
            }

            BowCaseLabelWorkOrderModel data = new BowCaseLabelWorkOrderModel
            {
                ID                = iD,
                CustomBow         = customBow,
                CustomDescription = customDescription,
                CurrentCaseNumber = currentCaseNumber,
                Complete          = complete
            };

            string sql = @"UPDATE labelbowcaseworkorder
                           SET  CustomBow = @CustomBow,
                                CustomDescription = @CustomDescription,
                                CurrentCaseNumber = @CurrentCaseNumber,
                                Complete = @Complete
                           WHERE ID = @ID ;";

            return(SQLDataAccess.UpdateDataBTIntranet(sql, data, databaseConnection));
        }
Пример #2
0
        public static int UpdateLabelBowCaseWorkOrder(string workOrderNumber, int nextCaseNumber, bool complete)
        {
            string databaseConnection = "";

            if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Development")
            {
                databaseConnection = @"BTIntranetMySQLConnectionDevelopment";
            }
            else if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Production")
            {
                databaseConnection = @"BTIntranetMySQLConnectionProduction";
            }
            else
            {
                databaseConnection = @"BTIntranetMySQLConnectionProduction";
            }

            BowCaseLabelWorkOrderModel data = new BowCaseLabelWorkOrderModel
            {
                WorkOrderNumber   = workOrderNumber,
                CurrentCaseNumber = nextCaseNumber,
                Complete          = complete
            };

            string sql = @"UPDATE labelbowcaseworkorder
                           SET  CurrentCaseNumber = @CurrentCaseNumber,
                                Complete = @Complete
                           WHERE WorkOrderNumber = @WorkOrderNumber ;";

            return(SQLDataAccess.UpdateDataBTIntranet(sql, data, databaseConnection));
        }
        public static int InsertBowCaseWorkOrderData(string workOrderNumber, bool customBow, string customDescription)
        {
            string databaseConnection = "";

            if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Development")
            {
                databaseConnection = @"BTIntranetMySQLConnectionDevelopment";
            }
            else if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Production")
            {
                databaseConnection = @"BTIntranetMySQLConnectionProduction";
            }
            else
            {
                databaseConnection = @"BTIntranetMySQLConnectionProduction";
            }

            BowCaseLabelWorkOrderModel data = new BowCaseLabelWorkOrderModel
            {
                WorkOrderNumber   = workOrderNumber,
                CustomBow         = customBow,
                CustomDescription = customDescription,
                CurrentCaseNumber = 1,
                Complete          = false
            };

            string sql = @"INSERT INTO labelbowcaseworkorder (WorkOrderNumber, CustomBow, CustomDescription, CurrentCaseNumber, Complete) 
                            VALUES (@WorkOrderNumber, @CustomBow, @CustomDescription, @CurrentCaseNumber, @Complete);";

            return(SQLDataAccess.InsertDataBTIntranet(sql, data, databaseConnection));
        }