//set layout
        private void Setlayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.updatedata:
                PanelGrid.Visible   = false;
                PanelUpdate.Visible = true;
                if (TxtStatus.Text == Status.OrderStatus[0].ToString())
                {
                    BtnUpdate.Visible = true;
                }
                else if (TxtStatus.Text == Status.OrderStatus[1].ToString())
                {
                    BtnUpdate.Visible = true;
                }
                else
                {
                    BtnUpdate.Visible = false;
                }
                break;

            case ModeForm.viewdata:
                PanelGrid.Visible   = true;
                PanelUpdate.Visible = false;
                break;
            }
        }
Example #2
0
        public FormEditSubnet(TreeNode treeNode, ModeForm modeForm)
        {
            InitializeComponent();
            this.modeForm = modeForm;
            switch (this.modeForm)
            {
            case ModeForm.Edit:
            {
                this.lcTreeNodeSubnet        = (LCTreeNodeSubnet)treeNode;
                this.Text                    = "Сеть : " + this.lcTreeNodeSubnet.Text;
                this.textBoxNameSubnet.Text  = this.lcTreeNodeSubnet.Text;
                this.textBoxIPSubnet.Text    = this.lcTreeNodeSubnet.IPSubnet;
                this.textBoxMaskSubnet.Text  = this.lcTreeNodeSubnet.MaskSubnet;
                this.textBoxDescription.Text = this.lcTreeNodeSubnet.Description;
                this.buttonAddSubnet.Text    = "Сохранить";
                break;
            }

            case ModeForm.New:
            {
                this.lcTreeNodeGroup        = (LCTreeNodeGroup)treeNode;
                this.textBoxNameSubnet.Text = "Новая сеть";
                break;
            }
            }
        }
Example #3
0
        // Change layout
        private void SetLayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.AddData:
                GenerateAccount();
                ClearFields();
                PanelGrid.Visible         = false;
                PanelInput.Visible        = true;
                BtnUpdate.Visible         = false;
                BtnSave.Visible           = true;
                TxtCustomerNo.Text        = "Otomatis";
                TxtCustomerName.Enabled   = true;
                TxtCusEmail.Enabled       = true;
                TxtCompanyName.Enabled    = true;
                TxtCompanyAddress.Enabled = true;
                TxtPhoneNo.Enabled        = true;
                TxtComEmail.Enabled       = true;
                TxtAccountNo.Enabled      = true;
                break;

            case ModeForm.UpdateData:
                GenerateAccount();
                PanelGrid.Visible         = false;
                PanelInput.Visible        = true;
                TxtCustomerName.Enabled   = true;
                TxtCusEmail.Enabled       = true;
                TxtCompanyName.Enabled    = true;
                TxtCompanyAddress.Enabled = true;
                TxtPhoneNo.Enabled        = true;
                TxtComEmail.Enabled       = true;
                TxtAccountNo.Enabled      = true;
                BtnSave.Visible           = false;
                BtnUpdate.Visible         = true;
                break;

            case ModeForm.ViewData:
                RefreshGrid();
                PanelGrid.Visible  = true;
                PanelInput.Visible = false;
                break;

            case ModeForm.DetailData:
                GenerateAccount();
                PanelInput.Visible        = true;
                PanelGrid.Visible         = false;
                TxtCustomerName.Enabled   = false;
                TxtCusEmail.Enabled       = false;
                TxtCompanyName.Enabled    = false;
                TxtCompanyAddress.Enabled = false;
                TxtPhoneNo.Enabled        = false;
                TxtComEmail.Enabled       = false;
                TxtAccountNo.Enabled      = false;
                BtnSave.Visible           = false;
                BtnUpdate.Visible         = false;
                break;
            }
        }
        // Change layout
        private void SetLayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.AddData:
                GenerateDerivative();
                GenerateAccount();
                ClearFields();
                PanelGrid.Visible        = false;
                PanelInput.Visible       = true;
                BtnUpdate.Visible        = false;
                BtnSave.Visible          = true;
                TxtEmployeeNo.Text       = "Otomatis";
                TxtEmployeeName.Enabled  = true;
                TxtPosition.Enabled      = true;
                TxtEmpEmail.Enabled      = true;
                TxtDerivativeEmp.Enabled = true;
                TxtAccountNo.Enabled     = true;
                break;

            case ModeForm.UpdateData:
                GenerateDerivative();
                GenerateAccount();
                PanelGrid.Visible        = false;
                PanelInput.Visible       = true;
                TxtEmployeeName.Enabled  = true;
                TxtPosition.Enabled      = true;
                TxtEmpEmail.Enabled      = true;
                TxtDerivativeEmp.Enabled = true;
                TxtAccountNo.Enabled     = true;
                BtnSave.Visible          = false;
                BtnUpdate.Visible        = true;
                break;

            case ModeForm.ViewData:
                RefreshGrid();
                PanelGrid.Visible  = true;
                PanelInput.Visible = false;
                break;

            case ModeForm.DetailData:
                GenerateDerivative();
                GenerateAccount();
                PanelInput.Visible       = true;
                PanelGrid.Visible        = false;
                TxtEmployeeName.Enabled  = false;
                TxtPosition.Enabled      = false;
                TxtEmpEmail.Enabled      = false;
                TxtDerivativeEmp.Enabled = false;
                TxtAccountNo.Enabled     = false;
                BtnSave.Visible          = false;
                BtnUpdate.Visible        = false;
                break;
            }
        }
