Esempio n. 1
0
    private Boolean Execute_Query()
    {
        Boolean b = false;

        if (Case_Type.Equals("Application") || Case_Type.Equals("Verification"))
        {
            query = "Select * From " + Case_Type + ",Employee where Employee.User_Name='" + username + "' and Employee.empid=" + Case_Type + ".empid";
            SqlCommand cmd = new SqlCommand(query, con);
            dt = new DataTable();
            dt.Load(cmd.ExecuteReader());
        }
        else if (Case_Type.Equals("Verification_Admin"))
        {
            query = "Select * From Verification_Admin";
            SqlCommand cmd = new SqlCommand(query, con);
            dt = new DataTable();
            dt.Load(cmd.ExecuteReader());
        }
        else
        {
            query = "Select * From " + Case_Type + ",Employee,[Case] where Employee.User_Name='" + username + "' and Employee.empid=[Case].empid and [Case].Case_no=" + Case_Type + ".Case_no";
            SqlCommand cmd = new SqlCommand(query, con);
            dt = new DataTable();
            dt.Load(cmd.ExecuteReader());
            b = true;
        }
        return(b);
    }
Esempio n. 2
0
 public String Get_Alerts(String no)
 {
     Connect_Database();
     if (Case_Type.Equals("ALL"))
     {
         Case_Type = "Trap";
         Generate_Alert();
         Case_Type = "MC";
         Generate_Alert();
         Case_Type = "DPA";
         Generate_Alert();
         Case_Type = "OE";
         Generate_Alert();
         Case_Type = "ED";
         Generate_Alert();
         Case_Type = "Application";
         Generate_Alert();
         Case_Type = "Verification";
         Generate_Alert();
     }
     else
     {
         Generate_Alert();
     }
     Sort_Details();
     return(Get_Val(no));
 }
Esempio n. 3
0
    private void Generate_Alert()
    {
        if (Execute_Query())
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                String stat = dt.Rows[i][dt.Columns.Count - 11].ToString();
                String ext  = dt.Rows[i][dt.Columns.Count - 10].ToString();
                int    ex   = 0;
                if (!ext.Equals("0"))
                {
                    ex = Int32.Parse(ext);
                }
                int p = Find_Phase(i, stat);
                for (int j = p; j < dt.Columns.Count - 12; j++)
                {
                    Case_Details c = new Case_Details();
                    c.case_no = dt.Rows[i][0].ToString();
                    String s = dt.Rows[i][j].ToString();
                    s = s.Replace("/", "#");
                    DateTime d = new DateTime(Int32.Parse(s.Split('#')[2]), Int32.Parse(s.Split('#')[0]), Int32.Parse(s.Split('#')[1]));
                    d           = d.AddDays(ex);
                    c.date      = d;
                    c.Case_Type = this.Case_Type;
                    c.stage     = dt.Columns[j].ColumnName.ToString().Split('_')[0];
                    if (DateTime.Compare(System_Date, d) > 0)
                    {
                        c.alert = "Pending";
                    }
                    else
                    {
                        c.alert = "";
                    }
                    j++;
                    details.Add(c);
                }
            }
        }
        else if (Case_Type.Equals("Verification_Admin"))
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                String stat = dt.Rows[i][4].ToString().ToLower();
                if (stat.Equals("pending"))
                {
                    Case_Details c = new Case_Details();
                    c.case_no = dt.Rows[i][0].ToString();
                    String s = dt.Rows[i][1].ToString();
                    s = s.Replace("/", "#");
                    DateTime d = new DateTime(Int32.Parse(s.Split('#')[2]), Int32.Parse(s.Split('#')[0]), Int32.Parse(s.Split('#')[1]));
                    c.date      = d;
                    c.Case_Type = this.Case_Type;
                    c.stage     = "";
                    d           = d.AddDays(15);
                    if (DateTime.Compare(System_Date, d) > 0)
                    {
                        c.alert = "Pending";
                    }
                    else
                    {
                        c.alert = "";
                    }
                    details.Add(c);
                }
            }
        }
        else
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                String stat = dt.Rows[i][dt.Columns.Count - 9].ToString().ToLower();
                if (stat.Equals("pending"))
                {
                    Case_Details c = new Case_Details();
                    c.case_no = dt.Rows[i][0].ToString();
                    String s = dt.Rows[i][4].ToString();
                    s = s.Replace("/", "#");
                    DateTime d = new DateTime(Int32.Parse(s.Split('#')[2]), Int32.Parse(s.Split('#')[0]), Int32.Parse(s.Split('#')[1]));

                    c.date      = d;
                    c.Case_Type = this.Case_Type;
                    c.stage     = "";
                    d           = d.AddDays(15);
                    if (DateTime.Compare(System_Date, d) > 0)
                    {
                        c.alert = "Pending";
                    }
                    else
                    {
                        c.alert = "";
                    }
                    details.Add(c);
                }
            }
        }
    }