Exemplo n.º 1
0
        public List <CatName> getCatName()
        {
            TeraManager    tmm         = new TeraManager();
            DataTable      dt          = new DataTable();
            List <CatName> lst_catname = new List <CatName>();

            try
            {
                string strQuery = string.Empty;
                strQuery  = " select cat_inx ,cat_name ,cat_color ";
                strQuery += " from DATALAB_OPER.PSS_CALENDAR_CATEGORIES order by cat_inx ";

                dt = tmm.GetDataTableTera(strQuery);
                CatName obj_catname;
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    obj_catname           = new CatName();
                    obj_catname.Cat_inx   = Convert.ToInt16(dt.Rows[i]["cat_inx"].ToString());
                    obj_catname.Cat_name  = dt.Rows[i]["cat_name"].ToString();
                    obj_catname.Cat_color = dt.Rows[i]["cat_color"].ToString();

                    lst_catname.Add(obj_catname);
                }
            }
            catch (Exception e)
            {
                Console.Out.WriteLine(e.Message.ToString());
            }

            return(lst_catname);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (CatName != null)
         {
             hashCode = hashCode * 59 + CatName.GetHashCode();
         }
         if (CatRoletype != null)
         {
             hashCode = hashCode * 59 + CatRoletype.GetHashCode();
         }
         if (CatGtmEntryodataBind != null)
         {
             hashCode = hashCode * 59 + CatGtmEntryodataBind.GetHashCode();
         }
         if (CatTeamMemberodataBind != null)
         {
             hashCode = hashCode * 59 + CatTeamMemberodataBind.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 3
0
        private void button3_Click(object sender, EventArgs e)
        {
            OleDbConnection Connection = new OleDbConnection(Con.ConnectionString());

            OleDbCommand DEL = new OleDbCommand("DELETE FROM Catagory WHERE CatName=@CatName", Connection);

            DEL.Parameters.AddWithValue("@CatName", CatName.Text.ToString());
            try
            {
                Connection.Open();
                int a = DEL.ExecuteNonQuery();
                Connection.Close();
                if (a == 1)
                {
                    toolStripStatusLabel1.Text = "Successfully Deleted";
                    CatName.Text = "";
                    Des.Text     = "";
                    Sup1.Text    = "";
                    Sup2.Text    = "";
                    Sup3.Text    = "";
                    CatName.Focus();
                }
                else
                {
                    toolStripStatusLabel1.Text = "Error Catagory Not Deleted";
                }
            }
            catch
            {
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Returns true if Body3 instances are equal
        /// </summary>
        /// <param name="other">Instance of Body3 to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Body3 other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CatName == other.CatName ||
                     CatName != null &&
                     CatName.Equals(other.CatName)
                     ) &&
                 (
                     CatRoletype == other.CatRoletype ||
                     CatRoletype != null &&
                     CatRoletype.Equals(other.CatRoletype)
                 ) &&
                 (
                     CatGtmEntryodataBind == other.CatGtmEntryodataBind ||
                     CatGtmEntryodataBind != null &&
                     CatGtmEntryodataBind.Equals(other.CatGtmEntryodataBind)
                 ) &&
                 (
                     CatTeamMemberodataBind == other.CatTeamMemberodataBind ||
                     CatTeamMemberodataBind != null &&
                     CatTeamMemberodataBind.Equals(other.CatTeamMemberodataBind)
                 ));
        }
Exemplo n.º 5
0
 private void button2_Click(object sender, EventArgs e)
 {
     CatName.Text               = "";
     Des.Text                   = "";
     Sup1.SelectedIndex         = -1;
     Sup2.SelectedIndex         = -1;
     Sup3.SelectedIndex         = -1;
     toolStripStatusLabel1.Text = "Cleared";
     CatName.Focus();
 }
