Beispiel #1
0
        public User.ICopPermision Login(bool isStart)
        {
            User.ICopPermision permision = User.ICopPermision.None;
            IcopLogin          icopLogin = new IcopLogin(isStart);

            icopLogin.ShowDialog();
            if (icopLogin.DialogResult == DialogResult.OK)
            {
                permision = icopLogin.permision;
                activeAcc = icopLogin.Acc;
                switch (permision)
                {
                case User.ICopPermision.None:
                    break;

                case User.ICopPermision.OP:
                    break;

                case User.ICopPermision.Technical:
                    TE_Acc = icopLogin.Acc;
                    break;

                case User.ICopPermision.Master:
                    MT_Acc = icopLogin.Acc;
                    break;

                default:
                    break;
                }
            }
            return(permision);
        }
Beispiel #2
0
 public ModelForm(string pathToProgram, User.Account user)
 {
     InitializeComponent();
     this.AcceptButton  = btApplyStep;
     this.ActiveControl = tbName;
     this.pathToProgram = pathToProgram;
     this.GetUser       = user;
 }
Beispiel #3
0
 public ModelWizar(User.Account user)
 {
     InitializeComponent();
     this.AcceptButton  = btOK;
     this.user          = user;
     lbUserCreater.Text =
         "Creater: " + user.userName + Environment.NewLine +
         "Permission : " + user.Permission.ToString();
 }
Beispiel #4
0
 private void cbbAcc_SelectedIndexChanged(object sender, EventArgs e)
 {
     Acc.userName = cbbAcc.Text;
     for (int i = 0; i < Global.users.accList.Count; i++)
     {
         if (Acc.userName == Global.users.accList[i].userName)
         {
             Acc = Global.users.accList[i];
         }
     }
 }
Beispiel #5
0
        public void SaveTextReport(DateTime dateTime, User.Account OP)
        {
            for (int i = 0; i < this.PBA_Count; i++)
            {
                string PCB_report_name = dateTime.ToString("HHmmss") + "_" + modelSteps[i].Value + "_" + (i + 1) + "_" + this.result;

                if (modelSteps[i].Result == Global.ICOP_tester_NG)
                {
                    PCB_report_name = dateTime.ToString("HHmmss") + "_" + "No-QR" + "_" + (i + 1) + "_" + this.result;
                }

                ModelProgram modelReport = new ModelProgram("Report")
                {
                    AccCreater         = this.AccCreater,
                    ACCPass            = "******",
                    ModelName          = this.ModelName,
                    PCB_Code           = this.PCB_Code,
                    MotherFolder       = this.MotherFolder,
                    ModelImagePathCam0 = this.ModelImagePathCam0,
                    ModelImagePathCam1 = this.ModelImagePathCam1,
                    ModelImagePathCam2 = this.ModelImagePathCam2,
                    ModelImagePathCam3 = this.ModelImagePathCam3,
                    ModelImageResult   = this.ModelImageResult,
                    PBA_Count          = this.PBA_Count,
                    result             = this.result,
                };

                if (this.result == Global.ICOP_tester_OP_PASS)
                {
                    modelReport.ACCPass = OP.userName;
                }

                for (int stepCount = 0; stepCount < this.modelSteps.Count; stepCount++)
                {
                    if (modelSteps[stepCount].PBA == i + 1)
                    {
                        modelReport.modelSteps.Add(this.modelSteps[stepCount]);
                    }
                }
                var options = new JsonSerializerOptions
                {
                    WriteIndented = true
                };
                string ModelJson = JsonSerializer.Serialize(modelReport, options);
                File.WriteAllText(Global.ICOP_history_path + PCB_report_name + ".ihf", ModelJson);
            }
        }