Exemplo n.º 1
0
    protected void FormView_Inward_ItemInserting(object sender, FormViewInsertEventArgs e)
    {
        DropDownList dropDownOffice = FormView_Inward.FindControl("dropdownlistSentTo") as DropDownList;

        e.Values["SentTo"]             = dropDownOffice.SelectedValue;
        e.Values["Document_Upload_Id"] = ViewState["documentUploadId"];
        //e.Values["InwardNo"] +=(@"\"+dropDownOffice.SelectedValue);
    }
Exemplo n.º 2
0
    protected void FormView_Inward_ItemCommand(object sender, FormViewCommandEventArgs e)
    {
        switch (e.CommandName)
        {
        case "Back":
            mvInward.SetActiveView(vieGrid);
            gvInwarddtl.DataBind();
            break;

        case "UploadFile":

            FileUpload FileUploadDocument = FormView_Inward.FindControl("FileUploadDocument") as FileUpload;
            string     uploadedPath       = UploadFile(FileUploadDocument);
            if (string.IsNullOrEmpty(uploadedPath) == false)
            {
                // write the code to insert a new entry to Document_Upload
                Document_UploadTableAdapter documentUploader = new Document_UploadTableAdapter();
                string fileName         = System.IO.Path.GetFileName(FileUploadDocument.PostedFile.FileName);
                int    documentUploadId = Convert.ToInt32(documentUploader.UploadNewDocument(fileName, string.Empty, uploadedPath));
                ViewState["documentUploadId"] = documentUploadId;
            }
            break;
        }
    }