Beispiel #1
0
        public ActionResult ScanForm()
        {
            var files    = Request.Files;
            var username = Request.Params["username"];
            var email    = Request.Params["email"];

            if (files == null || files.Count == 0 ||
                String.IsNullOrWhiteSpace(username) || String.IsNullOrWhiteSpace(email))
            {
                return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest));
            }

            HttpPostedFileBase file = files[0];

            FormInformation info = InfoPathAnalytics.FormInformation(file);

            info.Index = 1;
            UserDetail userDetail = new UserDetail
            {
                UserName = username,
                Email    = email
            };

            SubmitDiagnosticsResult(userDetail, file, info);

            return(View("DiagnosticsResult", info));
        }
Beispiel #2
0
        private void WriteContentInternal(
            string entityLogicalName
            , string objectName
            , string constructorName
            , FormInformation formInfo
            )
        {
            WriteFormJavaScriptTag(entityLogicalName, formInfo?.FormId, formInfo?.FormName, formInfo?.FormType, formInfo?.FormTypeName);

            WriteNamespace();

            WriteLine();

            string tempNamespace = !string.IsNullOrEmpty(this._config.NamespaceClassesJavaScript) ? this._config.NamespaceClassesJavaScript + "." : string.Empty;

            string objectDeclaration = !string.IsNullOrEmpty(tempNamespace) ? tempNamespace + objectName : "var " + objectName;

            WriteObjectStart(objectDeclaration, constructorName);

            _isFirstElement = true;

            WriteConstantsAndFunctions(objectName);

            if (formInfo != null)
            {
                WriteFormContent(formInfo);
            }

            WriteObjectEnd(objectDeclaration, constructorName);
        }
Beispiel #3
0
        public ActionResult ScanTemplates(List <string> urls)
        {
            var spContext = SharePointContextProvider.Current.GetSharePointContext(System.Web.HttpContext.Current);
            var scanInfo  = new ScanTemplateInfo();
            var listInfo  = new List <FormInformation>();

            using (var clientContext = spContext.CreateUserClientContextForSPHost())
            {
                foreach (var url in urls)
                {
                    try
                    {
                        SP.Web web = clientContext.Site.RootWeb;

                        var file = web.GetFileByServerRelativeUrl(url);

                        FormInformation info = InfoPathAnalytics.FormInformation(clientContext, file);
                        info.XsnUrl = file.ServerRelativeUrl;

                        listInfo.Add(info);
                    }
                    catch
                    {
                        scanInfo.AddMessage(url);
                    }
                }
            }
            scanInfo.FormInfos = listInfo;

            return(View(scanInfo));
        }
Beispiel #4
0
        public IActionResult Confirm(FormInformation fi)//the status change
        {
            InformationReader reader = new InformationReader();
            int result = reader.insertCompletedStatus(fi);

            return(RedirectToAction("Index", fi));
        }
Beispiel #5
0
        public IActionResult Index()
        {
            FormInformation fi = new FormInformation();//retrieve the information

            fi.OrdersList = InformationReader.GetInformation();

            return(View("Index", fi));
        }
        public IActionResult Post([FromBody] FormInformation <PersonViewModel> formInformation)
        {
            personService.Save(formInformation);

            return(Json(new
            {
                FormInformation = formInformation,
            }));
        }
Beispiel #7
0
        public void NewAjaxRequest(FormInformation info)
        {
            TESTEntities db = new TESTEntities();

            foreach (int id in info.Massiv)
            {
                db.UPDATE_GOOD_PRICE(id, info.Price);
            }
        }
Beispiel #8
0
        private string GetQdScanTemplateXml(FormInformation info, UserDetail userDetail)
        {
            var qdScan = new QdScanTemplate
            {
                ResultInfo = info,
                UserInfo   = userDetail
            };

            return(GetSerializedXml <QdScanTemplate>(qdScan));
        }
Beispiel #9
0
        public IActionResult GetEditForm(FormInformation <TaskViewModel> formInformation)
        {
            formInformation       = formInformation ?? new FormInformation <TaskViewModel>();
            formInformation.Model = formInformation.Model ?? new TaskViewModel();
            formInformation.Title = "Add Task";

            formService.UpdateFormInformation(formInformation);

            return(Json(formInformation));
        }
Beispiel #10
0
        public void UpdateFormInformation <T>(FormInformation <T> formInformation) where T : class, IBaseModel
        {
            if (formInformation == null)
            {
                return;
            }

            this.modelService.ProcessModel(formInformation.Model);

            formInformation.Fields = GetFormFields(formInformation.Model)?.OrderBy(c => c.DisplayOrder)?.ToList();
        }
