Пример #1
0
        public IEnumerable <AllowedServicesVM> UserServices(int id)
        {
            ServiceDAL ser        = new ServiceDAL();
            var        serviceURL = ser.Allowed_service(id);

            return(serviceURL);
        }
Пример #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);
            }
        }
Пример #4
0
        public ActionResult Index()
        {
            ViewBag.Title = "Dịch Vụ";
            List <NewsBOL> lst = ServiceDAL.GetTop(12);

            return(View(lst));
        }
Пример #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();
        }
Пример #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);
            }
        }
Пример #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));
        }
        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("."));
        }
Пример #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));
        }
Пример #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;
            }
        }
Пример #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);
                }
            }
        }
Пример #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);
        }
Пример #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);
        }
Пример #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();
        }
Пример #16
0
 public int AddEditService(IService Service, int CompanyID)
 {
     return(ServiceDAL.AddEditService(Service, CompanyID));
 }
Пример #17
0
    public PersonM Modificar(PersonM item)
    {
        IServiceDAL instancia = new ServiceDAL();

        return(instancia.Modificar(item));
    }
Пример #18
0
    public PersonM Crear(PersonM item)
    {
        IServiceDAL instancia = new ServiceDAL();

        return(instancia.Crear(item));
    }
Пример #19
0
    public void Eliminar(PersonM item)
    {
        IServiceDAL instancia = new ServiceDAL();

        instancia.Eliminar(item);
    }
Пример #20
0
    public IEnumerable <PersonM> ObtenerLista()
    {
        IServiceDAL instancia = new ServiceDAL();

        return(instancia.ObtenerLista());
    }
 public ServiceService()
 {
     serviceDAL = ServiceDAL.getInstance();
 }
Пример #22
0
        public IEnumerable <UserServicesVM> userServices(int ID = 0)
        {
            ServiceDAL service = new ServiceDAL();

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

            return(ser.AddService(service));
        }
Пример #28
0
        public IEnumerable <Service> ServicesList()
        {
            ServiceDAL service = new ServiceDAL();

            return(service.ServicesList());
        }
Пример #29
0
 public static List <IService> GetService(SearchCriteria searchCriteria, int ID)
 {
     return(ServiceDAL.GetService(searchCriteria, ID));
 }
Пример #30
0
        public IEnumerable <Service> notAssignServices(int ID = 0)
        {
            ServiceDAL service = new ServiceDAL();

            return(service.notAssignServices(ID));
        }