Exemplo n.º 6
0
    private void MyInitForUpdate()
    {
        using (SqlConnection conn = new DB().GetConnection())
        {
            SqlCommand cmd = conn.CreateCommand();
            cmd.CommandText = "select * from Cats order by Orders desc";
            conn.Open();
            SqlDataReader rd1 = cmd.ExecuteReader();
            CatName.DataSource     = rd1;
            CatName.DataValueField = "ID";
            CatName.DataTextField  = "CatName";
            CatName.DataBind();
            rd1.Close();


            string sql = "select * from Subs order by valid desc,Orders desc;select * from Subs where ID = @ID";
            cmd.CommandText = sql;
            cmd.Parameters.AddWithValue("@ID", Convert.ToInt16(Request["ID"]));
            SqlDataReader rd = cmd.ExecuteReader();
            // string CatID = rd["CatID"].ToString();
            rd.NextResult();
            if (rd.Read())
            {
                SubName.Text     = rd["SubName"].ToString();
                Description.Text = rd["Description"].ToString();
                string CatID = rd["CatID"].ToString();
                if (CatName.Items.FindByValue(CatID) != null)
                {
                    CatName.ClearSelection();
                    CatName.Items.FindByValue(CatID).Selected = true;
                }
            }

            //读取单选框所选择的信息
            int valid = Convert.ToInt32(rd["Valid"]);
            if (valid == 1)
            {
                true1.Checked = true;
            }
            else
            {
                false1.Checked = true;
            }

            rd.Close();
            conn.Close();
        }
    }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            CatName.Focus();
            if (!String.IsNullOrEmpty(Request["ID"]))
            {
                using (SqlConnection conn = new DB().GetConnection())
                {
                    SqlCommand cmd = conn.CreateCommand();
                    string     sql = "select * from cats order by valid desc,Orders desc;select * from Cats where ID = @ID";
                    cmd.CommandText = sql;
                    cmd.Parameters.AddWithValue("@ID", Convert.ToInt16(Request["ID"]));
                    conn.Open();
                    SqlDataReader rd = cmd.ExecuteReader();

                    rd.NextResult();
                    if (rd.Read())
                    {
                        CatName.Text     = rd["CatName"].ToString();
                        Description.Text = rd["Description"].ToString();


                        Description.Text = rd["Description"].ToString();
                        int i = Convert.ToInt16(rd["Valid"]);
                    }
                    rd.Close();
                    conn.Close();
                }
            }
            else
            {
                MyDataBind();
            }
        }
    }
 private void NewButton_Click(object sender, RoutedEventArgs e)
 {
     ViewModel.ResetSelected();
     CatName.Focus();
 }
