private object GetEditObject()
        {
            if (_modelFacade == null)
            {
                _modelFacade = new FacadeFactory(base.DataProvider).CreateModelFacade();
            }
            Model2OP model2Operation = (Model2OP)this._modelFacade.GetModel2Operation(OPID, GlobalVariables.CurrentOrganizations.First().OrganizationID);

            try
            {
                model2Operation.OPSequence = System.Int32.Parse(this.txtOperationsequenceEdit.Text.Trim());
            }
            catch
            {
                model2Operation.OPSequence = 0;
            }
            model2Operation.OPControl      = FormatHelper.BooleanToString(model2Operation.OPControl, model2Operation.OPControl.Length - 9, this.chbOperationCheckEdit.Checked);
            model2Operation.OPControl      = FormatHelper.BooleanToString(model2Operation.OPControl, model2Operation.OPControl.Length - 8, this.chbCompLoadingEdit.Checked);
            model2Operation.OPControl      = FormatHelper.BooleanToString(model2Operation.OPControl, model2Operation.OPControl.Length - 7, this.chbIDMergeEdit.Checked);
            model2Operation.OPControl      = FormatHelper.BooleanToString(model2Operation.OPControl, model2Operation.OPControl.Length - 6, this.chbStartOpEdit.Checked);
            model2Operation.OPControl      = FormatHelper.BooleanToString(model2Operation.OPControl, model2Operation.OPControl.Length - 5, this.chbEndOpEdit.Checked);
            model2Operation.OPControl      = FormatHelper.BooleanToString(model2Operation.OPControl, model2Operation.OPControl.Length - 4, this.chbPackEdit.Checked);
            model2Operation.OPControl      = FormatHelper.BooleanToString(model2Operation.OPControl, model2Operation.OPControl.Length - 3, this.chbEditSPC.Checked);
            model2Operation.OPControl      = FormatHelper.BooleanToString(model2Operation.OPControl, model2Operation.OPControl.Length - 2, this.chbRepairEdit.Checked);
            model2Operation.OPControl      = FormatHelper.BooleanToString(model2Operation.OPControl, model2Operation.OPControl.Length - 1, this.chbNGTestEdit.Checked);
            model2Operation.OrganizationID = GlobalVariables.CurrentOrganizations.First().OrganizationID;
            return(model2Operation);
        }
Exemple #2
0
        public JsonResult Graph(Parameter _in)
        {
            ModelFacade facade = new ModelFacade();

            Session["table"] = facade.GetTable(_in);
            return(Json(new { url = "GraphResult" }));
        }
Exemple #3
0
 public void SetUp()
 {
     persistBroker   = new OLEDBPersistBroker("Provider=OraOLEDB.Oracle.1;Password=emes;Persist Security Info=True;User ID=emes;Data Source=sqcdemo");
     modelFacade     = new ModelFacade();
     itemFacade      = new ItemFacade();
     baseModelFacade = new BaseModelFacade();
 }
Exemple #4
0
        private object CheckRpeat(object obj, string type)
        {
            if (obj == null)
            {
                return(null);
            }

            switch (type)
            {
            case "Model2Item":
                BenQGuru.eMES.Domain.MOModel.Model2Item model2item = obj as BenQGuru.eMES.Domain.MOModel.Model2Item;
                ModelFacade modelfacade = new ModelFacade(this.MESProvider);
                return(modelfacade.GetModel2ItemByItemCode(model2item.ItemCode));

            case "Item":
                BenQGuru.eMES.Domain.MOModel.Item item = obj as BenQGuru.eMES.Domain.MOModel.Item;
                ItemFacade itemfacade = new ItemFacade(this.MESProvider);
                return(itemfacade.GetItem(item.ItemCode, GlobalVariables.CurrentOrganizations.First().OrganizationID));

            case "MO":
                BenQGuru.eMES.Domain.MOModel.MO mo = obj as BenQGuru.eMES.Domain.MOModel.MO;
                MOFacade mofacade = new MOFacade(this.MESProvider);
                return(mofacade.GetMO(mo.MOCode));

            default:
                return(null);
            }
        }
 public MainController(IGameView gameView)
 {
     mf            = new ModelFacade();
     dc            = new DifficultyController();
     this.gameView = gameView;
     IntializeCommandMap();
 }
