示例#1
0
 private void CaseChange(CASE temp)
 {
     if (NowCase == CASE.polygon && temp != CASE.polygon)
     {
         pn.FinishDraw = true;
         OperaStep.AddStep(pn);
         RefreshPictureBox();
         pn = null;
     }
     else if (NowCase == CASE.Bezier && temp != CASE.Bezier)
     {
         bz.FinishDraw = true;
         OperaStep.AddStep(bz);
         RefreshPictureBox();
         bz = null;
     }
     else if (NowCase == CASE.Bsplines && temp != CASE.Bsplines)
     {
         bs.FinishDraw = true;
         OperaStep.AddStep(bs);
         RefreshPictureBox();
         bs = null;
     }
     NowCase = temp;
 }
示例#2
0
 private void InitForm1()
 {
     color    = Color.Black;
     now_case = CASE.no_operation;
     x1       = y1 = 0;
     button_color.BackColor = color;
     mouse_down             = is_back = false;
     bh = BREATH.ss;
     pictureBox.Image = new Bitmap(pictureBox.Width, pictureBox.Height);
     Step.InitStep((Image)pictureBox.Image.Clone());
 }
示例#3
0
        private string getNewChars(int x1, int y1, int x2, int y2, bool encryption)
        {
            CASE   charsCase      = this.getCase(x1, y1, x2, y2);
            string encryptedChars = "";

            if (encryption)
            {
                switch (charsCase)
                {
                case CASE.ROW:
                    encryptedChars += this.keyMatrix[x1, y1 % 4 == 0 ? y1 == 0 ? y1 += 1 : y1 = 0 : y1 = (y1 % 4) + 1];     //y1 = (y1 + 1) % 5 :D
                    encryptedChars += this.keyMatrix[x2, y2 % 4 == 0 ? y2 == 0 ? y2 += 1 : y2 = 0 : y2 = (y2 % 4) + 1];     // y2 = (y2 + 1) % 5 :D
                    break;

                case CASE.COLUMN:
                    encryptedChars += this.keyMatrix[x1 % 4 == 0 ? x1 == 0 ? x1 += 1 : x1 = 0 : x1 = (x1 % 4) + 1, y1];     //
                    encryptedChars += this.keyMatrix[x2 % 4 == 0 ? x2 == 0 ? x2 += 1 : x2 = 0 : x2 = (x2 % 4) + 1, y2];
                    break;

                case CASE.RECTANGLE:
                    encryptedChars += this.keyMatrix[x1, y2];
                    encryptedChars += this.keyMatrix[x2, y1];
                    break;
                }
            }

            else
            {
                switch (charsCase)
                {
                case CASE.ROW:
                    encryptedChars += this.keyMatrix[x1, y1 % 4 == 0 ? y1 == 0 ? y1 = 4 : y1 = 0 : y1 = (y1 % 4) - 1];     //y1 = (y1 + 1) % 5 :D
                    encryptedChars += this.keyMatrix[x2, y2 % 4 == 0 ? y2 == 0 ? y2 = 4 : y2 = 0 : y2 = (y2 % 4) - 1];     // y2 = (y2 + 1) % 5 :D
                    break;

                case CASE.COLUMN:
                    encryptedChars += this.keyMatrix[x1 % 4 == 0 ? x1 == 0 ? x1 = 4 : x1 = 0 : x1 = (x1 % 4) - 1, y1];     //
                    encryptedChars += this.keyMatrix[x2 % 4 == 0 ? x2 == 0 ? x2 = 4 : x2 = 0 : x2 = (x2 % 4) - 1, y2];
                    break;

                case CASE.RECTANGLE:
                    encryptedChars += this.keyMatrix[x1, y2];
                    encryptedChars += this.keyMatrix[x2, y1];
                    break;
                }
            }

            return(encryptedChars);
        }
示例#4
0
        protected override void Visit_CASE(CASE node)
        {
            GNode gnode = new GNode(node, last, this);
            GNode next  = new GNode(null, null, this);

            for (int i = 0; i < node.Cases.Length; i++)
            {
                last = gnode;
                Visit(node.Cases[i]);
                if (last != null)
                {
                    last.successors.AddLast(next);
                }
            }
            last = next;
        }
