コード例 #1
0
        protected void BtnSubmitForm_Click(object sender, EventArgs e)
        {
            string   deptId      = HttpContext.Current.Profile.GetPropertyValue("department").ToString();
            string   fullName    = HttpContext.Current.Profile.GetPropertyValue("fullname").ToString();
            DateTime requestDate = DateTime.Now;
            int      requestId   = RequisitionLogic.CreateRequisitionRecord(fullName, deptId, requestDate);

            for (int i = 0; i < GridViewRequisitionForm.Rows.Count; i++)
            {
                string ItemID = (GridViewRequisitionForm.Rows[i].FindControl("LblItemID") as Label).Text;
                int    RequestedQuantity;
                if (!int.TryParse((GridViewRequisitionForm.Rows[i].FindControl("TxtRequestedQuantity") as TextBox).Text, out RequestedQuantity))
                {
                }

                string Status             = "Pending";
                string Priority           = "No";
                RequisitionRecordDetail r = RequisitionLogic.CreateRequisitionRecordDetail(requestId, ItemID, RequestedQuantity, Status, Priority);
            }


            statusMessage.Text                 = "Stationery Requisition Form Submitted Successfully.";
            statusMessage.ForeColor            = Color.Green;
            statusMessage.Visible              = true;
            BtnSubmitForm.Visible              = false;
            GridViewRequisitionForm.DataSource = null;
            GridViewRequisitionForm.DataBind();
            LinkButtonGoBack.Visible = false;
            Session["CartList"]      = null;
        }