Gcobani Mkontwana

Gcobani Mkontwana

  • 554
  • 2k
  • 416.7k

How to create workflow until its finished in .net core asp using c#?

May 10 2024 6:53 PM

Hi Team

I need some help, i have a form now the challenge this form needs to be sent to sharepoint once submitted. The worklow is when clicking Request Action button( must first gets to Responsible Person, second it must be able track the document work flow(who edit the form, where is it sitting and who approve/reject it. Once rejected it must be back to the Responsible person again for second submit approval. All the status must be shown either on sharepoint(column set the column name(ApproverName as Person/Group there will show email outlook). 

<!--Responsible person names and address-->

<div class="form-group row">
    @Html.LabelFor(model => model.ResponsiblePerson, htmlAttributes: new { @class = "col-md-4 col-form-label text-md-right" })
    <div class="col-md-8">
        <div class="input-group">
            <input type="text" class="form-control" id="responsible_person">
            <div class="input-group-append">
                <button class="btn btn-outline-secondary" type="button" id="check-names">
                    <img src="@Url.Content("~/Images/Person-fill.svg")" alt="Check Names" style="height: 20px; width: 20px;" />
                </button>
                <button class="btn btn-outline-secondary" type="button" id="browse-directory">
                    <img src="@Url.Content("~/Images/sov-address-book.png")" alt="Check Names" style="height:20px; width:20px;" />
                </button>
            </div>
        </div>
    </div>
</div>

<!--1 Managers approval names and address-->
<div class="form-group row">
    @Html.LabelFor(model => model.ManagerApproval, htmlAttributes: new { @class = "col-md-4 col-form-label text-md-right" })
    <div class="col-md-8">
        <div class="input-group">
            <input type="text" class="form-control" id="managers_approval">
            <div class="input-group-append">
                <button class="btn btn-outline-secondary" type="button" id="check-names">
                    <img src="@Url.Content("~/Images/Person-fill.svg")" alt="Check Names" style="height: 20px; width: 20px;" />
                </button>
                <button class="btn btn-outline-secondary" type="button" id="browse-directory">
                    <img src="@Url.Content("~/Images/sov-address-book.png")" alt="Check Names" style="height:20px; width:20px;" />
                </button>
            </div>
        </div>
    </div>
</div>

<!--2 Managers approval names and address-->
<div class="form-group row">
    @Html.LabelFor(model => model.SecondManagerApproval, htmlAttributes: new { @class = "col-md-4 col-form-label text-md-right" })
    <div class="col-md-8">
        <div class="input-group">
            <input type="text" class="form-control" id="secondmanagers_approval">
            <div class="input-group-append">
                <button class="btn btn-outline-secondary" type="button" id="second-approve">
                    <img src="@Url.Content("~/Images/Person-fill.svg")" alt="Check Names" style="height: 20px; width: 20px;" />
                </button>
                <button class="btn btn-outline-secondary" type="button" id="browse-directory">
                    <img src="@Url.Content("~/Images/sov-address-book.png")" alt="Check Names" style="height:20px; width:20px;" />
                </button>
            </div>
        </div>
    </div>
</div>

<!--Status of the SHEQ NCR -->
<div class="form-group row">
    @Html.LabelFor(model => model.Status, htmlAttributes: new { @class = "col-md-4 col-form-label text-md-right" })
    <div class="col-md-8">
        @{
            // Create the SelectList
            var statusList = (SelectList)ViewBag.Status;
        }
        @{
            // Determine if the status is "Draft"
            var isDraft = Model.Status == "Draft";
        }
        @if (isDraft)
        {
            // If the status is "Draft", render the dropdown list with the "Draft" option disabled
            @Html.DropDownListFor(Model => Model.Status, statusList, "Draft", new { @class = "form-control", disabled = "disabled" })
        }
        else
        {
            // If the status is not "Draft", render the dropdown list as usual
            @Html.DropDownListFor(Model => Model.Status, statusList, new { @class = "form-control" })
        }
    </div>
    <div class="col-md-7 offset-md-4">
        <p class="form-group row">SHEQ Non-Conformance Management Record Status (Office Use Only)</p>
    </div>
</div>

<!-- File attachments -->
<div class="form-group row">
    @Html.LabelFor(model => model.FileAttachment, htmlAttributes: new { @class = "col-md-4 col-form-label text-md-right" })
    <div class="col-md-8">
        <div class="custom-file">
            <input type="file" class="custom-file-input" id="fileAttachment" name="FileAttachment">
            <label class="custom-file-label" for="fileAttachment">Choose file</label>
        </div>
    </div>
</div>

<div class="col-md-6">
            <div class="card border-dark rounded h-100">
                <div class="card-body d-flex flex-column justify-content-between">
                    <!-- Text above Request Action button -->
                    <div class="mb-4">
                        <p class="text-center">To submit for immediate feedback, click "Request Action" below.</p>
                    </div>
                    <!-- Step 2: Request Action -->
                    <div class="mb-4">
                        <div class="row justify-content-center">
                            <div class="col-md-5">
                                <!-- Adjusted column width to 12 -->
                                <button type="button" class="btn btn-danger btn-block">Request Action</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

 


Answers (2)