Exemplo n.º 1
0
        protected void Insert_VDQCommentStatus()
        {
            //string strIncidentID = "1";
            string strPersonID = string.Empty;

            try
            {
                if (UDIRSHelper.PersonDetails != null)
                {
                    strPersonID = UDIRSHelper.PersonDetails.Id.ToString();
                }
                else
                {
                    //redirect to login
                }
                // @PersonID ,      @IncidentID,       @IncidentSubInvestigationCausesIDs,     @OtherInvestigation,  @IncidentStatus,      @Comments)
                oDV = AdoUDIRS.InsertVDQCommentStatus(strPersonID, IncidentID, lblStatus.Text, txtVDQComments.Text.Trim());
                // string RefId = oDV.ToTable().Rows[0]["IncidentID"].ToString();
                if (oDV == null)
                {
                    Label lbl = (Label)Page.Master.FindControl("lblMessage");
                    Message.Failure("Failed to save incident data.", lbl); ///// Pass label saleem
                    return;
                }
                else
                {
                    DataTable dt = oDV.ToTable();
                    //RefId = oDV.Table.Rows[0]["IncidentID"].ToString();
                    //Session["IncidentID"] = RefId;
                    Label lbl = (Label)Page.Master.FindControl("lblMessage");

                    //--Response.Redirect("~/Web/ThankYou.aspx", true);
                    //Message.Success("Incident data saved Successfullyssssssssssss", lbl); ///// Pass label saleem
                }
                if (AdoUDIRS.BlnError)
                {
                }
                else if (oDV.Count == 0)
                {
                }
                else if (oDV.Count > 0)
                {
                    //RefId = oDV.ToTable().Rows[0]["IncidentID"].ToString();
                    //Session["PersonID"] = RefId;
                }
            }
            catch (Exception ex)
            {
                Label lbl = (Label)Page.Master.FindControl("lblMessage");
                Message.Failure("Error 221, sorry, an error occured, " + AdoUDIRS.StrError, lbl); ///// Pass label saleem
                //lblRMsg.Text = "Error 40, sorry, an error occured, " + AdoUDIRS.StrError;
            }
        }