Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            char   s = 'a';
            string a = "This is a lab T";
            string b = "ali";

            Console.WriteLine(String.Concat(a, b));
            Console.WriteLine(String.Compare(a, b, true));
            Console.WriteLine(a.Contains('a'));
            Console.WriteLine(a.StartsWith("T"));
            Console.WriteLine(a.Equals(b));
            string [] arr = a.Split('a');
            Console.WriteLine(a.TrimStart('T'));
            Console.WriteLine(a.ToLower());
            Console.WriteLine(a.Substring(5));
            Console.WriteLine(a.Substring(0, 9));
            Console.WriteLine(a.IndexOf('i', 3, 2));
            Console.WriteLine(a.IndexOf("lab"));
            Console.WriteLine(a.LastIndexOf('l', 9));

            Console.Read();

            Employee e = new PEmployee(1, "x");

            e = new CEmployee(2, "y");
        }
Ejemplo n.º 2
0
        // Edit Mode.
        public F300_Employee(int ID)
        {
            pEmployee       = new PEmployee(this);
            this.ControlBox = false;
            InitializeComponent();
            editID             = ID;
            labelTitle.Text    = "Edit Employee";
            labelEmpID.Visible = true;
            txtID.Text         = editID.ToString();
            txtID.Visible      = true;
            saveButton.Text    = "SAVE";

            // Assign lists to the comboboxes.
            boxPos.DataSource    = posList;
            boxPos.DisplayMember = "PositionName";
            boxPos.ValueMember   = "PositionID";
            boxLvl.DataSource    = lvlList;
            boxLvl.DisplayMember = "LevelName";
            boxLvl.ValueMember   = "LevelID";
            boxBra.DataSource    = branchList;
            boxBra.DisplayMember = "BranchName";
            boxBra.ValueMember   = "BranchID";
            // Show the data of the currently being edited employee.
            DetailedEmployeeData employee = pEmployee.GetEmployee(ID);

            txtName.Text         = employee.EmployeeName;
            boxPos.SelectedValue = employee.PositionID;
            boxBra.SelectedValue = employee.BranchID;
            datePickStart.Value  = employee.StartDate;
            datePickEnd.Value    = employee.EndDate;
            txtEmail.Text        = employee.Email;
            txtMobile.Text       = employee.Mobile;
            txtAddress.Text      = employee.Address;
            datePickBirth.Value  = employee.Birthday;
            boxLvl.SelectedValue = employee.LevelID;
            txtDesire.Text       = employee.Desire;
            if (employee.Del == 1)
            {
                checkDel.Checked = true;
            }
            else
            {
                checkDel.Checked = false;
            }
            richTxtRemark.Text = employee.Remark;
        }
Ejemplo n.º 3
0
        // Create mode.
        public F300_Employee()
        {
            pEmployee       = new PEmployee(this);
            this.ControlBox = false;
            InitializeComponent();
            saveButton.Text = "CREATE";

            // Assign lists to the comboboxes.
            boxPos.DataSource    = posList;
            boxPos.DisplayMember = "PositionName";
            boxPos.ValueMember   = "PositionID";
            boxLvl.DataSource    = lvlList;
            boxLvl.DisplayMember = "LevelName";
            boxLvl.ValueMember   = "LevelID";
            boxBra.DataSource    = branchList;
            boxBra.DisplayMember = "BranchName";
            boxBra.ValueMember   = "BranchID";
        }