Exemple #6
0
        public void Visit(dynamic current, dynamic relative)
        {
            //* Get this table and that table name
            var currentModel  = ModelBase.Dynamic(current);
            var relativeModel = ModelBase.Dynamic(relative);

            //* set modelname
            CurrentModelName  = currentModel.ModelName;
            RelativeModelName = relativeModel.ModelName;

            //* find intermediate model name
            IntermediateModelName = ModelFacade.GenerateIntermediateModelName(CurrentModelName, RelativeModelName);
            //* Initialize target model
            IntermediateModel = ModelBase.Dynamic(ModelFacade.GenerateIntermediateModel(IntermediateModelName));

            var currModelId     = currentModel.Id;
            var relativeModelId = relativeModel.Id;

            IntermediateModel.Set(currModelId, CurrentModelName + "Id");
            IntermediateModel.Set(relativeModelId, RelativeModelName + "Id");

            var firstCol  = DbFacade.PocoDatas[IntermediateModelName].GetColumnName(CurrentModelName + "Id");
            var secondCol = DbFacade.PocoDatas[IntermediateModelName].GetColumnName(RelativeModelName + "Id");

            IntermediateModel = IntermediateModel.Find(string.Format(" {0}.{1}={3} AND {0}.{2}={4} "
                                                                     , IntermediateModel.TableName
                                                                     , firstCol, secondCol
                                                                     , currModelId
                                                                     , relativeModelId));
        }
 public MainController()
 {
     mf = new ModelFacade();
     dc = new DifficultyController();
     //gameView = new GameView();
     IntializeCommandMap();
 }
Exemple #8
0
        private object GetEditObject()
        {
            if (this.ValidateInput())
            {
                if (_modelFacade == null)
                {
                    _modelFacade = new FacadeFactory(base.DataProvider).CreateModelFacade();
                }
                Model model = this._modelFacade.CreateNewModel();

                model.ModelCode        = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtModelCodeEdit.Text, 40));
                model.ModelDescription = FormatHelper.CleanString(this.txtModelDescriptionEdit.Text, 100);
                model.MaintainUser     = this.GetUserCode();
                model.IsInventory      = FormatHelper.BooleanToString(this.chbIsIn.Checked);
                model.IsReflow         = FormatHelper.BooleanToString(this.chbIsReflow.Checked);
                model.IsCheckDataLink  = FormatHelper.BooleanToString(this.chbIsDataLink.Checked);
                model.DataLinkQty      = (this.chbIsDataLink.Checked?int.Parse(this.txtDataLinkQty.Text):0);
                model.IsDim            = FormatHelper.BooleanToString(this.chbIsDim.Checked);
                model.DimQty           = (this.chbIsDim.Checked?int.Parse(this.txtDimQty.Text):0);
                model.OrganizationID   = int.Parse(this.DropDownListOrg.SelectedValue);
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemple #9
0
        protected void cmdDelete_ServerClick(object sender, System.EventArgs e)
        {
            if (_modelFacade == null)
            {
                _modelFacade = new FacadeFactory(base.DataProvider).CreateModelFacade();
            }
            ArrayList array = this.gridHelper.GetCheckedRows();

            if (array.Count > 0)
            {
                ArrayList models = new ArrayList(array.Count);

                foreach (GridRecord row in array)
                {
                    object model = this.GetEditObject(row);
                    if (model != null)
                    {
                        models.Add((Model)model);
                    }
                }

                this._modelFacade.DeleteModel((Model[])models.ToArray(typeof(Model)));
                this.RequestData();
                this.buttonHelper.PageActionStatusHandle(PageActionType.Delete);
            }
        }