Exemplo n.º 9
0
        private List <String> BuildLevelList()
        {
            Levels = new List <string>();
            string category = CatName.ToUpper();

            //No Menu Storage
            if (category.Contains("NO MS") || category.Contains("NMS") || category.Contains("NO MENU STORAGE"))
            {
                CatDetect = "Any% No Menu Storage";
                if (SoleRegret)
                {
                    Levels.Add("Sole Regret");
                }
                Levels.Add("Wharf District");
                Levels.Add("Workmen Ward");
                Levels.Add("Hanging Gardens");
                Levels.Add("Cinderbrick Fort");
                Levels.Add("Roathus Lagoon");
                Levels.Add("Colford Cauldron");
                Levels.Add("Burstone Quarry");
                Levels.Add("End");
            }
            //All Story Levels
            else if (category.Contains("ASL") || category.Contains("ALL STORY LEVELS"))
            {
                CatDetect = "All Story Levels";
                if (SoleRegret)
                {
                    Levels.Add("Sole Regret");
                }
                Levels.Add("Wharf District");
                Levels.Add("Workmen Ward");
                Levels.Add("Melting Pot");
                Levels.Add("Sundown Path");
                Levels.Add("Hanging Gardens");
                Levels.Add("Cinderbrick Fort");
                Levels.Add("Pyth Orchard");
                Levels.Add("Langston River");
                Levels.Add("Prosper Bluff");
                Levels.Add("Wild Outskirts");
                Levels.Add("Jawson Bog");
                Levels.Add("Roathus Lagoon");
                Levels.Add("Point Lemaign");
                Levels.Add("Colford Cauldron");
                Levels.Add("Mount Zand");
                Levels.Add("Burstone Quarry");
                Levels.Add("Urzendra Gate");
                Levels.Add("Zulten's Hollow");
                if (Tazal)
                {
                    Levels.Add("Tazal Terminals 1");
                    Levels.Add("Tazal Terminals 2");
                }
                else if (Ram)
                {
                    Levels.Add("Battering Ram");
                    Levels.Add("Tazal Terminals 2");
                }
                else
                {
                    Levels.Add("Tazal Terminals");
                }
                Levels.Add("End");
            }
            //All Weapons
            else if (category.Contains("WEAPONS") || category.Contains("AW"))
            {
                CatDetect = "All Weapons";
                if (SoleRegret)
                {
                    Levels.Add("Sole Regret");
                }
                Levels.Add("Wharf District");
                Levels.Add("Workmen Ward");
                Levels.Add("Hanging Gardens");
                Levels.Add("Cinderbrick Fort");
                Levels.Add("Roathus Lagoon");
                Levels.Add("Prosper Bluff");
                Levels.Add("Wild Outskirts");
                Levels.Add("Point Lemaign");
                Levels.Add("Mount Zand");
                Levels.Add("Urzendra Gate");
                Levels.Add("Zulten's Hollow");
                Levels.Add("Colford Cauldron");
                Levels.Add("End");
            }
            //Any%
            else if (category.Contains("ANY%"))
            {
                CatDetect = "Any%";
                if (SoleRegret)
                {
                    Levels.Add("Sole Regret");
                }
                Levels.Add("Wharf District");
                Levels.Add("End");
            }
            //All Interactive Collectibles
            else if (category.Contains("COLLECTIBLES") || category.Contains("AIC"))
            {
                CatDetect = "All Interactive Collectibles";
                if (SoleRegret)
                {
                    Levels.Add("Sole Regret");
                }
                Levels.Add("Wharf District");
                Levels.Add("Melting Pot");
                Levels.Add("Workmen Ward");
                Levels.Add("Sundown Path");
                Levels.Add("Cinderbrick Fort");
                Levels.Add("Pyth Orchard");
                Levels.Add("Scrap Yard");
                Levels.Add("Zulwood Grove");
                Levels.Add("Windbag Ranch");
                Levels.Add("Breaker Barracks");
                Levels.Add("Trapper Shingle");
                Levels.Add("Hanging Gardens");
                Levels.Add("Roathus Lagoon");
                Levels.Add("Prosper Bluff");
                Levels.Add("Wild Outskirts");
                Levels.Add("Point Lemaign");
                Levels.Add("Colford Cauldron");
                Levels.Add("Mount Zand");
                Levels.Add("Urzendra Gate");
                Levels.Add("Zulten's Hollow");
                Levels.Add("Trigger Hill");
                Levels.Add("Boundless Bay");
                Levels.Add("Slinger Range");
                Levels.Add("Camp Dauncy");
                Levels.Add("Grady Incinerator");
                Levels.Add("Mancer Observatory");
                Levels.Add("Burstone Quarry");
                Levels.Add("End");
            }
            //Dreams and Challenges
            else if (category.Contains("DREAMS") || category.Contains("DC"))
            {
                CatDetect = "Dreams and Challenges";
                if (SoleRegret)
                {
                    Levels.Add("Sole Regret");
                }
                Levels.Add("Wharf District");
                Levels.Add("Cinderbrick Fort");
                Levels.Add("Workmen Ward");
                Levels.Add("Hanging Gardens");
                Levels.Add("Colford Cauldron");
                Levels.Add("Mount Zand");
                Levels.Add("Urzendra Gate");
                Levels.Add("Zulten's Hollow");
                Levels.Add("Trigger Hill");
                Levels.Add("Boundless Bay");
                Levels.Add("Scrap Yard");
                Levels.Add("Zulwood Grove");
                Levels.Add("Windbag Ranch");
                Levels.Add("Breaker Barracks");
                Levels.Add("Trapper Shingle");
                Levels.Add("Bullhead Court");
                Levels.Add("Camp Dauncy");
                Levels.Add("Slinger Range");
                Levels.Add("Grady Incinerator");
                Levels.Add("Mancer Observatory");
                Levels.Add("Point Lemaign");
                Levels.Add("Kid's Dream");
                Levels.Add("Singer's Dream");
                Levels.Add("Survivor's Dream");
                Levels.Add("End");
            }
            //Fail Case
            else
            {
                CatDetect = "Error";
                return(null);
            }

            if (Levels.Count != File.GetElementsByTagName("Name").Count)
            {
                return(null);
            }

            return(Levels);
        }