Example #5
0
        //set layout
        private void Setlayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.updatedata:
                break;

            case ModeForm.viewdata:
                break;
            }
        }
Example #6
0
        static void Main(string[] args)
        {
            string     mode;
            Controller controller = null;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (args.Length == 1)
            {
                mode = args[0];
            }
            else
            {
                var modeForm = new ModeForm();

                if (modeForm.ShowDialog() == DialogResult.OK)
                {
                    mode = modeForm.Mode;
                }
                else
                {
                    return;
                }
            }

            switch (mode)
            {
            case "play":
                controller = new BotController();
                break;

            case "colossus":
                controller = new ColossusController();
                break;

            case "explore":
                controller = new ExploreController();
                break;

            default:
                MessageBox.Show($@"Unknown mode ""{args[0]}"".");
                break;
            }

            if (controller != null)
            {
                var form = new MainForm();
                form.Controller = controller;
                Application.AddMessageFilter(form);
                Application.Run(form);
            }
        }
        //protected void ActionImageButton(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        var btn = sender as ImageButton;
        //        var command = btn.CommandName;

        //        switch (command)
        //        {
        //            case "search":
        //                var param = (TxtSearch.Text).Trim();
        //                RefreshGrid(param);
        //                break;

        //            case "refresh":
        //                TxtSearch.Text = "";
        //                RefreshGrid();
        //                break;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        Alert("Terjadi Kesalahan");
        //    }
        //}

        // Change layout
        private void SetLayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.AddData:
                GenerateAnalysisTypeName();
                GenerateComodity();
                ClearFields();
                PanelGrid.Visible           = false;
                PanelInput.Visible          = true;
                BtnUpdate.Visible           = false;
                BtnSave.Visible             = true;
                TxtElementCode.Enabled      = true;
                TxtAnalysisTypeName.Enabled = true;
                TxtServiceGroup.Enabled     = true;
                TxtServiceRate.Enabled      = true;
                TxtServiceStatus.Enabled    = true;
                break;

            case ModeForm.UpdateData:
                GenerateAnalysisTypeName();
                GenerateComodity();
                PanelGrid.Visible           = false;
                PanelInput.Visible          = true;
                TxtElementCode.Enabled      = false;
                TxtAnalysisTypeName.Enabled = true;
                TxtServiceGroup.Enabled     = true;
                TxtServiceRate.Enabled      = true;
                TxtServiceStatus.Enabled    = true;
                BtnSave.Visible             = false;
                BtnUpdate.Visible           = true;
                break;

            case ModeForm.ViewData:
                RefreshGrid();
                PanelGrid.Visible  = true;
                PanelInput.Visible = false;
                break;

            case ModeForm.DetailData:
                GenerateAnalysisTypeName();
                PanelInput.Visible          = true;
                PanelGrid.Visible           = false;
                TxtElementCode.Enabled      = false;
                TxtAnalysisTypeName.Enabled = false;
                TxtServiceGroup.Enabled     = false;
                TxtServiceRate.Enabled      = false;
                TxtServiceStatus.Enabled    = false;
                BtnSave.Visible             = false;
                BtnUpdate.Visible           = false;
                break;
            }
        }
        //protected void ActionImageButton(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        var btn = sender as ImageButton;
        //        var command = btn.CommandName;

        //        switch (command)
        //        {
        //            case "search":
        //                var param = (TxtSearch.Text).Trim();
        //                RefreshGrid(param);
        //                break;

        //            case "refresh":
        //                TxtSearch.Text = "";
        //                RefreshGrid();
        //                break;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        Alert("Terjadi Kesalahan");
        //    }
        //}

        // Change layout
        private void SetLayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.AddData:
                GenerateDerivative();
                ClearFields();
                PanelGrid.Visible       = false;
                PanelInput.Visible      = true;
                BtnUpdate.Visible       = false;
                BtnSave.Visible         = true;
                TxtComodityNo.Text      = "Otomatis";
                TxtComodityName.Enabled = true;
                TxtDerivativeTo.Enabled = true;
                TxtDescription.Enabled  = true;
                break;

            case ModeForm.UpdateData:
                GenerateDerivative();
                PanelGrid.Visible       = false;
                PanelInput.Visible      = true;
                TxtComodityName.Enabled = true;
                TxtDerivativeTo.Enabled = true;
                TxtDescription.Enabled  = true;
                BtnSave.Visible         = false;
                BtnUpdate.Visible       = true;
                break;

            case ModeForm.ViewData:
                RefreshGrid();
                PanelGrid.Visible  = true;
                PanelInput.Visible = false;
                break;

            case ModeForm.DetailData:
                GenerateDerivative();
                PanelInput.Visible      = true;
                PanelGrid.Visible       = false;
                TxtComodityName.Enabled = false;
                TxtDerivativeTo.Enabled = false;
                TxtDescription.Enabled  = false;
                BtnSave.Visible         = false;
                BtnUpdate.Visible       = false;
                break;
            }
        }
