Esempio n. 1
0
        protected void lvCRMSurvey_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 SurveyID;

            Int64.TryParse(e.CommandArgument.ToString(), out SurveyID);

            if (SurveyID > 0)
            {
                if (string.Equals(e.CommandName, "EditItem"))
                {
                    _SurveyID = SurveyID;

                    PrepareEditView();

                    cpeEditor.Collapsed   = false;
                    cpeEditor.ClientState = "false";
                }
                else if (string.Equals(e.CommandName, "DeleteItem"))
                {
                    try
                    {
                        Int64 result = -1;

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(CRMSurveyEntity.FLD_NAME_SurveyID, SurveyID.ToString(), SQLMatchType.Equal);

                        CRMSurveyEntity cRMSurveyEntity = new CRMSurveyEntity();


                        result = FCCCRMSurvey.GetFacadeCreate().Delete(cRMSurveyEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _SurveyID        = 0;
                            _CRMSurveyEntity = new CRMSurveyEntity();
                            PrepareInitialView();
                            BindCRMSurveyList();

                            MiscUtil.ShowMessage(lblMessage, "Survey has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Survey.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
 public string ToString()
 {
     return("SurveyID: " + SurveyID.ToString() + ", " + "SurveyName: " + SurveyName + ", " + "UserID: " + UserID.ToString() + ", "
            + "Type: " + Type + ", " + "Description: " + Description + ", " + "StartDate: " + StartDate.ToString() + ", " +
            "EndDate: " + EndDate.ToString() + ", " + "Permission: " + Permission);
 }
Esempio n. 3
0
    private void GetReportData()
    {
        //First step, initialize some local vars... (WQM) 01/30/2008
        //SurveyID = 4;
        //SchoolID = 16319;

        SqlCommand cmd = new SqlCommand("GetReportDetails", objConn);

        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@SurveyID", SurveyID);
        cmd.Parameters.AddWithValue("@SchoolID", SchoolID);
        cmd.Parameters.AddWithValue("@DistrictID", DistrictID);
        if (StateID == "''")
        {
            StateID = "";
        }
        cmd.Parameters.AddWithValue("@StateID", StateID);
        cmd.CommandTimeout = 900;
        SqlDataAdapter objAdapt = new SqlDataAdapter();

        //lblError.Text += "suid=" + SurveyID + "*schid=" + SchoolID + "*distid=" + DistrictID + "*stid=" + StateID + "*";
        //return;
        objAdapt.SelectCommand = cmd;
        objConn.Open();
        try
        {
            objAdapt.Fill(reportData);
            reportHeaders      = reportData.Tables[0];
            reportQuestions    = reportData.Tables[1];
            reportAnswers      = reportData.Tables[2];
            reportSurveysTaken = reportData.Tables[3];
            reportEntity       = reportData.Tables[4];

            /*lblError.Text += "<br>Tables=" + reportData.Tables.Count.ToString();
             * foreach (DataTable dt in reportData.Tables)
             * {
             *  lblError.Text += "<br>" + dt.TableName + "=" + dt.Rows.Count.ToString();
             * }
             * return;*/
        }
        catch (SqlException err)
        {
            Log("GetReportData", "ERROR", "", "", "Error Retrieving Report Data", "suid=" + SurveyID.ToString() + "*schid=" + SchoolID.ToString() + "*distid=" + DistrictID.ToString() + "*stid=" + StateID + "*");
        }
        finally
        {
            objConn.Close();
        }
    }
Esempio n. 4
0
    private void GetReportData()
    {
        SqlCommand cmd = new SqlCommand("GetReportDetailsNational", objConn);

        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@SurveyID", SurveyID);
        cmd.CommandTimeout = 900;
        SqlDataAdapter objAdapt = new SqlDataAdapter();

        //lblError.Text += "suid=" + SurveyID;
        //return;
        objAdapt.SelectCommand = cmd;
        objConn.Open();
        try
        {
            objAdapt.Fill(reportData);
            reportHeaders      = reportData.Tables[0];
            reportQuestions    = reportData.Tables[1];
            reportAnswers      = reportData.Tables[2];
            reportSurveysTaken = reportData.Tables[3];

            /*lblError.Text += "<br>Tables=" + reportData.Tables.Count.ToString();
             * foreach (DataTable dt in reportData.Tables)
             * {
             *  lblError.Text += "<br>" + dt.TableName + "=" + dt.Rows.Count.ToString();
             * }
             * return;*/
        }
        catch (SqlException err)
        {
            Log("GetReportData", "ERROR", "", "", "Error Retrieving Report Data", "suid=" + SurveyID.ToString() + " " + err.Message);
        }
        finally
        {
            objConn.Close();
        }
    }