Ejemplo n.º 1
0
        public IEnumerable <AllowedServicesVM> UserServices(int id)
        {
            ServiceDAL ser        = new ServiceDAL();
            var        serviceURL = ser.Allowed_service(id);

            return(serviceURL);
        }
Ejemplo n.º 2
0
        public void OnFirstClick()
        {
            XmlElement sd = ServiceDAL.GetServiceDefinition(this.ContractName, this.PackageName, this.ServiceName);
            bool       isDBHelperService   = sd.GetAttribute("Type").ToLower() == "dbhelper";
            bool       isJavascriptService = sd.GetAttribute("Type").ToLower() == "javascript";

            this.Editors = new List <IEditable>();
            IEditable editable = null;

            if (isDBHelperService)
            {
                editable = new ServiceUIEditable("Service - " + this.ServiceName, this);
                this.Editors.Add(editable);
            }
            if (isJavascriptService)
            {
                editable = new ServiceJSEditable(ServiceName, this);
                this.Editors.Add(editable);
            }

            IEditable xmlEditable = new ServiceXmlEditable("Service - " + this.ServiceName, this);

            this.Editors.Add(xmlEditable);

            if (editable == null)
            {
                this.CurrentEditor = xmlEditable;
            }
            else
            {
                this.CurrentEditor = editable;
            }

            this.IsFirstClick = false;
        }
        public void OnStartEditing()
        {
            Source = ServiceDAL.GetServiceDefinition(
                ServiceNodeHandler.ContractName,
                ServiceNodeHandler.PackageName,
                ServiceNodeHandler.ServiceName);

            if (Source.SelectSingleNode("Code") != null)
            {
                ((JSEditor)Editor).JavaScriptCode = Source.SelectSingleNode("Code").InnerText;
                ;
                ((JSEditor)Editor).Unlocked();
            }
            else
            {
                MessageBox.Show("找不到 <Code/>,請使用 RAW 編輯加入。");
                ((JSEditor)Editor).JavaScriptCode = "//禁用編輯...";
                ((JSEditor)Editor).Locked();
            }

            if (ChangeRecovered != null)
            {
                ChangeRecovered(this, EventArgs.Empty);
            }
        }
Ejemplo n.º 4
0
        public ActionResult Index()
        {
            ViewBag.Title = "Dịch Vụ";
            List <NewsBOL> lst = ServiceDAL.GetTop(12);

            return(View(lst));
        }
Ejemplo n.º 5
0
        public void Test()
        {
            XmlElement      definition = ServiceDAL.GetServiceDefinition(this.ContractName, this.PackageName, this.ServiceName);
            TestServiceForm testForm   = new TestServiceForm(this.ContractName, this.PackageName, this.ServiceName, definition);

            testForm.StartPosition = FormStartPosition.CenterParent;
            testForm.ShowDialog();
        }
Ejemplo n.º 6
0
        public override void Save()
        {
            XmlEditor xe = this.Editor as XmlEditor;

            ServiceDAL.SetDefinition(this.ServiceNodeHandler.ContractName, this.ServiceNodeHandler.PackageName, this.ServiceNodeHandler.ServiceName, xe.Xml);

            this.OnDataSaved();
        }
        public void Save()
        {
            ServiceDAL.SetDefinition(
                this.ServiceNodeHandler.ContractName,
                this.ServiceNodeHandler.PackageName,
                this.ServiceNodeHandler.ServiceName, GenerateServiceDefinition());

            if (ChangeRecovered != null)
            {
                ChangeRecovered(this, EventArgs.Empty);
            }
        }
Ejemplo n.º 8
0
        public ActionResult Details(int id = 0)
        {
#if DEBUG
            _log.Debug("id: {0}", id);
#endif
            ViewBag.PageType = __type;
            NewsBOL model = ServiceDAL.Get(id);
            if (model == null)
            {
                return(RedirectToAction("Index"));
            }

            return(View(model));
        }
Ejemplo n.º 9
0
        internal XmlElement GetXml()
        {
            XmlHelper h = new XmlHelper("<Package/>");

            h.SetAttribute(".", "Name", this.Name);

            foreach (string service in this.Services)
            {
                XmlElement def = ServiceDAL.GetRawService(this.Contract.Name, this.Name, service);
                h.AddElement(".", def);
            }

            return(h.GetElement("."));
        }
Ejemplo n.º 10
0
        public ActionResult Index(int?id)
        {
#if DEBUG
            _log.Debug("id: {0}", id);
#endif
            _log.Debug("id: {0}", id);
            ViewBag.PageType = __type;
            AllCategoriesModel model = ServiceDAL.GetAllServices(id.HasValue ? id.Value : 0);
            if (id.HasValue && id.Value > 0)
            {
                model.Title = MenuDAL.GetTitle(id.Value);
            }

            return(View(model));
        }
Ejemplo n.º 11
0
        void TreeView_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            Node.TreeView.AfterLabelEdit -= new NodeLabelEditEventHandler(TreeView_AfterLabelEdit);
            Node.TreeView.LabelEdit       = false;

            try
            {
                ServiceDAL.Rename(this.ContractName, this.PackageName, this.ServiceName, e.Label);
                this.ServiceName = e.Label;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "重新命名失敗", MessageBoxButtons.OK, MessageBoxIcon.Error);
                e.CancelEdit = true;
            }
        }
