Пример #1
0
        public void HandleForm2ChangeRecordClick(object sender, EventArgs e)
        {
            System.Windows.Forms.Button button = (System.Windows.Forms.Button)sender;
            Form2 obj = (Form2)button.FindForm();

            recRef = obj.rec;
            if (recRef.Equals(default(Form2.Record)))
            {
                return;
            }
            int index = dbGrid.CurrentCell.RowIndex;

            dbGrid["BeltShape", index].Value      = recRef.BeltShape;
            dbGrid["MachineType", index].Value    = recRef.MachineType;
            dbGrid["LoadPattern", index].Value    = recRef.LoadPattern;
            dbGrid["DriveEngine", index].Value    = recRef.DriveEngine;
            dbGrid["d_p1", index].Value           = recRef.Dp1;
            dbGrid["phi", index].Value            = recRef.Phi;
            dbGrid["u", index].Value              = recRef.U;
            dbGrid["n", index].Value              = recRef.N;
            dbGrid["xi", index].Value             = recRef.Xi;
            dbGrid["v", index].Value              = recRef.V;
            dbGrid["chi", index].Value            = recRef.Chi;
            dbGrid["d_p2", index].Value           = recRef.Dp2;
            dbGrid["s_10", index].Value           = recRef.S10;
            dbGrid["q_10", index].Value           = recRef.Q10;
            dbGrid["l_0", index].Value            = recRef.L0;
            dbGrid["a", index].Value              = recRef.A;
            dbGrid["l", index].Value              = recRef.L;
            dbGrid["a_final", index].Value        = recRef.Afinal;
            dbGrid["l_st", index].Value           = recRef.Lst;
            dbGrid["alpha_1", index].Value        = recRef.Alpha1;
            dbGrid["gamma_1", index].Value        = recRef.Gamma1;
            dbGrid["c_1", index].Value            = recRef.C1;
            dbGrid["c_3", index].Value            = recRef.C3;
            dbGrid["c_l", index].Value            = recRef.CL;
            dbGrid["f", index].Value              = recRef.F;
            dbGrid["sigmaF_0", index].Value       = recRef.SigmaF0;
            dbGrid["delta_sigmaF_i", index].Value = recRef.DeltaSigmaFI;
            dbGrid["delta_sigmaF_0", index].Value = recRef.DeltaSigmaF0;
            dbGrid["sigmaF", index].Value         = recRef.SigmaF;
            dbGrid["z", index].Value              = recRef.Z;
            dbGrid["sigma_0", index].Value        = recRef.Sigma0;
            dbGrid["q_0", index].Value            = recRef.Q0;
            dbGrid["r", index].Value              = recRef.R;
            dbGrid["theta", index].Value          = recRef.Theta;
            toolStripStatusLabel1.Text            = "Изменена запись №" + (index + 1);
        }
Пример #2
0
        public void HandleForm2CreateRecordClick(object sender, EventArgs e)
        {
            System.Windows.Forms.Button button = (System.Windows.Forms.Button)sender;
            Form2 obj = (Form2)button.FindForm();

            recRef = obj.rec;
            if (recRef.Equals(default(Form2.Record)))
            {
                return;
            }
            dbGrid.Rows.Add(dbGrid.Rows.Count + 1, recRef.BeltShape, recRef.MachineType, recRef.LoadPattern, recRef.DriveEngine, recRef.Dp1, recRef.Phi,
                            recRef.U, recRef.N, recRef.Xi, recRef.V, recRef.Chi, recRef.Dp2, recRef.S10, recRef.Q10, recRef.L0, recRef.A, recRef.L,
                            recRef.Afinal, recRef.Lst, recRef.Alpha1, recRef.Gamma1, recRef.C1, recRef.C3, recRef.CL, recRef.F, recRef.SigmaF0,
                            recRef.DeltaSigmaFI, recRef.DeltaSigmaF0, recRef.SigmaF, recRef.Z, recRef.Sigma0, recRef.Q0, recRef.R, recRef.Theta);
            toolStripStatusLabel1.Text = "Добавлена запись №" + dbGrid.Rows.Count;
        }