示例#5
0
        private void InitForm1()
        {
            color   = Color.Black;
            NowCase = CASE.NoOperation;
            x0      = y0 = x1 = y1 = x2 = y2 = 0;
            button_color.BackColor = color;
            IsMouseDown            = IsBack = false;
            bh = BREATH.ss;
            Bitmap   b  = new Bitmap(pictureBox.Width, pictureBox.Height);                             //新建位图b1
            Graphics g1 = Graphics.FromImage(b);                                                       //创建b1的Graphics

            g1.FillRectangle(Brushes.White, new Rectangle(0, 0, pictureBox.Width, pictureBox.Height)); //把b1涂成红色
            pictureBox.Image = b;
            Backgroud        = (Image)b.Clone();
            selectedShape    = null;
            Shape.SetMouseEvent(SelectedShapeSize_MouseUp, SelectedShapeSize_MouseDown, SelectedShapeSize_MouseMove);
            pn = null;
            button3D.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
        }
示例#6
0
 protected override void Visit_CASE(CASE node)
 {
     /* MOVE CODE HERE */
 }
示例#7
0
        public CASE ModificationQuery(int?SN, string UserId)
        {
            DbConnection  conn   = null;
            DbTransaction trans  = null;
            DbCommand     cmd    = null;
            string        sql    = null;
            CASE          master = null;

            try
            {
                conn = Db.CreateConnection();
                conn.Open();

                #region CASE_OWNER
                sql             = @"
SELECT SN,NAME1,NAME2,NAME3,NAME4,NAME5,NAME6,TEL1,TEL2,TEL3,TEL4,TEL5,TEL6,YEARS_OLD,ADDRESS,TEACHER1,TEACHER2,TEACHER3,FAMILY,FAMILY_FILE,RESIDENCE,NOTE,PROBLEM,EXPERIENCE,SUGGEST,MERGE_REASON,CDATE,CUSER,MDATE,MUSER
    FROM CASE_OWNER
    WHERE SN=@SN
";
                cmd             = conn.CreateCommand();
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = sql;
                Db.AddInParameter(cmd, "SN", DbType.Int32, SN);
                using (IDataReader reader = Db.ExecuteReader(cmd))
                {
                    while (reader.Read())
                    {
                        master = new CASE
                        {
                            SN           = reader["SN"] as int? ?? null,
                            NAME1        = reader["NAME1"] as string,
                            NAME2        = reader["NAME2"] as string,
                            NAME3        = reader["NAME3"] as string,
                            NAME4        = reader["NAME4"] as string,
                            NAME5        = reader["NAME5"] as string,
                            NAME6        = reader["NAME6"] as string,
                            TEL1         = reader["TEL1"] as string,
                            TEL2         = reader["TEL2"] as string,
                            TEL3         = reader["TEL3"] as string,
                            TEL4         = reader["TEL4"] as string,
                            TEL5         = reader["TEL5"] as string,
                            TEL6         = reader["TEL6"] as string,
                            YEARS_OLD    = reader["YEARS_OLD"] as string,
                            ADDRESS      = reader["ADDRESS"] as string,
                            TEACHER1     = reader["TEACHER1"] as string,
                            TEACHER2     = reader["TEACHER2"] as string,
                            TEACHER3     = reader["TEACHER3"] as string,
                            FAMILY       = reader["FAMILY"] as string,
                            FAMILY_FILE  = reader["FAMILY_FILE"] as string,
                            RESIDENCE    = reader["RESIDENCE"] as string,
                            NOTE         = reader["NOTE"] as string,
                            PROBLEM      = reader["PROBLEM"] as string,
                            EXPERIENCE   = reader["EXPERIENCE"] as string,
                            SUGGEST      = reader["SUGGEST"] as string,
                            MERGE_REASON = reader["MERGE_REASON"] as string,
                            CDATE        = reader["CDATE"] as DateTime?,
                            CUSER        = reader["CUSER"] as string,
                            MDATE        = reader["MDATE"] as DateTime?,
                            MUSER        = reader["MUSER"] as string
                        };
                    }
                }
                #endregion

                #region INTERVIEW
                List <CASE_DETAIL> detail = new List <CASE_DETAIL>();
                sql             = @"
SELECT SN,CASE_SN,VOLUNTEER_SN,INCOMING_DATE,DURING,CASE_NO,NAME,TEL,CONTACT_TIME,TREATMENT,TREATMENT_MEMO,CASE_SOURCE,CASE_SOURCE_MEMO,GENDER,AGE,EDUCATION,CAREER,CAREER_MEMO,CITY,MARRIAGE,MARRIAGE_MEMO,PHYSIOLOGY,PHYSIOLOGY_MEMO,PSYCHOLOGY,PSYCHOLOGY_MEMO,VISITED,FAMILY,EXPERIENCE,HARASS,SOLVE_DEGREE,FEELING_MEMO,ABOUT_SELF,ABOUT_OTHERS,BEHAVIOR,ADDITION,INNER_DEMAND,INTERVENTION_MEMO,OPINION01,OPINION02,OPINION03,OPINION04,OPINION05,OPINION06,OPINION07,OPINION08,OPINION09,OPINION,CASE_STATUS,CDATE,CUSER,MDATE,MUSER
    FROM INTERVIEW
    WHERE CASE_SN=@CASE_SN AND VOLUNTEER_SN=@VOLUNTEER_SN;
";
                cmd             = conn.CreateCommand();
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = sql;
                Db.AddInParameter(cmd, "CASE_SN", DbType.Int32, SN);
                Db.AddInParameter(cmd, "VOLUNTEER_SN", DbType.String, UserId);

                using (IDataReader reader = Db.ExecuteReader(cmd))
                {
                    while (reader.Read())
                    {
                        CASE_DETAIL interview = new CASE_DETAIL
                        {
                            SN                = reader["SN"] as int? ?? null,
                            VOLUNTEER_SN      = reader["VOLUNTEER_SN"] as string,
                            INCOMING_DATE     = reader["INCOMING_DATE"] as DateTime?,
                            DURING            = reader["DURING"] as Int16? ?? null,
                            CASE_NO           = reader["CASE_NO"] as string,
                            NAME              = reader["NAME"] as string,
                            TEL               = reader["TEL"] as string,
                            CONTACT_TIME      = reader["CONTACT_TIME"] as string,
                            TREATMENT         = reader["TREATMENT"] as string,
                            TREATMENT_MEMO    = reader["TREATMENT_MEMO"] as string,
                            CASE_SOURCE       = reader["CASE_SOURCE"] as string,
                            CASE_SOURCE_MEMO  = reader["CASE_SOURCE_MEMO"] as string,
                            GENDER            = reader["GENDER"] as string,
                            AGE               = reader["AGE"] as string,
                            EDUCATION         = reader["EDUCATION"] as string,
                            CAREER            = reader["CAREER"] as string,
                            CAREER_MEMO       = reader["CAREER_MEMO"] as string,
                            CITY              = reader["CITY"] as string,
                            MARRIAGE          = reader["MARRIAGE"] as string,
                            MARRIAGE_MEMO     = reader["MARRIAGE_MEMO"] as string,
                            PHYSIOLOGY        = reader["PHYSIOLOGY"] as string,
                            PHYSIOLOGY_MEMO   = reader["PHYSIOLOGY_MEMO"] as string,
                            PSYCHOLOGY        = reader["PSYCHOLOGY"] as string,
                            PSYCHOLOGY_MEMO   = reader["PSYCHOLOGY_MEMO"] as string,
                            VISITED           = reader["VISITED"] as string,
                            FAMILY            = reader["FAMILY"] as string,
                            EXPERIENCE        = reader["EXPERIENCE"] as string,
                            HARASS            = reader["HARASS"] as string,
                            SOLVE_DEGREE      = reader["SOLVE_DEGREE"] as string,
                            FEELING_MEMO      = reader["FEELING_MEMO"] as string,
                            ABOUT_SELF        = reader["ABOUT_SELF"] as string,
                            ABOUT_OTHERS      = reader["ABOUT_OTHERS"] as string,
                            BEHAVIOR          = reader["BEHAVIOR"] as string,
                            ADDITION          = reader["ADDITION"] as string,
                            INNER_DEMAND      = reader["INNER_DEMAND"] as string,
                            INTERVENTION_MEMO = reader["INTERVENTION_MEMO"] as string,
                            OPINION01         = reader["OPINION01"] as string,
                            OPINION02         = reader["OPINION02"] as string,
                            OPINION03         = reader["OPINION03"] as string,
                            OPINION04         = reader["OPINION04"] as string,
                            OPINION05         = reader["OPINION05"] as string,
                            OPINION06         = reader["OPINION06"] as string,
                            OPINION07         = reader["OPINION07"] as string,
                            OPINION08         = reader["OPINION08"] as string,
                            OPINION09         = reader["OPINION09"] as string,
                            OPINION           = reader["OPINION"] as string,
                            CASE_STATUS       = reader["CASE_STATUS"] as string,
                            CDATE             = reader["CDATE"] as DateTime?,
                            CUSER             = reader["CUSER"] as string,
                            MDATE             = reader["MDATE"] as DateTime?,
                            MUSER             = reader["MUSER"] as string,
                            DataRow           = "query"
                        };

                        #region SPECIAL_IDENTITY
                        List <SPECIAL_IDENTITY> SPECIAL_IDENTITY = new List <SPECIAL_IDENTITY>();
                        sql             = @"
SELECT SN,INTERVIEW_SN,PHRASE_KEY,MEMO,CDATE,CUSER,MDATE,MUSER,CDATE,CUSER,MDATE,MUSER
    FROM SPECIAL_IDENTITY
    WHERE INTERVIEW_SN=@INTERVIEW_SN
";
                        cmd             = conn.CreateCommand();
                        cmd.CommandType = CommandType.Text;
                        cmd.CommandText = sql;
                        Db.AddInParameter(cmd, "INTERVIEW_SN", DbType.Int32, interview.SN);
                        using (IDataReader reader2 = Db.ExecuteReader(cmd))
                        {
                            while (reader2.Read())
                            {
                                SPECIAL_IDENTITY special_identity = new SPECIAL_IDENTITY
                                {
                                    SN           = reader["SN"] as int? ?? null,
                                    INTERVIEW_SN = reader2["INTERVIEW_SN"] as int? ?? null,
                                    PHRASE_KEY   = reader2["PHRASE_KEY"] as string,
                                    MEMO         = reader2["MEMO"] as string,
                                    CDATE        = reader2["CDATE"] as DateTime?,
                                    CUSER        = reader2["CUSER"] as string,
                                    MDATE        = reader2["MDATE"] as DateTime?,
                                    MUSER        = reader2["MUSER"] as string
                                };
                                SPECIAL_IDENTITY.Add(special_identity);
                            }
                        }
                        interview.SPECIAL_IDENTITY = SPECIAL_IDENTITY.ToArray();
                        #endregion

                        #region INTERVIEW_CLASSIFY
                        List <INTERVIEW_CLASSIFY> INTERVIEW_CLASSIFY = new List <INTERVIEW_CLASSIFY>();
                        sql             = @"
SELECT SN,INTERVIEW_SN,PHRASE_KEY,MEMO,CDATE,CUSER,MDATE,MUSER,CDATE,CUSER,MDATE,MUSER
    FROM INTERVIEW_CLASSIFY
    WHERE INTERVIEW_SN=@INTERVIEW_SN
";
                        cmd             = conn.CreateCommand();
                        cmd.CommandType = CommandType.Text;
                        cmd.CommandText = sql;
                        Db.AddInParameter(cmd, "INTERVIEW_SN", DbType.Int32, interview.SN);
                        using (IDataReader reader2 = Db.ExecuteReader(cmd))
                        {
                            while (reader2.Read())
                            {
                                INTERVIEW_CLASSIFY interview_classify = new INTERVIEW_CLASSIFY
                                {
                                    SN           = reader["SN"] as int? ?? null,
                                    INTERVIEW_SN = reader2["INTERVIEW_SN"] as int? ?? null,
                                    PHRASE_KEY   = reader2["PHRASE_KEY"] as string,
                                    MEMO         = reader2["MEMO"] as string,
                                    CDATE        = reader2["CDATE"] as DateTime?,
                                    CUSER        = reader2["CUSER"] as string,
                                    MDATE        = reader2["MDATE"] as DateTime?,
                                    MUSER        = reader2["MUSER"] as string
                                };
                                INTERVIEW_CLASSIFY.Add(interview_classify);
                            }
                        }
                        interview.INTERVIEW_CLASSIFY = INTERVIEW_CLASSIFY.ToArray();
                        #endregion

                        #region FEELING
                        List <FEELING> FEELING = new List <FEELING>();
                        sql             = @"
SELECT SN,INTERVIEW_SN,PHRASE_KEY,MEMO,CDATE,CUSER,MDATE,MUSER,CDATE,CUSER,MDATE,MUSER
    FROM FEELING
    WHERE INTERVIEW_SN=@INTERVIEW_SN
";
                        cmd             = conn.CreateCommand();
                        cmd.CommandType = CommandType.Text;
                        cmd.CommandText = sql;
                        Db.AddInParameter(cmd, "INTERVIEW_SN", DbType.Int32, interview.SN);
                        using (IDataReader reader2 = Db.ExecuteReader(cmd))
                        {
                            while (reader2.Read())
                            {
                                FEELING feeling = new FEELING
                                {
                                    SN           = reader["SN"] as int? ?? null,
                                    INTERVIEW_SN = reader2["INTERVIEW_SN"] as int? ?? null,
                                    PHRASE_KEY   = reader2["PHRASE_KEY"] as string,
                                    MEMO         = reader2["MEMO"] as string,
                                    CDATE        = reader2["CDATE"] as DateTime?,
                                    CUSER        = reader2["CUSER"] as string,
                                    MDATE        = reader2["MDATE"] as DateTime?,
                                    MUSER        = reader2["MUSER"] as string
                                };
                                FEELING.Add(feeling);
                            }
                        }
                        interview.FEELING = FEELING.ToArray();
                        #endregion

                        #region INTERVENTION
                        List <INTERVENTION> INTERVENTION = new List <INTERVENTION>();
                        sql             = @"
SELECT SN,INTERVIEW_SN,PHRASE_KEY,MEMO,CDATE,CUSER,MDATE,MUSER,CDATE,CUSER,MDATE,MUSER
    FROM INTERVENTION
    WHERE INTERVIEW_SN=@INTERVIEW_SN
";
                        cmd             = conn.CreateCommand();
                        cmd.CommandType = CommandType.Text;
                        cmd.CommandText = sql;
                        Db.AddInParameter(cmd, "INTERVIEW_SN", DbType.Int32, interview.SN);
                        using (IDataReader reader2 = Db.ExecuteReader(cmd))
                        {
                            while (reader2.Read())
                            {
                                INTERVENTION intervention = new INTERVENTION
                                {
                                    SN           = reader["SN"] as int? ?? null,
                                    INTERVIEW_SN = reader2["INTERVIEW_SN"] as int? ?? null,
                                    PHRASE_KEY   = reader2["PHRASE_KEY"] as string,
                                    MEMO         = reader2["MEMO"] as string,
                                    CDATE        = reader2["CDATE"] as DateTime?,
                                    CUSER        = reader2["CUSER"] as string,
                                    MDATE        = reader2["MDATE"] as DateTime?,
                                    MUSER        = reader2["MUSER"] as string
                                };
                                INTERVENTION.Add(intervention);
                            }
                        }
                        interview.INTERVENTION = INTERVENTION.ToArray();
                        #endregion

                        detail.Add(interview);
                    }
                }
                #endregion

                master.CASE_DETAIL = detail.ToArray();
            }
            catch (Exception ex)
            {
                trans.Rollback();
                throw;
            }
            finally
            {
                if (conn.State == ConnectionState.Open)
                {
                    conn.Close();
                }
            }
            return(master);
        }
示例#8
0
 protected virtual void Visit_CASE(CASE node)
 {
 }
示例#9
0
 private void case_push(CASE where)
 {
     this.cases.Add(where);
     this._cases = where;
 }
示例#10
0
 private void case_pop()
 {
     if (this.cases.Count > 0)
     {
         this.cases.RemoveAt(this.cases.Count - 1);
     }
     if (this.cases.Count > 0)
     {
         this._cases = this.cases[this.cases.Count - 1];
     }
     else
     {
         this._cases = CASE.None;
     }
 }
示例#11
0
 private void button_roundness_Click(object sender, EventArgs e)
 {
     now_case = CASE.roundness;
 }
示例#12
0
 private void button_pencil_Click(object sender, EventArgs e)
 {
     now_case = CASE.pencil;
 }
示例#13
0
 private void button_dot_Click(object sender, EventArgs e)//点
 {
     now_case = CASE.dot;
 }
示例#14
0
 private void button_line_Click_1(object sender, EventArgs e)//直线
 {
     now_case = CASE.line;
 }