Example #9
0
        //protected void ActionImageButton(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        var btn = sender as ImageButton;
        //        var command = btn.CommandName;

        //        switch (command)
        //        {
        //            case "search":
        //                var param = (TxtSearch.Text).Trim();
        //                RefreshGrid(param);
        //                break;

        //            case "refresh":
        //                TxtSearch.Text = "";
        //                RefreshGrid();
        //                break;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        Alert("Terjadi Kesalahan");
        //    }
        //}

        // Change layout
        private void SetLayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.AddData:
                GenerateRole();
                ClearFields();
                PanelGrid.Visible   = false;
                PanelInput.Visible  = true;
                BtnUpdate.Visible   = false;
                BtnSave.Visible     = true;
                TxtAccountNo.Text   = "Otomatis";
                TxtUsername.Enabled = true;
                TxtPassword.Enabled = true;
                TxtRoleName.Enabled = true;
                break;

            case ModeForm.UpdateData:
                GenerateRole();
                PanelGrid.Visible   = false;
                PanelInput.Visible  = true;
                TxtUsername.Enabled = false;
                TxtPassword.Enabled = true;
                TxtRoleName.Enabled = true;
                BtnSave.Visible     = false;
                BtnUpdate.Visible   = true;
                break;

            case ModeForm.ViewData:
                RefreshGrid();
                PanelGrid.Visible  = true;
                PanelInput.Visible = false;
                break;

            case ModeForm.DetailData:
                GenerateRole();
                PanelInput.Visible  = true;
                PanelGrid.Visible   = false;
                TxtUsername.Enabled = false;
                TxtPassword.Enabled = false;
                TxtRoleName.Enabled = false;
                BtnSave.Visible     = false;
                BtnUpdate.Visible   = false;
                break;
            }
        }
        //protected void ActionImageButton(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        var btn = sender as ImageButton;
        //        var command = btn.CommandName;

        //        switch (command)
        //        {
        //            case "search":
        //                var param = (TxtSearch.Text).Trim();
        //                RefreshGrid(param);
        //                break;

        //            case "refresh":
        //                TxtSearch.Text = "";
        //                RefreshGrid();
        //                break;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        Alert("Terjadi Kesalahan");
        //    }
        //}

        // Change layout
        private void SetLayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.AddData:
                GenerateStandarsId();
                GenerateElementCode();
                ClearFields();
                PanelGrid.Visible      = false;
                PanelInput.Visible     = true;
                BtnUpdate.Visible      = false;
                BtnSave.Visible        = true;
                TxtStdId.Enabled       = true;
                TxtElementCode.Enabled = true;
                break;

            case ModeForm.UpdateData:
                GenerateStandarsId();
                GenerateElementCode();
                PanelGrid.Visible      = false;
                PanelInput.Visible     = true;
                TxtStdId.Enabled       = true;
                TxtElementCode.Enabled = true;
                BtnSave.Visible        = false;
                BtnUpdate.Visible      = true;
                break;

            case ModeForm.ViewData:
                RefreshGrid();
                PanelGrid.Visible  = true;
                PanelInput.Visible = false;
                break;

            case ModeForm.DetailData:
                GenerateStandarsId();
                GenerateElementCode();
                PanelInput.Visible     = true;
                PanelGrid.Visible      = false;
                TxtStdId.Enabled       = false;
                TxtElementCode.Enabled = false;
                BtnSave.Visible        = false;
                BtnUpdate.Visible      = false;
                break;
            }
        }
        private void SetLayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.AddToAccountTable:
                BtnDaftar.Visible       = true;
                txtusername.Enabled     = true;
                txtphone.Enabled        = true;
                txtcompanyname.Enabled  = true;
                txtaddress.Enabled      = true;
                txtemail.Enabled        = true;
                txtemail.Enabled        = true;
                txtcompanyemail.Enabled = true;
                txtpassword.Enabled     = true;

                break;
            }
        }