Exemple #10
0
        protected void cmdAdd_ServerClick(object sender, System.EventArgs e)
        {
            if (_modelFacade == null)
            {
                _modelFacade = new FacadeFactory(base.DataProvider).CreateModelFacade();
            }
            ArrayList array = this.gridHelper.GetCheckedRows();

            if (array.Count > 0)
            {
                ArrayList items = new ArrayList(array.Count);

                foreach (UltraGridRow row in array)
                {
                    object item = this.GetEditObject(row);
                    if (item != null)
                    {
                        items.Add((Model2Item)item);
                    }
                }

                this._modelFacade.AssignItemsToModel((Model2Item[])items.ToArray(typeof(Model2Item)));

                this.RequestData();
            }
        }
Exemple #11
0
 protected override void DeleteDomainObjects(ArrayList domainObjects)
 {
     if (_facade == null)
     {
         _facade = new FacadeFactory(base.DataProvider).CreateModelFacade();
     }
     this._facade.DeleteBarcodeRule((BarcodeRule[])domainObjects.ToArray(typeof(BarcodeRule)));
 }
 private void InitData()
 {
     if (_modelFacade == null)
     {
         _modelFacade = new FacadeFactory(base.DataProvider).CreateModelFacade();
     }
     SetEditObject(this._modelFacade.GetModel2Operation(OPID, GlobalVariables.CurrentOrganizations.First().OrganizationID));
 }
Exemple #13
0
 protected override void UpdateDomainObject(object domainObject)
 {
     if (_facade == null)
     {
         _facade = new FacadeFactory(base.DataProvider).CreateModelFacade();
     }
     this._facade.UpdateBarcodeRule((BarcodeRule)domainObject);
 }
Exemple #14
0
 private int GetRowCount()
 {
     if (_modelFacade == null)
     {
         _modelFacade = new FacadeFactory(base.DataProvider).CreateModelFacade();
     }
     return(this._modelFacade.GetUnSelectedRouteCountsByModelCode(FormatHelper.PKCapitalFormat(FormatHelper.CleanString(ModelCode)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtRouteCodeQuery.Text))));
 }
 protected void cmdSave_ServerClick(object sender, System.EventArgs e)
 {
     if (_modelFacade == null)
     {
         _modelFacade = new FacadeFactory(base.DataProvider).CreateModelFacade();
     }
     this._modelFacade.UpdateModel2Operation((Model2OP)GetEditObject());
 }
Exemple #16
0
 public void ParametersConfigured(Parameters parameters)
 {
     Parameters                = parameters;
     startingScenarioId        = parameters.scenarioId;
     Table.totalNumberOfTables = 0;
     model = new ModelFacade(parameters.nbOfCooks, parameters.nbOfCommis, parameters.nbOfDishwasher, parameters.nbOfHeadWaiter, parameters.nbOfWaiter);
     model.DiningRoom.Countertop.SubscribeToNewPlateIsReady(this);
     view.Model = model;
 }
        public IActionResult ListPets()
        {
            ModelFacade facade = new ModelFacade();

            List <string>[] list = facade.SelectAllPets();
            ViewData["Message"] = "Here you go, your list of pets";

            return(View(list));
        }
 public DifficultyController()
 {
     mf = new ModelFacade();
     playerStatusTracker = new List <double>();
     playerStatus        = 1;
     CalcEndLocationChance();
     CalcEventModifier();
     CalcEventChance();
 }
Exemple #19
0
 private void gridWebGrid_DblClick(object sender, Infragistics.WebUI.UltraWebGrid.ClickEventArgs e)
 {
     if (_modelFacade == null)
     {
         _modelFacade = new FacadeFactory(base.DataProvider).CreateModelFacade();
     }
     this.ViewState["opid"] = e.Row.Cells[5].ToString();
     SetEditObject(this._modelFacade.GetModel2Operation(OPID, GlobalVariables.CurrentOrganizations.First().OrganizationID));
 }
Exemple #20
0
        static void Main(string[] args)
        {
            Console.WriteLine("Console debug du controller");
            ModelFacade model = new ModelFacade(2, 2, 1, 2, 2);
            ViewFacade  view  = new ViewFacade(model);

            new ControllerFacade(model, view);
            Console.ReadLine();
        }
