Example #1
0
        private async void button1_Click(object sender, EventArgs e)
        {
            if (Validation())
            {
                if (!studentRequirementController.findSame(sno, selectedReqId))
                {
                    string path = CreateDirectory.CreateDir(sno + "-" + name.Split(',')[0]);
                    studentRequirementController.addStudentReq(sno, selectedReqId);
                    auditTrail.addAudit(label7.Text, name + "Submit " + comboBox2.SelectedItem.ToString());

                    string datenow  = DateTime.Now.ToString("yyyy--MM--dd");
                    string timenow  = DateTime.Now.ToString("HH--mm--ss--tt");
                    string combine  = datenow + "--" + timenow;
                    string filename = combine + "--" + selectedReqId + ".jpg";
                    pbAutomated.Image.Save(path + filename);

                    await saveDb(selectedReqId, filename, path);

                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Already has the requirement", "validation", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Complete Required Field", "validation", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
        private void NewFolderMenuItem_Click(object sender, EventArgs e)
        {
            var parentNode = TreeView.SelectedNode;
            var parentPath = GetPath(parentNode);

            CreateDirectory?.Invoke(sender, new DirectoryEventArgs(parentPath));
        }
Example #3
0
            public override void CreateDirectory(CreateDirectory action)
            {
                string directory = Runner.InvokeExpression <string>(action.Path);

                _form.RaiseProgressChanged(String.Format(UILabels.CreatingDirectory, directory));

                Directory.CreateDirectory(directory);
            }
Example #4
0
        private void directoryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (RightClickedNode != null)
            {
                CreateDirectory window = new CreateDirectory(RightClickedNode.Tag.ToString() + "/");
                window.ShowDialog();

                RightClickedNode.Collapse();
                RightClickedNode.Expand();
            }
        }
Example #5
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            string side = communication.CorrectSide(sideLeft, sideRight);

            sideLeft.isActive  = false;
            sideRight.isActive = false;
            string sourcePath = side == "left" ? sideLeft.mainPath.Text : sideRight.mainPath.Text;
            var    dialog     = new CreateDirectory(sourcePath);

            dialog.Show();
            dialog.CreatedDirectory += RefreshAllList;
        }
        public void SerializeTo(string key, IClientSideObjectWriter writer, IEditorUrlBuilder urlBuilder)
        {
            Func <string, string> encoder = url => owner.IsSelfInitialized ? HttpUtility.UrlDecode(url) : url;
            var json = new Dictionary <string, string>();

            if (Select.HasValue())
            {
                json["selectUrl"] = encoder(urlBuilder.PrepareUrl(Select));
            }

            if (Thumbnail.HasValue())
            {
                json["thumbUrl"] = encoder(urlBuilder.PrepareUrl(Thumbnail));
            }

            if (Image.HasValue())
            {
                json["imageUrl"] = encoder(urlBuilder.PrepareUrl(Image));
            }

            if (Upload.HasValue())
            {
                json["uploadUrl"] = encoder(urlBuilder.PrepareUrl(Upload));
            }

            if (DeleteFile.HasValue())
            {
                json["deleteFileUrl"] = encoder(urlBuilder.PrepareUrl(DeleteFile));
            }

            if (DeleteDirectory.HasValue())
            {
                json["deleteDirectoryUrl"] = encoder(urlBuilder.PrepareUrl(DeleteDirectory));
            }

            if (CreateDirectory.HasValue())
            {
                json["createDirectoryUrl"] = encoder(urlBuilder.PrepareUrl(CreateDirectory));
            }

            if (Filter.HasValue() && Filter != DefaultFilter)
            {
                json["filter"] = Filter;
            }

            writer.AppendObject(key, json);
        }
Example #7
0
        public void ExecuteTest()
        {
            string path = TestUtility.TempDir + @"tempdir" + new Random().Next(10000000);

            if (Directory.Exists(path))
            {
                Directory.Delete(path, true);
            }

            CreateDirectory cd = new CreateDirectory();

            cd.Path = path;

            cd.Execute();

            Assert.IsTrue(Directory.Exists(path));

            //cleanup
            Directory.Delete(path);
        }
Example #8
0
        private async void save()
        {
            string path = CreateDirectory.CreateDir(StudentModel.getSno() + "-" + StudentModel.getLn());

            foreach (DocsAdding d in panelParam.Controls)
            {
                dicImage.Add(d.ReqId, d.Image);
            }

            foreach (KeyValuePair <int, Image> kp in dicImage)
            {
                string datenow  = DateTime.Now.ToString("yyyy--MM--dd");
                string timenow  = DateTime.Now.ToString("HH--mm--ss--tt");
                string combine  = datenow + "--" + timenow;
                string filename = combine + "--" + kp.Key + ".jpg";
                kp.Value.Save(path + filename);

                await  saveDb(kp.Key, filename, path);
            }
        }
Example #9
0
        public ActionResult UpLoadImages(HttpPostedFileBase file)
        {
            if (file != null)
            {
                for (int i = 0; i < Request.Files.Count; i++)
                {
                    var    files    = Request.Files[i];
                    var    fileName = Path.GetFileName(file.FileName);
                    string fileType = Path.GetExtension(file.FileName);

                    if (fileName != "")
                    {
                        string newName = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() +
                                         DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() +
                                         DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString() + fileType;
                        //Ruta de Archivo
                        string Currentpath = Server.MapPath("/ImgUploads");

                        CreateDirectory ImgDr = new CreateDirectory();

                        ImgDr.CreatePath(Currentpath);
                        var path = Currentpath + "\\" + newName;
                        files.SaveAs(path);

                        string RelativePath = "ImgUploads" + "/" + newName;

                        Uri url = System.Web.HttpContext.Current.Request.Url;

                        int port = url.Port;


                        string retPath = "http://" + "localhost:" + port + "/" + RelativePath;

                        return(Content(retPath));
                    }
                }
            }
            return(View());
        }
Example #10
0
    static void Main()
    {
        CreateDirectory folder = new CreateDirectory();

        folder.CreateDirectories();
    }
Example #11
0
        public ActionResult <Node> CreateDirectory([FromBody] CreateDirectory createDirectory)
        {
            Node node = _browser.CreateDirectory(createDirectory);

            return(Ok(node));
        }
Example #12
0
        static void Main()
        {
            CreateDirectory file = new CreateDirectory();

            file.CreateDirectories();
        }