Example #12
0
        private void SetLayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.DetailData:
                RefreshGrid();
                PanelGrid.Visible = false;
                DTOrder.Visible   = true;
                break;

            case ModeForm.ViewData:
                RefreshGrid();

                PanelGrid.Visible = true;
                DTOrder.Visible   = false;
                break;
            }
        }
        private void SetLayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.DetailData:
                RefreshGrid();
                PanelGrid.Visible = false;
                DTOrder.Visible   = true;
                break;

            case ModeForm.ProsesData:
                PanelGrid.Visible       = false;
                DTOrder.Visible         = false;
                PanelOrderMasuk.Visible = false;
                PanelPIC.Visible        = true;
                break;
            }
        }
Example #14
0
        //protected void ActionImageButton(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        var btn = sender as ImageButton;
        //        var command = btn.CommandName;

        //        switch (command)
        //        {
        //            case "search":
        //                var param = (TxtSearch.Text).Trim();
        //                RefreshGrid(param);
        //                break;

        //            case "refresh":
        //                TxtSearch.Text = "";
        //                RefreshGrid();
        //                break;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        Alert("Terjadi Kesalahan");
        //    }
        //}

        // Change layout
        private void SetLayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.AddData:
                GenerateComodity();
                ClearFields();
                PanelGrid.Visible     = false;
                PanelInput.Visible    = true;
                BtnUpdate.Visible     = false;
                BtnSave.Visible       = true;
                TxtStdNo.Enabled      = true;
                TxtComodityNo.Enabled = true;
                break;

            case ModeForm.UpdateData:
                GenerateComodity();
                PanelGrid.Visible     = false;
                PanelInput.Visible    = true;
                TxtStdNo.Enabled      = true;
                TxtComodityNo.Enabled = true;
                BtnSave.Visible       = false;
                BtnUpdate.Visible     = true;
                break;

            case ModeForm.ViewData:
                RefreshGrid();
                PanelGrid.Visible  = true;
                PanelInput.Visible = false;
                break;

            case ModeForm.DetailData:
                GenerateComodity();
                PanelInput.Visible    = true;
                PanelGrid.Visible     = false;
                TxtStdNo.Enabled      = false;
                TxtComodityNo.Enabled = false;
                BtnSave.Visible       = false;
                BtnUpdate.Visible     = false;
                break;
            }
        }
