public ProductionPlanService()
        {
            string sqlconn = ConfigurationManager.ConnectionStrings["MachineProjectConnStr"].ConnectionString;

            conn = new MySqlConnection(sqlconn);
            conn.Open();
            dac = new ProductionPlanDAC(conn);
        }
Ejemplo n.º 2
0
        public void revertNUpdateProductionPlan(TodoDTO item)
        {
            ProductionListDAC pldac = new ProductionListDAC(conn);

            if (!pldac.IsValid(item.ProductionID, item.MachineID))
            {
                throw new Exception(Properties.Resources.Error_NoProductable_msg);
            }

            ProductionPlanDAC ppdac = new ProductionPlanDAC(conn);

            if (!ppdac.IsReturnable(item.ProductionPlanCode, item.Amount))
            {
                throw new Exception(Properties.Resources.Error_ProductionPlanCantReturnable_msg);
            }

            dac.revertNUpdateProductionPlan(item);
        }
Ejemplo n.º 3
0
        public void InsertNUpdateProductionPlan(TodoDTO item, int planingAmount)
        {
            ProductionListDAC pldac = new ProductionListDAC(conn);

            if (!pldac.IsValid(item.ProductionID, item.MachineID))
            {
                throw new Exception(Properties.Resources.Error_NoProductable_msg);
            }

            ProductionPlanDAC ppdac = new ProductionPlanDAC(conn);

            if (!ppdac.IsAddable(item.ProductionPlanCode, planingAmount))
            {
                throw new Exception(Properties.Resources.Error_ProductionPlanNotAddable_msg);
            }

            dac.InsertNUpdateProductionPlan(item, item.ProductionPlanCode, planingAmount);
        }