Exemple #21
0
    private void getSessionData()
    {
        TechnicianDTO dto        = (TechnicianDTO)Session["TechnicianDTO"];
        ModelFacade   facade     = new ModelFacade();
        Technician    technician = facade.createTechnician(dto);

        lblID.Text   = technician.technicianID;
        lblName.Text = technician.technicianName;
        lblType.Text = technician.technicianType;
    }
        protected void cmdReturn_ServerClick(object sender, System.EventArgs e)
        {
            if (_modelFacade == null)
            {
                _modelFacade = new FacadeFactory(base.DataProvider).CreateModelFacade();
            }
            Model2OP model2Operation = (Model2OP)this._modelFacade.GetModel2Operation(OPID, GlobalVariables.CurrentOrganizations.First().OrganizationID);

            Response.Redirect(this.MakeRedirectUrl("FModelRouteOperationSP.aspx", new string[] { "modelcode", "routecode" }, new string[] { model2Operation.ModelCode, model2Operation.RouteCode }));
        }
Exemple #23
0
        public JsonResult Evaluate(Parameter _in)
        {
            ModelFacade facade = new ModelFacade();

            Session["data"] = new Data {
                fx = _in.fx, a = _in.a
            };
            Session["evaluate"] = facade.GetEvaluacion(_in);
            return(Json(new { url = "EvaluateResult" }));
        }
Exemple #24
0
 private object[] LoadDataSource(int inclusive, int exclusive)
 {
     if (_modelFacade == null)
     {
         _modelFacade = new FacadeFactory(base.DataProvider).CreateModelFacade();
     }
     return(this._modelFacade.GetUnSelectedRoutesByModelCode(
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(ModelCode)), FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtRouteCodeQuery.Text)),
                inclusive, exclusive));
 }
Exemple #25
0
 protected override int GetRowCount()
 {
     if (_facade == null)
     {
         _facade = new FacadeFactory(base.DataProvider).CreateModelFacade();
     }
     return(this._facade.QueryIllegibilityCounts(
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.drpModelCodeQuery.SelectedValue)),
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtAModelCodeQuery.Text))));
 }
Exemple #26
0
    protected void btnSubmitData_Click(object sender, EventArgs e)
    {
        CustomerFormDTO dto      = (CustomerFormDTO)Session["CustomerFormDTO"];
        ModelFacade     facade   = new ModelFacade();
        Customer        customer = facade.createCustomer(dto);
        CustomerDAO     doa      = new CustomerDAO();

        doa.saveCustomer(customer);
        Session.Abandon();
        Response.Redirect("~/Staff/AdminHome.aspx");
    }
Exemple #27
0
 private int GetRowCount()
 {
     if (_modelFacade == null)
     {
         _modelFacade = new FacadeFactory(base.DataProvider).CreateModelFacade();
     }
     return(this._modelFacade.GetUnSelectedItemsCounts(
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(ModelCode)),
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtItemCodeQuery.Text)), FormatHelper.CleanString(this.txtItemNameQuery.Text), FormatHelper.CleanString(this.drpItemTypeQuery.SelectedValue)
                ));
 }
    private void getSessionData()
    {
        JobsDTO     dto    = (JobsDTO)Session["JobsDTO"];
        ModelFacade facade = new ModelFacade();
        Jobs        job    = facade.createJob(dto);

        lblJobID.Text        = job.jobID;
        lblItemID.Text       = job.itemID;
        lblTechID.Text       = job.techID;
        lblDateAssigned.Text = job.dateAssigned;
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        JobsDTO     dto    = (JobsDTO)Session["JobsDTO"];
        ModelFacade facade = new ModelFacade();
        Jobs        job    = facade.createJob(dto);
        JobsDAO     dao    = new JobsDAO();

        dao.issueJob(job);
        Session.Abandon();
        Response.Redirect("~/Staff/AdminHome.aspx");
    }
Exemple #30
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        ItemsDTO    dto    = (ItemsDTO)Session["ItemsDTO"];
        ModelFacade facade = new ModelFacade();
        Items       item   = facade.createItem(dto);
        ItemsDAO    dao    = new ItemsDAO();

        dao.bookInItem(item);
        Session.Abandon();
        Response.Redirect("~/Staff/AdminHome.aspx");
    }