示例#1
0
        private dynamic IsNotShow(string frmName)
        {
            dynamic returnValue = default(dynamic);

            if (Application.OpenForms[frmName] == null)
            {
                returnValue = true;
            }
            else
            {
                returnValue = false;
            }

            ActiveFrmNme = frmName;

            foreach (Form Fr in Application.OpenForms)
            {
                if (Fr.Name != ActiveFrmNme && Fr.Name != "Frm_Main" && Fr.Name != "Frm_Login" && Fr.Name != "Frm_Dialog")
                {
                    if (Fr.Name == "Frm_Engineering")
                    {
                        PVar.IsSysOnEngineerMode = false;
                    }
                    if (Fr.Name == "Frm_RunInfo" || Fr.Name == "Frm_AlarmInfo" || Fr.Name == "Frm_MachineInfo" || Fr.Name == "Frm_Par" || Fr.Name == "Frm_Par_CCD")
                    {
                        Fr.Close();
                        break;
                    }
                    else if (Fr.Name == "Frm_Engineering")
                    {
                        PVar.IsOpenFrmEngineering            = false;
                        Frm_Engineering.fEngineering.Visible = false;
                    }
                    else if (Fr.Name == "Frm_Production")
                    {
                        Frm_Production.fProduction.Visible = false;
                        PVar.IsOpenFrmProduction           = false;
                    }
                }
            }
            return(returnValue);
        }
示例#2
0
        //  Making a Method to Display in Main
        public void CustomerDisplay()
        {
            StreamWriter In;

            try
            {
                In = File.AppendText("C:\\Users\\RON TAYLOR\\Desktop\\Computer Programing\\Customer_Information.txt");

                Console.WriteLine("please enter  customers number");
                customernumber = int.Parse(Console.ReadLine());
                Console.WriteLine("please enter customers name");
                customername = Console.ReadLine();
                Console.WriteLine("please enter  there address");
                address = Console.ReadLine();
                In.WriteLine(customernumber);
                In.WriteLine(customername);
                In.WriteLine(address);
                In.WriteLine("CUstomer number :{0} Customer name :{1} Customer address :{2}", customernumber, customername, address);
                In.Close();
            }
            catch
            {
                Console.WriteLine(" file not writtten ");
            }

            Console.ReadLine();

            StreamReader Fr;


            Fr          = File.OpenText("C:\\Users\\RON TAYLOR\\Desktop\\Computer Programing\\Customer_Information.txt");
            infodisplay = Fr.ReadLine();
            while (infodisplay != null)
            {
                Console.WriteLine(infodisplay);
                infodisplay = Fr.ReadLine();
            }

            Fr.Close();
        }