Example #15
0
        //protected void ActionImageButton(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        var btn = sender as ImageButton;
        //        var command = btn.CommandName;

        //        switch (command)
        //        {
        //            case "search":
        //                var param = (TxtSearch.Text).Trim();
        //                RefreshGrid(param);
        //                break;

        //            case "refresh":
        //                TxtSearch.Text = "";
        //                RefreshGrid();
        //                break;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        Alert("Terjadi Kesalahan");
        //    }
        //}

        // Change layout
        private void SetLayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.AddData:
                ClearFields();
                PanelGrid.Visible      = false;
                PanelInput.Visible     = true;
                BtnUpdate.Visible      = false;
                BtnSave.Visible        = true;
                TxtRoleName.Enabled    = true;
                TxtDescription.Enabled = true;
                break;

            case ModeForm.UpdateData:
                PanelGrid.Visible      = false;
                PanelInput.Visible     = true;
                TxtRoleName.Enabled    = false;
                TxtDescription.Enabled = true;
                BtnSave.Visible        = false;
                BtnUpdate.Visible      = true;
                break;

            case ModeForm.ViewData:
                RefreshGrid();
                PanelGrid.Visible  = true;
                PanelInput.Visible = false;
                break;

            case ModeForm.DetailData:
                PanelInput.Visible     = true;
                PanelGrid.Visible      = false;
                TxtRoleName.Enabled    = false;
                TxtDescription.Enabled = false;
                BtnSave.Visible        = false;
                BtnUpdate.Visible      = false;
                break;
            }
        }