Ejemplo n.º 12
0
        public void Import()
        {
            OpenFileDialog fd = new OpenFileDialog();
            DialogResult   dr = fd.ShowDialog();

            if (dr == DialogResult.OK)
            {
                XmlDocument xml = new XmlDocument();
                xml.Load(fd.FileName);

                try
                {
                    ServiceDAL.SetDefinition(this.ContractName, this.PackageName, this.ServiceName, xml.DocumentElement);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("匯入失敗 : \n" + ex.Message, "錯誤", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Ejemplo n.º 13
0
        protected override void OnInitialEditor()
        {
            XmlElement definition = ServiceDAL.GetServiceDefinition(_serviceNode.ContractName, _serviceNode.PackageName, _serviceNode.ServiceName);

            //ServiceEditor service = new ServiceEditor(source, this);
            //base._editorInstance = service;

            XmlHelper h      = new XmlHelper(definition);
            string    action = h.GetText("Action");

            _ui = ServiceFactory.CreateServiceUI(action);

            string serviceFullName = string.Join(".", _serviceNode.PackageName, _serviceNode.ServiceName);

            _ui.Initialize(serviceFullName, definition);

            base.OnEditorChanged(_ui.Editor);

            _ui.DataChanged     += new EventHandler(table_DataChanged);
            _ui.ChangeRecovered += new EventHandler(table_ChangeRecovered);
        }
Ejemplo n.º 14
0
        public void Export()
        {
            XmlElement e = ServiceDAL.GetRawService(this.ContractName, this.PackageName, this.ServiceName);

            SaveFileDialog sd = new SaveFileDialog();

            sd.DefaultExt = "xml";
            sd.FileName   = this.ServiceName + ".xml";
            sd.Filter     = "(*.xml)|*.xml";

            DialogResult dr = sd.ShowDialog();

            if (dr != DialogResult.OK)
            {
                return;
            }

            string    formated = XmlHelper.Format(e.OwnerDocument.OuterXml);
            XmlHelper h        = new XmlHelper(formated);

            h.WriteTo(sd.FileName);
        }
Ejemplo n.º 15
0
        public override void Save()
        {
            XmlElement definition;

            try
            {
                definition = _ui.GetResult();
            }
            catch (Exception ex)
            {
                MessageBox.Show("產生 Service Definition 時發生錯誤 : " + ex.Message, "錯誤", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            try
            {
                ServiceDAL.SetDefinition(this._serviceNode.ContractName, this._serviceNode.PackageName, this._serviceNode.ServiceName, definition);
            }
            catch (Exception ex)
            {
                MessageBox.Show("儲存 Service Definition 時發生錯誤 : " + ex.Message, "錯誤", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            this.OnInitialEditor();
            OnChangeRecovered();
        }
Ejemplo n.º 16
0
 public int AddEditService(IService Service, int CompanyID)
 {
     return(ServiceDAL.AddEditService(Service, CompanyID));
 }
Ejemplo n.º 17
0
    public PersonM Modificar(PersonM item)
    {
        IServiceDAL instancia = new ServiceDAL();

        return(instancia.Modificar(item));
    }
Ejemplo n.º 18
0
    public PersonM Crear(PersonM item)
    {
        IServiceDAL instancia = new ServiceDAL();

        return(instancia.Crear(item));
    }
Ejemplo n.º 19
0
    public void Eliminar(PersonM item)
    {
        IServiceDAL instancia = new ServiceDAL();

        instancia.Eliminar(item);
    }
Ejemplo n.º 20
0
    public IEnumerable <PersonM> ObtenerLista()
    {
        IServiceDAL instancia = new ServiceDAL();

        return(instancia.ObtenerLista());
    }
 public ServiceService()
 {
     serviceDAL = ServiceDAL.getInstance();
 }
Ejemplo n.º 22
0
        public IEnumerable <UserServicesVM> userServices(int ID = 0)
        {
            ServiceDAL service = new ServiceDAL();

            return(service.UserServices(ID));
        }
Ejemplo n.º 23
0
 public static IService GetService(int ID)
 {
     return(ServiceDAL.GetService(ID));
 }
Ejemplo n.º 24
0
 public static int DeleteService(int ImportHaulageId)
 {
     return(ServiceDAL.DeleteService(ImportHaulageId));
 }
Ejemplo n.º 25
0
 internal void AddService(ServiceEntity sh)
 {
     ServiceDAL.AddService(this.Contract.Name, this.Name, sh);
     LoadServices();
 }
Ejemplo n.º 26
0
 public static List <IService> GetServiceWithLine(int ID)
 {
     return(ServiceDAL.GetServiceWithLine(ID));
 }
Ejemplo n.º 27
0
        public Service AddService(Service service)
        {
            ServiceDAL ser = new ServiceDAL();

            return(ser.AddService(service));
        }
Ejemplo n.º 28
0
        public IEnumerable <Service> ServicesList()
        {
            ServiceDAL service = new ServiceDAL();

            return(service.ServicesList());
        }
Ejemplo n.º 29
0
 public static List <IService> GetService(SearchCriteria searchCriteria, int ID)
 {
     return(ServiceDAL.GetService(searchCriteria, ID));
 }
Ejemplo n.º 30
0
        public IEnumerable <Service> notAssignServices(int ID = 0)
        {
            ServiceDAL service = new ServiceDAL();

            return(service.notAssignServices(ID));
        }