Exemplo n.º 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["RoleID"] == null || Session["UserID"] == null)
            {
                Util.ShowMessage("用户登录超时,请重新登录!", "Login2.aspx");
            }
            else
            {
                int RoleID = Convert.ToInt16(Session["RoleID"].ToString());
                if (RoleID > 1)
                {
                    Util.ShowMessage("对不起,你无权访问该页面!", "User_Center.aspx");
                }
                else
                {
                    LabelUserID.Text = Request.QueryString["ID"];
                    CatName.Focus();
                    if (!String.IsNullOrEmpty(Request["ID"]))
                    {
                        using (SqlConnection conn = new DB().GetConnection())
                        {
                            SqlCommand cmd = conn.CreateCommand();
                            string     sql = "select * from cats order by valid desc,Orders desc;select * from Cats where ID = @ID";
                            cmd.CommandText = sql;
                            cmd.Parameters.AddWithValue("@ID", Convert.ToInt16(Request["ID"]));
                            conn.Open();
                            SqlDataReader rd = cmd.ExecuteReader();
                            rd.NextResult();

                            if (rd.Read())
                            {
                                CatName.Text     = rd["CatName"].ToString();
                                Description.Text = rd["Description"].ToString();

                                //读取单选框所选择的信息
                                int valid = Convert.ToInt32(rd["Valid"]);
                                if (valid == 1)
                                {
                                    true1.Checked = true;
                                }
                                else
                                {
                                    false1.Checked = true;
                                }
                                int IsShow = Convert.ToInt32(rd["IsShow"]);
                                if (IsShow == 1)
                                {
                                    true2.Checked = true;
                                }
                                else
                                {
                                    false2.Checked = true;
                                }
                            }
                            rd.Close();
                            conn.Close();
                        }
                    }
                    else
                    {
                        MyDataBind();
                    }
                    //using (sqlconnection conn = new db().getconnection())
                    //{
                    //    string sql = "select * from Cats order by ID desc";
                    //    SqlCommand cmd = new SqlCommand(sql, conn);
                    //    conn.Open();
                    //    SqlDataReader rd = cmd.ExecuteReader();
                    //    cmd.Parameters.AddWithValue("@ID", Label1.Text);
                    //    rd = cmd.ExecuteReader();
                    //    if (rd.Read())
                    //    {
                    //        int valid = Convert.ToInt32(rd["Valid"]);
                    //        if (valid == 1)
                    //        {
                    //            true1.Checked = true;
                    //        }
                    //        else
                    //        {
                    //            false1.Checked = true;
                    //        }
                }
            }
        }
    }