Example #16
0
        void SetLayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.EditData:
                PanelGrid.Visible  = false;
                PanelInput.Visible = true;
                BtnSubmit.Visible  = true;
                break;

            case ModeForm.LihatData:
                PanelGrid.Visible  = false;
                PanelInput.Visible = true;
                BtnSubmit.Visible  = false;
                break;

            case ModeForm.ViewGrid:
                PanelGrid.Visible  = true;
                PanelInput.Visible = false;
                break;
            }
        }
        //protected void ActionImageButton(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        var btn = sender as ImageButton;
        //        var command = btn.CommandName;

        //        switch (command)
        //        {
        //            case "search":
        //                var param = (TxtSearch.Text).Trim();
        //                RefreshGrid(param);
        //                break;

        //            case "refresh":
        //                TxtSearch.Text = "";
        //                RefreshGrid();
        //                break;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        Alert("Terjadi Kesalahan");
        //    }
        //}

        // Change layout
        private void SetLayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.AddData:
                ClearFields();
                PanelGrid.Visible  = false;
                PanelInput.Visible = true;
                BtnUpdate.Visible  = false;
                BtnSave.Visible    = true;
                TxtString0.Enabled = true;
                TxtString1.Enabled = true;
                TxtString2.Enabled = true;
                TxtString3.Enabled = true;
                TxtString4.Enabled = true;
                TxtString5.Enabled = true;
                TxtString6.Enabled = true;
                TxtString7.Enabled = true;
                TxtString8.Enabled = true;
                TxtString9.Enabled = true;
                break;

            case ModeForm.UpdateData:
                PanelGrid.Visible  = false;
                PanelInput.Visible = true;
                BtnSave.Visible    = false;
                BtnUpdate.Visible  = true;
                TxtString0.Enabled = true;
                TxtString1.Enabled = true;
                TxtString2.Enabled = true;
                TxtString3.Enabled = true;
                TxtString4.Enabled = true;
                TxtString5.Enabled = true;
                TxtString6.Enabled = true;
                TxtString7.Enabled = true;
                TxtString8.Enabled = true;
                TxtString9.Enabled = true;
                break;

            case ModeForm.ViewData:
                RefreshGrid();
                PanelGrid.Visible  = true;
                PanelInput.Visible = false;
                break;

            case ModeForm.DetailData:
                PanelInput.Visible = true;
                PanelGrid.Visible  = false;
                BtnSave.Visible    = false;
                BtnUpdate.Visible  = false;
                TxtString0.Enabled = false;
                TxtString1.Enabled = false;
                TxtString2.Enabled = false;
                TxtString3.Enabled = false;
                TxtString4.Enabled = false;
                TxtString5.Enabled = false;
                TxtString6.Enabled = false;
                TxtString7.Enabled = false;
                TxtString8.Enabled = false;
                TxtString9.Enabled = false;
                break;
            }
        }
        //protected void ActionImageButton(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        var btn = sender as ImageButton;
        //        var command = btn.CommandName;

        //        switch (command)
        //        {
        //            case "search":
        //                var param = (TxtSearch.Text).Trim();
        //                RefreshGrid(param);
        //                break;

        //            case "refresh":
        //                TxtSearch.Text = "";
        //                RefreshGrid();
        //                break;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        Alert("Terjadi Kesalahan");
        //    }
        //}

        // Change layout
        private void SetLayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.AddData:
                GeneratePic();
                GenerateElement();
                GenerateOrder();
                GenerateParameter();
                ClearFields();
                PanelGrid.Visible       = false;
                PanelInput.Visible      = true;
                BtnUpdate.Visible       = false;
                BtnSave.Visible         = true;
                TxtOrderDetailNo.Text   = "Otomatis";
                TxtOrderNo.Enabled      = true;
                TxtSampleNo.Enabled     = true;
                TxtElementCode.Enabled  = true;
                TxtParametersNo.Enabled = true;
                TxtElementValue.Enabled = true;
                TxtStatus.Enabled       = true;
                TxtRecalculate.Enabled  = true;
                TxtPic.Enabled          = true;
                break;

            case ModeForm.UpdateData:
                GeneratePic();
                GeneratePic();
                GenerateElement();
                GenerateOrder();
                GenerateParameter();
                PanelGrid.Visible       = false;
                PanelInput.Visible      = true;
                BtnSave.Visible         = false;
                BtnUpdate.Visible       = true;
                TxtOrderNo.Enabled      = true;
                TxtSampleNo.Enabled     = true;
                TxtElementCode.Enabled  = true;
                TxtParametersNo.Enabled = true;
                TxtElementValue.Enabled = true;
                TxtStatus.Enabled       = true;
                TxtRecalculate.Enabled  = true;
                TxtPic.Enabled          = true;
                break;

            case ModeForm.ViewData:
                RefreshGrid();
                PanelGrid.Visible  = true;
                PanelInput.Visible = false;
                break;

            case ModeForm.DetailData:
                GeneratePic();
                GeneratePic();
                GenerateElement();
                GenerateOrder();
                GenerateParameter();
                PanelInput.Visible      = true;
                PanelGrid.Visible       = false;
                BtnSave.Visible         = false;
                BtnUpdate.Visible       = false;
                TxtOrderNo.Enabled      = false;
                TxtSampleNo.Enabled     = false;
                TxtElementCode.Enabled  = false;
                TxtParametersNo.Enabled = false;
                TxtElementValue.Enabled = false;
                TxtStatus.Enabled       = false;
                TxtRecalculate.Enabled  = false;
                TxtPic.Enabled          = false;
                break;
            }
        }
        //protected void ActionImageButton(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        var btn = sender as ImageButton;
        //        var command = btn.CommandName;

        //        switch (command)
        //        {
        //            case "search":
        //                var param = (TxtSearch.Text).Trim();
        //                RefreshGrid(param);
        //                break;

        //            case "refresh":
        //                TxtSearch.Text = "";
        //                RefreshGrid();
        //                break;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        Alert("Terjadi Kesalahan");
        //    }
        //}

        // Change layout
        private void SetLayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.AddData:
                GeneratePic();
                ClearFields();
                PanelGrid.Visible       = false;
                PanelInput.Visible      = true;
                BtnUpdate.Visible       = false;
                BtnSave.Visible         = true;
                TxtNoBalittanah.Text    = "Otomatis";
                TxtOrderNo.Enabled      = true;
                TxtSampleCode.Enabled   = true;
                TxtDescription.Enabled  = true;
                TxtSamplingDate.Enabled = true;
                TxtVillage.Enabled      = true;
                TxtSubDistrict.Enabled  = true;
                TxtDistrict.Enabled     = true;
                TxtProvince.Enabled     = true;
                TxtGps.Enabled          = true;
                TxtIsReceived.Enabled   = true;
                TxtCountNumber.Enabled  = true;
                TxtLandUSe.Enabled      = true;
                BtnAdd.Visible          = true;
                BtnUpdate.Visible       = false;
                break;

            case ModeForm.UpdateData:
                GeneratePic();
                PanelGrid.Visible       = false;
                PanelInput.Visible      = true;
                TxtOrderNo.Enabled      = true;
                TxtSampleCode.Enabled   = true;
                TxtDescription.Enabled  = true;
                TxtSamplingDate.Enabled = true;
                TxtVillage.Enabled      = true;
                TxtSubDistrict.Enabled  = true;
                TxtDistrict.Enabled     = true;
                TxtProvince.Enabled     = true;
                TxtGps.Enabled          = true;
                TxtIsReceived.Enabled   = true;
                TxtCountNumber.Enabled  = true;
                TxtLandUSe.Enabled      = true;
                BtnSave.Visible         = false;
                BtnUpdate.Visible       = true;
                break;

            case ModeForm.ViewData:
                RefreshGrid();
                PanelGrid.Visible  = true;
                PanelInput.Visible = false;
                break;

            case ModeForm.DetailData:
                GeneratePic();
                PanelInput.Visible      = true;
                PanelGrid.Visible       = false;
                TxtOrderNo.Enabled      = false;
                TxtSampleCode.Enabled   = false;
                TxtDescription.Enabled  = false;
                TxtSamplingDate.Enabled = false;
                TxtVillage.Enabled      = false;
                TxtSubDistrict.Enabled  = false;
                TxtDistrict.Enabled     = false;
                TxtProvince.Enabled     = false;
                TxtGps.Enabled          = false;
                TxtIsReceived.Enabled   = false;
                TxtCountNumber.Enabled  = false;
                TxtLandUSe.Enabled      = false;
                BtnSave.Visible         = false;
                BtnUpdate.Visible       = false;
                break;
            }
        }
