コード例 #1
0
        protected void ddlSelectChanged(object sender, EventArgs e)
        {
            DropDownList ddlSender = (DropDownList)sender;
            decimal      recordID  = 0;

            if (ddlSender.ID.Contains("PlantLine"))
            {
                if (staticPlantLine == null || staticPlantLine.PLANT_LINE_ID != Convert.ToDecimal(ddlSender.SelectedValue))
                {
                    staticPlantLine = SQMModelMgr.LookupPlantLine(costReport.Entities, 0, Convert.ToDecimal(ddlSender.SelectedValue), "", false);
                }
            }
            if (ddlSender.ID.Contains("LaborType"))
            {
                if (staticLaborType == null || staticLaborType.LABOR_TYP_ID != Convert.ToDecimal(ddlSender.SelectedValue))
                {
                    staticLaborType = SQMModelMgr.LookupLaborType(costReport.Entities, 0, 0, 0, Convert.ToDecimal(ddlSender.SelectedValue), "", false);
                }
            }

            switch (ddlSender.ID)
            {
            case "ddlCRPlantLineActual":

                if (staticPlantLine != null)
                {
                    tbCRDowntimeRateActual.Text = staticPlantLine.DOWNTIME_RATE.ToString();
                    udpBurdenActual.Update();
                }
                break;

            case "ddlCRPlantLineAvoid":
                if (staticPlantLine != null)
                {
                    tbCRDowntimeRateAvoid.Text = staticPlantLine.DOWNTIME_RATE.ToString();
                    udpBurdenAvoid.Update();
                }
                break;

            case "ddlCRLaborTypeActual":

                if (staticLaborType != null)
                {
                    tbCRLaborRateActual.Text = staticLaborType.LABOR_RATE.ToString();
                    udpLaborActual.Update();
                }
                break;

            case "ddlCRLaborTypeAvoid":
                if (staticLaborType != null)
                {
                    tbCRLaborRateAvoid.Text = staticLaborType.LABOR_RATE.ToString();
                    udpLaborAvoid.Update();
                }
                break;

            default:
                break;
            }
        }
コード例 #2
0
        protected void SaveLine()
        {
            PLANT plant = (PLANT)SessionManager.EffLocation.Plant;
            bool  success;

            if (uclAdminEdit.IsNew)
            {
                PLANT_LINE lineNew = new PLANT_LINE();
                lineNew = uclAdminEdit.ReadPlantLine(lineNew);
                SQMModelMgr.CreatePlantLine(entities, plant, lineNew, SessionManager.UserContext.UserName());
                // plant.PLANT_LINE.Load();
            }
            else
            {
                PLANT_LINE line = (PLANT_LINE)LocalOrg().EditObject;
                line = SQMModelMgr.LookupPlantLine(entities, line.PLANT_ID, line.PLANT_LINE_ID, "", false);
                line = uclAdminEdit.ReadPlantLine(line);
                PLANT_LINE lineExisting = SQMModelMgr.UpdatePlantLine(entities, line, SessionManager.UserContext.UserName());
                //PLANT_LINE lineExisting = SQMModelMgr.FindPlantLine(entities, plant, line.PLANT_LINE_ID, "", false);
                lineExisting.PLANT_LINE_NAME = line.PLANT_LINE_NAME;
                lineExisting.DOWNTIME_RATE   = line.DOWNTIME_RATE;
                lineExisting.STATUS          = line.STATUS;
            }

            SessionManager.EffLocation.Plant = plant;
            LocalOrg().EditObject            = null;
            DoLineList();
            pnlAdminEdit.Visible = false;
        }