コード例 #1
0
ファイル: RequestABPItem.aspx.cs プロジェクト: ysreedhar/PMS
    protected void btnConfirm_Click(object sender, EventArgs e)
    {
        tblRequisitionTableAdapter RequisitionTableAdapter = new tblRequisitionTableAdapter();
        int new_RequestID = Convert.ToInt32(RequisitionTableAdapter.InsertABPItemRequisition(ddlToWarehouse.SelectedItem.Text, ddlToLocation.SelectedItem.Text.Trim(), 1, ddlFromWarehouse.SelectedItem.Text, ddlFromLocation.SelectedItem.Text, CommonFunctions.ConvertToUniversalDate(txtRequiredDateFrom.Text), 10, Context.User.Identity.Name, txtCEPNumber.Text));
        tblRequestDetailsTableAdapter RequestItemAdapter = new tblRequestDetailsTableAdapter();

        foreach (GridViewRow RItem in gvRequirement.Rows)
        {
            RequestItemAdapter.InsertNewRequestABPItem(new_RequestID, RItem.Cells[0].Text, Convert.ToDecimal(RItem.Cells[3].Text), CommonFunctions.ConvertToUniversalDate(txtRequiredDateFrom.Text), txtRqTime.Text, 0, 10);
        }
        // Show Message
        lblSuccessfulTransactionNumber.Text = " - " + String.Format("{0:0000000}", new_RequestID);
        // Generate Email
        bool EmailSentBool = CommonFunctions.SendNewRequisitionEmail(new_RequestID, ddlFromWarehouse.SelectedItem.Text, ddlFromLocation.SelectedItem.Text, ddlToWarehouse.SelectedItem.Text, ddlToLocation.SelectedItem.Text.Trim(), Server.HtmlEncode("PMS-II - New Requisition Alert"), Server.HtmlEncode(String.Format("{0:0000000}", new_RequestID)));

        // Set The View to next search and show the link for Requisition Note
        hlRequisitionNote.NavigateUrl = String.Format("javascript:window.open('RequisitionNote.aspx?RqNo=" + new_RequestID + "', null, 'height=500,width=750,status=yes,toolbar=no,menubar=no,location=no'); void('');");;
        MultiView1.SetActiveView(vwSuccess);
    }