Exemplo n.º 11
0
        private void button1_Click(object sender, EventArgs e)
        {
            OleDbConnection Connection = new OleDbConnection(Con.ConnectionString());

            if (CatName.Text.ToString().Trim(' ') == "")
            {
                toolStripStatusLabel1.Text = "Please Enter Catagory Name";
                CatName.Text = "";
                CatName.Focus();
            }
            else if ((Sup1.SelectedIndex == -1) && (Sup2.SelectedIndex == -1) && (Sup3.SelectedIndex == -1))
            {
                toolStripStatusLabel1.Text = "Please Select atleast One Supplier for this Catagory";
                Sup1.Focus();
            }
            else
            {
                try
                {
                    if (button1.Text.ToString() == "Save")
                    {
                        OleDbCommand INSERT = new OleDbCommand("INSERT INTO Catagory(CatName,Descriptions,Supplier1,Supplier2,Supplier3) VALUES(@CatName,@Descriptions,@Supplier1,@Supplier2,@Supplier3)", Connection);
                        INSERT.Parameters.AddWithValue("@CatName", CatName.Text.ToString());
                        INSERT.Parameters.AddWithValue("@Descriptions", Des.Text.ToString());

                        if (Sup1.SelectedIndex != -1)
                        {
                            INSERT.Parameters.AddWithValue("@Supplier1", Sup1.SelectedItem.ToString());
                        }
                        else
                        {
                            INSERT.Parameters.AddWithValue("@Supplier1", "");
                        }

                        if (Sup2.SelectedIndex != -1)
                        {
                            INSERT.Parameters.AddWithValue("@Supplier2", Sup2.SelectedItem.ToString());
                        }
                        else
                        {
                            INSERT.Parameters.AddWithValue("@Supplier2", "");
                        }

                        if (Sup3.SelectedIndex != -1)
                        {
                            INSERT.Parameters.AddWithValue("@Supplier3", Sup3.SelectedItem.ToString());
                        }
                        else
                        {
                            INSERT.Parameters.AddWithValue("@Supplier3", "");
                        }

                        Connection.Open();
                        int a = INSERT.ExecuteNonQuery();
                        Connection.Close();

                        if (a == 1)
                        {
                            toolStripStatusLabel1.Text = "Successfully Saved";
                            CatName.Text = "";
                            Des.Text     = "";
                            Sup1.Text    = "";
                            Sup2.Text    = "";
                            Sup3.Text    = "";
                            CatName.Focus();
                        }
                        else
                        {
                            toolStripStatusLabel1.Text = "Error Catagory not Saved";
                        }
                    }
                    else
                    {
                        OleDbCommand UPDES = new OleDbCommand("UPDATE Catagory SET Descriptions=@Descriptions WHERE CatName=@CatName", Connection);
                        UPDES.Parameters.AddWithValue("@CatName", CatName.Text.ToString());
                        UPDES.Parameters.AddWithValue("@Descriptions", Des.Text.ToString());

                        OleDbCommand UPSUP1 = new OleDbCommand("UPDATE Catagory SET Supplier1=@Supplier1 WHERE CatName=@CatName", Connection);
                        if (Sup1.SelectedIndex != -1)
                        {
                            UPSUP1.Parameters.AddWithValue("@Supplier1", Sup1.SelectedItem.ToString());
                        }
                        else
                        {
                            UPSUP1.Parameters.AddWithValue("@Supplier1", "");
                        }
                        UPSUP1.Parameters.AddWithValue("@CatName", CatName.Text.ToString());

                        OleDbCommand UPSUP2 = new OleDbCommand("UPDATE Catagory SET Supplier2=@Supplier2 WHERE CatName=@CatName", Connection);
                        if (Sup2.SelectedIndex != -1)
                        {
                            UPSUP2.Parameters.AddWithValue("@Supplier2", Sup2.SelectedItem.ToString());
                        }
                        else
                        {
                            UPSUP2.Parameters.AddWithValue("@Supplier2", "");
                        }
                        UPSUP2.Parameters.AddWithValue("@CatName", CatName.Text.ToString());

                        OleDbCommand UPSUP3 = new OleDbCommand("UPDATE Catagory SET Supplier3=@Supplier3 WHERE CatName=@CatName", Connection);
                        if (Sup3.SelectedIndex != -1)
                        {
                            UPSUP3.Parameters.AddWithValue("@Supplier3", Sup3.SelectedItem.ToString());
                        }
                        else
                        {
                            UPSUP3.Parameters.AddWithValue("@Supplier3", "");
                        }
                        UPSUP3.Parameters.AddWithValue("@CatName", CatName.Text.ToString());

                        int a, b, c, d;

                        Connection.Open();
                        a = UPDES.ExecuteNonQuery();
                        b = UPSUP1.ExecuteNonQuery();
                        c = UPSUP2.ExecuteNonQuery();
                        d = UPSUP3.ExecuteNonQuery();
                        Connection.Close();

                        if ((a == 1) && (b == 1) && (c == 1) && (d == 1))
                        {
                            toolStripStatusLabel1.Text = "Successfully Updated";
                            CatName.Text = "";
                            Des.Text     = "";
                            Sup1.Text    = "";
                            Sup2.Text    = "";
                            Sup3.Text    = "";
                            CatName.Focus();
                        }
                        else
                        {
                            toolStripStatusLabel1.Text = "Error Catagory Not Updated";
                        }
                    }
                }
                catch
                {
                }
            }
        }