Beispiel #11
0
        public void Save(FormInformation <PersonViewModel> formInformation)
        {
            if (formInformation?.Model == null)
            {
                return;
            }

            var person = mapper.Map <Person>(formInformation.Model);

            repositoryService.Save(person);
            formInformation.Model = mapper.Map <PersonViewModel>(person);
        }
Beispiel #12
0
 private void buttonInformation_Click(object sender, EventArgs e)
 {
     if (!data.Crypted())
     {
         FormInformation form = new FormInformation(data.information);
         form.Show();
     }
     else
     {
         MessageBox.Show("Данные зашифрованы и их просмотр недоступен", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        private async Task CopingToClipboardSystemFormCurrentTabsAndSections(IOrganizationServiceExtented service, CommonConfiguration commonConfig, JavaScriptObjectType jsObjectType, string entityName, Guid formId, int formType)
        {
            var repositorySystemForm = new SystemFormRepository(service);

            var systemForm = await repositorySystemForm.GetByIdAsync(formId, ColumnSetInstances.AllColumns);

            string formXml = systemForm.FormXml;

            if (string.IsNullOrEmpty(formXml))
            {
                this._iWriteToOutput.WriteToOutput(service.ConnectionData, Properties.OutputStrings.InConnectionEntityFieldIsEmptyFormat4, service.ConnectionData.Name, SystemForm.Schema.EntityLogicalName, systemForm.Name, SystemForm.Schema.Headers.formxml);
                this._iWriteToOutput.ActivateOutputWindow(service.ConnectionData);
                return;
            }

            try
            {
                var fileGenerationOptions = FileGenerationConfiguration.GetFileGenerationOptions();

                var config = new CreateFileJavaScriptConfiguration(fileGenerationOptions);

                var doc = XElement.Parse(formXml);

                var descriptor = new SolutionComponentDescriptor(service);

                descriptor.SetSettings(commonConfig);

                var handler = new FormDescriptionHandler(descriptor, new DependencyRepository(service));

                FormInformation formInfo = handler.GetFormInformation(doc);

                var stringBuilder = new StringBuilder();

                using (var writer = new StringWriter(stringBuilder))
                {
                    var handlerCreate = new CreateFormTabsJavaScriptHandler(writer, config, jsObjectType, service);

                    handlerCreate.WriteContentOnlyForm(formInfo);
                }

                ClipboardHelper.SetText(stringBuilder.ToString().Trim(' ', '\r', '\n'));

                this._iWriteToOutput.WriteToOutput(service.ConnectionData, Properties.OutputStrings.CopyingEntityJavaScriptContentOnFormCompletedFormat2, systemForm.ObjectTypeCode, systemForm.Name);
                this._iWriteToOutput.ActivateOutputWindow(service.ConnectionData);

                service.TryDispose();
            }
            catch (Exception ex)
            {
                this._iWriteToOutput.WriteErrorToOutput(service.ConnectionData, ex);
            }
        }
        public static Form CreateInstance(Type type, bool holdInstance)
        {
            Form form = (Form)Activator.CreateInstance(type);

            if (!form.IsDisposed)
            {
                form.FormClosing += formToShow_FormClosing;
                FormInformation formInfo = new FormInformation(form, holdInstance, type);
                registredForms.Add(formInfo);
                return(form);
            }
            return(null);
        }
Beispiel #15
0
        public void WriteContentOnlyForm(FormInformation formInfo)
        {
            _isFirstElement = true;

            if (formInfo != null)
            {
                WriteFormContent(formInfo);
            }

            if (this._javaScriptObjectType == JavaScriptObjectType.JsonObject)
            {
                Write(",");
            }
        }
Beispiel #16
0
        public IEnumerable <string> ValidateTask(FormInformation <TaskViewModel> formInformation)
        {
            if (formInformation?.Model == null)
            {
                yield return(AppConstants.DefaultErrorMessage);

                yield break;
            }

            if (string.IsNullOrWhiteSpace(formInformation.Model.Name))
            {
                yield return("Name is required.");
            }
        }
Beispiel #17
0
        public ActionResult FormInformationFromFormFileRequest(FormFileRequest formFileRequest)
        {
            FormInformation fi = InfoPathAnalytics.FormInformationFromFormFileRequest(formFileRequest);

            if (string.Compare(formFileRequest.Format, "xml", true) == 0)
            {
                return(new XmlResult(fi));
            }
            return(new JsonResult()
            {
                Data = fi,
                ContentEncoding = System.Text.Encoding.UTF8,
                ContentType = "application/json"
            });
        }
Beispiel #18
0
        private void WriteFormContent(FormInformation formInfo)
        {
            WriteTabs(formInfo.Tabs);

            WriteSections(formInfo.Tabs);

            WriteSubgrids(formInfo.Tabs);

            WriteWebResources(formInfo.Tabs);

            WriteQuickViewForms(formInfo.Tabs);

            WriteIFrames(formInfo.Tabs);

            WriteFormParameters(formInfo.FormParameters);
        }
        public IActionResult GetFormInformation()
        {
            var viewModel = new PersonViewModel();

            personService.SetLookupValues(viewModel);
            var formInformation = new FormInformation <PersonViewModel>()
            {
                Model = viewModel
            };

            formService.UpdateFormInformation(formInformation);

            return(Json(new
            {
                FormInformation = formInformation,
            }));
        }
        private void btnClose_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult    result          = new DialogResult();
                FormInformation formInformation = new FormInformation("¿Esta seguro de salir del sistema?", "SALIR");
                result = formInformation.ShowDialog(this);

                if (result == DialogResult.OK)
                {
                    this.CloseJarAPI();
                    Application.Exit();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #21
0
        public IActionResult Post([FromBody] FormInformation <TaskViewModel> formInformation)
        {
            if (formInformation == null)
            {
                return(Json(new ResponseObject()
                {
                    Result = ResultTypes.Error,
                    ValidationMessages = new string[]
                    {
                        AppConstants.DefaultErrorMessage,
                    },
                }));
            }

            var validations = taskService.ValidateTask(formInformation)?.ToList();

            if ((validations?.Count ?? 0) > 0)
            {
                return(Json(new ResponseObject()
                {
                    Result = ResultTypes.Invalid,
                    ValidationMessages = validations
                }));
            }

            taskService.Save(formInformation.Model);

            var addedTaskName = formInformation.Model.Name;

            formInformation.Model = new TaskViewModel();

            return(Json(new ResponseObject()
            {
                Result = ResultTypes.Success,
                Alert = new Alert()
                {
                    AlertType = AlertType.Success,
                    Message = $"Task \"{addedTaskName}\" has been saved.",
                },
                ReturnObject = formInformation,
            }));
        }
        public static List <FormInformation> GetInformation()//this function will retrieve all the information and place them in a list to be shown in a table
        {
            string          sql  = "server=localhost;user id=root;password=1234;database=kusteez";
            MySqlConnection conn = new MySqlConnection(sql);
            MySqlCommand    cmd  = conn.CreateCommand();

            cmd.CommandText = "select orderID, clothing, color, size, printColor, laceColor, font, status, finalCost, frontJersey, leftSleeveJersey, rightSleeveJersey, topBackJersey, bottomBackJersey, comment, phoneNumber, ticketNumber from kusteezform";

            List <FormInformation> infoList = new List <FormInformation>();

            conn.Open();

            MySqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                FormInformation fi = new FormInformation();

                fi.orderID           = reader["orderID"] == null ? 0 : Convert.ToInt32(reader["orderID"]);
                fi.finalCost         = reader["finalCost"] == null ? 0 : Convert.ToDouble(reader["finalCost"]);
                fi.clothingType      = reader["clothing"].ToString();
                fi.clothingColor     = reader["color"].ToString();
                fi.size              = reader["size"].ToString();
                fi.printColor        = reader["printColor"].ToString();
                fi.laceColor         = reader["laceColor"].ToString();
                fi.font              = reader["font"].ToString();
                fi.status            = reader["status"].ToString();
                fi.frontJersey       = reader["frontJersey"].ToString();
                fi.leftSleeveJersey  = reader["leftSleeveJersey"].ToString();
                fi.rightSleeveJersey = reader["rightSleeveJersey"].ToString();
                fi.topBackJersey     = reader["topBackJersey"].ToString();
                fi.bottomBackJersey  = reader["bottomBackJersey"].ToString();
                fi.comments          = reader["comment"].ToString();
                fi.phoneNumber       = reader["phoneNumber"].ToString();
                fi.ticketNumber      = reader["ticketNumber"].ToString();

                infoList.Add(fi);
            }
            conn.Close();
            return(infoList);
        }
Beispiel #23
0
        public async Task <ActionResult> ScanTemplate(string templateName)
        {
            var scanInfo = new ScanTemplateInfo();
            var listInfo = new List <FormInformation>();

            if (string.IsNullOrEmpty(templateName))
            {
                return(new EmptyResult());
            }

            var spContext = SharePointContextProvider.Current.GetSharePointContext(System.Web.HttpContext.Current);

            using (var clientContext = spContext.CreateUserClientContextForSPHost())
            {
                var blobInfo = await TemplateManager.GetXsnBlobInfo(templateName, StorageContext);

                if (blobInfo == null)
                {
                    return(new EmptyResult());
                }

                try
                {
                    FormInformation info = InfoPathAnalytics.FormInformation(blobInfo.FileStream);
                    info.XsnUrl = blobInfo.FileName;
                    listInfo.Add(info);
                }
                catch
                {
                    scanInfo.AddMessage(templateName);
                }
            }


            scanInfo.FormInfos = listInfo;

            return(View("ScanTemplates", scanInfo));
        }
Beispiel #24
0
        public ActionResult ScanTemplate()
        {
            var    spContext    = SharePointContextProvider.Current.GetSharePointContext(System.Web.HttpContext.Current);
            string spListId     = this.Request["SPListId"];
            string spListItemId = this.Request["SPListItemId"];
            string relativeUrl  = this.Request["url"];

            using (var clientContext = spContext.CreateUserClientContextForSPHost())
            {
                SP.File file = null;

                SP.Web web = clientContext.Web;
                clientContext.Load(web);

                if (string.IsNullOrEmpty(relativeUrl))
                {
                    Guid listId = new Guid(spListId);
                    int  itemId = Convert.ToInt32(spListItemId);

                    SP.List spList = clientContext.Web.Lists.GetById(listId);
                    clientContext.Load <SP.List>(spList);

                    SP.ListItem item = spList.GetItemById(itemId);
                    clientContext.Load <SP.ListItem>(item);
                    clientContext.ExecuteQuery();
                    file = item.File;
                }
                else
                {
                    file = web.GetFileByServerRelativeUrl(relativeUrl);
                }
                FormInformation info = InfoPathAnalytics.FormInformation(clientContext, file);
                info.XsnUrl = file.ServerRelativeUrl;
                return(View(info));
            }
        }
Beispiel #25
0
        public IActionResult Get()
        {
            var formInformation = new FormInformation <AssignmentCriteria>()
            {
                Model = new AssignmentCriteria()
                {
                    PersonID = currentUserService.GetCurrentUserInfo().ID
                },
            };

            formService.UpdateFormInformation(formInformation);

            return(Json(new FilteredListInformation <AssignmentViewModel, AssignmentCriteria>()
            {
                SortDirection = ListSortDirection.Ascending,
                SortExpression = nameof(AssignmentViewModel.AssignedOn),
                EmptyDataMessage = "No Assignments found.",
                AllowManualRefresh = true,
                ShowCount = true,
                Title = "To-Do items",
                ShowFilterForm = true,
                FilterFormInformation = formInformation,
            }));
        }
        public int insertCompletedStatus(FormInformation fi)//this function is used to change the status of an order from not complete to completed
        {
            string completedID   = fi.completedID;
            string taskCompleted = "Complete";
            int    x             = Int32.Parse(completedID);

            string          sql  = "server=localhost;user id=root;password=1234;database=kusteez";
            MySqlConnection conn = new MySqlConnection(sql);
            MySqlCommand    cmd  = conn.CreateCommand();

            cmd.Parameters.AddWithValue("@taskCompleted1", taskCompleted);
            cmd.Parameters.AddWithValue("@completedID1", x);

            cmd.CommandText = "update kusteezform set status = @taskCompleted1 where (orderID = @completedID1)";

            conn.Open();

            cmd.ExecuteNonQuery();


            conn.Close();

            return(0);
        }
Beispiel #27
0
        private void WriteContent(EntityMetadata entityMetadata, string objectName, string constructorName, FormInformation formInfo)
        {
            this._entityMetadata = entityMetadata;

            WriteContentInternal(entityMetadata.LogicalName, objectName, constructorName, formInfo);
        }
Beispiel #28
0
 public Task WriteContentAsync(EntityMetadata entityMetadata, string objectName, string constructorName, FormInformation formInfo)
 {
     return(Task.Run(() => WriteContent(entityMetadata, objectName, constructorName, formInfo)));
 }
Beispiel #29
0
 public Task WriteContentAsync(string entityLogicalName, string objectName, string constructorName, FormInformation formInfo)
 {
     return(Task.Run(() => WriteContent(entityLogicalName, objectName, constructorName, formInfo)));
 }
Beispiel #30
0
        private void WriteContent(string entityLogicalName, string objectName, string constructorName, FormInformation formInfo)
        {
            var repository = new EntityMetadataRepository(_service);

            this._entityMetadata = repository.GetEntityMetadata(entityLogicalName);

            WriteContentInternal(entityLogicalName, objectName, constructorName, formInfo);
        }