Example #20
0
        private void SetLayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.AddData:
                GenerateCustNo();
                GenerateComdNo();
                GeneratePIC();
                ClearFields();
                PanelGrid.Visible      = false;
                PanelInput.Visible     = true;
                BtnUpdate.Visible      = false;
                BtnSave.Visible        = true;
                TxtOrderNo.Enabled     = true;
                DDLCustomerno.Enabled  = true;
                DDLComodityNo.Enabled  = true;
                TxtTotalSample.Enabled = true;
                TxtPriceTotal.Enabled  = true;
                TxtStatus.Enabled      = true;
                TxtTipePayment.Enabled = true;
                DDLPayed.Enabled       = true;
                TxtPayedDate.Enabled   = true;
                TxtAppr.Enabled        = true;
                DDLPIC.Enabled         = true;
                break;

            case ModeForm.EditData:
                GenerateCustNo();
                GenerateComdNo();
                GeneratePIC();
                PanelGrid.Visible      = false;
                PanelInput.Visible     = true;
                TxtOrderNo.Enabled     = true;
                DDLCustomerno.Enabled  = true;
                DDLComodityNo.Enabled  = true;
                TxtTotalSample.Enabled = true;
                TxtPriceTotal.Enabled  = true;
                TxtStatus.Enabled      = true;
                TxtTipePayment.Enabled = true;
                DDLPayed.Enabled       = true;
                TxtPayedDate.Enabled   = true;
                TxtAppr.Enabled        = true;
                DDLPIC.Enabled         = true;
                BtnSave.Visible        = false;
                BtnUpdate.Visible      = true;
                break;

            case ModeForm.ViewData:
                RefreshGrid();
                PanelGrid.Visible  = true;
                PanelInput.Visible = false;
                break;

            case ModeForm.DetailData:
                GenerateCustNo();
                GenerateComdNo();
                GeneratePIC();
                PanelInput.Visible     = true;
                PanelGrid.Visible      = false;
                TxtOrderNo.Enabled     = true;
                DDLCustomerno.Enabled  = true;
                DDLComodityNo.Enabled  = true;
                TxtTotalSample.Enabled = true;
                TxtPriceTotal.Enabled  = true;
                TxtStatus.Enabled      = true;
                TxtTipePayment.Enabled = true;
                DDLPayed.Enabled       = true;
                TxtPayedDate.Enabled   = true;
                TxtAppr.Enabled        = true;
                DDLPIC.Enabled         = true;
                BtnSave.Visible        = false;
                BtnUpdate.Visible      = false;
                break;
            }
        }
        //protected void ActionImageButton(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        var btn = sender as ImageButton;
        //        var command = btn.CommandName;

        //        switch (command)
        //        {
        //            case "search":
        //                var param = (TxtSearch.Text).Trim();
        //                RefreshGrid(param);
        //                break;

        //            case "refresh":
        //                TxtSearch.Text = "";
        //                RefreshGrid();
        //                break;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        Alert("Terjadi Kesalahan");
        //    }
        //}

        // Change layout
        private void SetLayout(ModeForm mode)
        {
            switch (mode)
            {
            case ModeForm.AddData:
                GeneratePic();
                GenerateCom();
                GenerateCus();
                ClearFields();
                PanelGrid.Visible      = false;
                PanelInput.Visible     = true;
                BtnUpdate.Visible      = false;
                BtnSave.Visible        = true;
                TxtOrderNo.Text        = "Otomatis";
                TxtCustomerNo.Enabled  = true;
                TxtComodityNo.Enabled  = true;
                TxtSampleTotal.Enabled = true;
                TxtPriceTotal.Enabled  = true;
                TxtStatus.Enabled      = true;
                TxtIsApprove.Enabled   = true;
                TxtIsPayed.Enabled     = true;
                break;

            case ModeForm.UpdateData:
                GeneratePic();
                GenerateCom();
                GenerateCus();
                PanelGrid.Visible      = false;
                PanelInput.Visible     = true;
                TxtCustomerNo.Enabled  = true;
                TxtComodityNo.Enabled  = true;
                TxtSampleTotal.Enabled = true;
                TxtPriceTotal.Enabled  = true;
                TxtStatus.Enabled      = true;
                TxtIsApprove.Enabled   = true;
                TxtIsPayed.Enabled     = true;
                BtnSave.Visible        = false;
                BtnUpdate.Visible      = true;
                break;

            case ModeForm.ViewData:
                RefreshGrid();
                PanelGrid.Visible  = true;
                PanelInput.Visible = false;
                break;

            case ModeForm.DetailData:
                GeneratePic();
                GenerateCom();
                GenerateCus();
                PanelInput.Visible     = true;
                PanelGrid.Visible      = false;
                TxtCustomerNo.Enabled  = false;
                TxtComodityNo.Enabled  = false;
                TxtSampleTotal.Enabled = false;
                TxtPriceTotal.Enabled  = false;
                TxtStatus.Enabled      = false;
                TxtIsApprove.Enabled   = false;
                TxtIsPayed.Enabled     = false;
                BtnSave.Visible        = false;
                BtnUpdate.Visible      = false;
                break;
            }
        }