Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Control.Control control = new Control.Control();
            string customer_id = control.currentC(mainForm.dbv.dgv);
            if (customer_id != "")
            {
                int affected = control.update(customer_id, this.textBox1.Text, this.textBox2.Text, this.textBox3.Text);
                if (affected == 1)
                {
                    MessageBox.Show("修改成功");
                }
                else
                {
                    MessageBox.Show("修改失败");

                }
            }
            else 
            {
                MessageBox.Show("请选择要修改的用户记录");
 
            
            }
            
        }
Example #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     mainForm.dbv.dgv.DataSource = null;
     bool m_check;
     Control.Control control = new Control.Control();
     Entity.Entity entity = new Entity.Entity();
     entity.setM_Username(this.textBox1.Text);
     entity.setM_Password(this.textBox2.Text);
     m_check = control.checkM_Users(entity.getM_Username(), entity.getM_Password());
     
     if (m_check)
     {
         
         this.Visible = false;
         mainForm main = new mainForm();
         main.ShowDialog();
         this.Close();
     }
     else
     {
         this.textBox1.Text = "";
         this.textBox2.Text = "";
         MessageBox.Show("密码错误或管理员不存在");
     }
      
 }
Example #3
0
 private void toolStripButton1_Click(object sender, EventArgs e)
 {
     string customer_id = Login.dt.Tables[0].Rows[0][0].ToString();
     Control.Control control = new Control.Control();
     dbv.dgv.DataSource =control.getBill(customer_id); 
     dbv.dgv.DataMember = "bill";
 }
Example #4
0
        /// <summary>
        /// Parses the specified message text.
        /// </summary>
        /// <param name="target">The event trigger control.</param>
        /// <param name="text">The message text.</param>
        /// <param name="namedElements">All the <see cref="Control"/> instances with names in the scope.</param>
        /// <returns>
        /// The message details parsed from the text.
        /// </returns>
        public static IEnumerable<MessageDetail> Parse(Control target, string text, IEnumerable<Control> namedElements)
        {
            _namedElements = namedElements;
            var messageDetails = new List<MessageDetail>();
            var messageTexts = Split(text, ';');

            foreach (var messageText in messageTexts)
            {
                var triggerPlusMessage = LongFormatRegularExpression.IsMatch(messageText)
                    ? Split(messageText, '=')
                    : new[] {null, messageText};

                var messageDetail = CreateMessageDetail(target, triggerPlusMessage.Last()
                    .Replace("[", string.Empty)
                    .Replace("]", string.Empty)
                    .Trim());

                messageDetail.EventName = GetTriggerEventName(target,
                    triggerPlusMessage.Length == 1 ? null : triggerPlusMessage[0]);

                messageDetails.Add(messageDetail);
            }

            return messageDetails;
        }
Example #5
0
 private void button1_Click(object sender, EventArgs e)
 {
     
     Control.Control control = new Control.Control();
     int billid = control.current(mainForm.dbv.dgv);
     if (billid != 0)
     {
         bool check = control.judge(Convert.ToInt32(this.textBox1.Text), mainForm.dbv.dgv);
         if(check)
         {
             int affected = control.Draw(billid, Convert.ToInt32(this.textBox1.Text));
             if (affected == 1)
             {
                MessageBox.Show("取款成功");
             }
             else
             {
               MessageBox.Show("取款失败");
             }
         }
         else
         {
             MessageBox.Show("余额不足");
         }
     }
     else 
     {
         MessageBox.Show("请选择取款账单");
     }
 }
Example #6
0
 private void toolStripButton10_Click(object sender, EventArgs e)
 {
     
     string bank_id = Login.dt.Tables[0].Rows[0][3].ToString();
     Control.Control control = new Control.Control();
     dbv.dgv.DataSource = control.getBank(bank_id);
     dbv.dgv.DataMember = "bank";
 }
Example #7
0
 private void toolStripButton2_Click(object sender, EventArgs e)
 {
     string customer_id = Login.dt.Tables[0].Rows[0][0].ToString ();
     Control.Control control = new Control.Control();
     int affected = control.AddBill(customer_id);
     if (affected == 1)
     {
         MessageBox.Show("添加账单成功");
     }
     else {
         MessageBox.Show("添加账单失败");
     }
 }
Example #8
0
 private void button1_Click(object sender, EventArgs e)
 {
     Control.Control control = new Control.Control();
     int affected=control.delete(this.textBox1.Text);
     if (affected != 0)
     {
         MessageBox.Show("删除成功");
     }
     else 
     {
         MessageBox.Show("删除失败");
         this.textBox1.Text = "";
     
     }
 }
Example #9
0
        private void button1_Click(object sender, EventArgs e)
        {
            Control.Control control = new Control.Control();
            int affected = control.addCustomer (this.textBox1 .Text ,this.textBox2 .Text ,this.textBox3 .Text ,this.textBox4 .Text );
            if (affected == 1)
            {
                MessageBox.Show("添加成功");

            }
            else 
            {
                MessageBox.Show("添加失败");
                this.textBox1.Text = "";
                this.textBox2.Text = "";
                this.textBox3.Text = "";
                this.textBox4.Text = "";
            
            }
        }
Example #10
0
 private void button1_Click(object sender, EventArgs e)
 {
     Control.Control control = new Control.Control();
     int billid = control.current(mainForm.dbv.dgv);
     if (billid != 0)
     {
         int affected = control.Deposit(billid, Convert.ToInt32(this.textBox1.Text));
         bool time = control.time (billid);
         if (time && affected == 1)
         {
             MessageBox.Show("存款成功");
         }
         else
         {
             MessageBox.Show("存款失败");
         }
     }
     else
     {
         MessageBox.Show("请选择存款账单");
     }
 }
Example #11
0
        private void button1_Click(object sender, EventArgs e)
        {
            Control.Control control = new Control.Control();
            if (this.textBox1.Text == this.textBox2.Text)
            {
                int affected = control.change(Login.dt.Tables[0].Rows[0][0].ToString(), this.textBox1.Text);
                if (affected == 1)
                {
                    MessageBox.Show("修改密码成功");

                }
                else
                {
                    MessageBox.Show("密码修改失败");

                }
            }
            else 
            {
                MessageBox.Show("重复输入错误");
                this.textBox1.Text = "";
                this.textBox2.Text = "";
            }
        }
Example #12
0
 private void toolStripButton8_Click(object sender, EventArgs e)
 {
     
     Control.Control control = new Control.Control();
     dbv.dgv.DataSource = control.getAllCustomer ();
     dbv.dgv.DataMember = "allcustomer";
 }
Example #13
0
        /// <summary>
        /// Creates an instance of <see cref="MessageDetail"/> by parsing out the textual dsl.
        /// </summary>
        /// <param name="target">The target of the message.</param>
        /// <param name="messageText">The textual message dsl.</param>
        /// <returns>The created message detail.</returns>
        public static MessageDetail CreateMessageDetail(Control target, string messageText)
        {
            var openingParenthesisIndex = messageText.IndexOf('(');
            if (openingParenthesisIndex < 0)
            {
                openingParenthesisIndex = messageText.Length;
            }

            var closingParenthesisIndex = messageText.LastIndexOf(')');
            if (closingParenthesisIndex < 0)
            {
                closingParenthesisIndex = messageText.Length;
            }

            var core = messageText.Substring(0, openingParenthesisIndex).Trim();
            var message = InterpretMessageText(core);

            if (closingParenthesisIndex - openingParenthesisIndex > 1)
            {
                var paramString = messageText.Substring(openingParenthesisIndex + 1,
                    closingParenthesisIndex - openingParenthesisIndex - 1);
                var parameters = SplitParameters(paramString);

                foreach (var parameter in parameters)
                    message.Parameters.Add(CreateParameter(target, parameter.Trim()));
            }

            return message;
        }
Example #14
0
 /// <summary>
 /// Creates an instance of <see cref="ActionMessage" />.
 /// </summary>
 /// <param name="associatedObject">The associated <see cref="Control"/> object.</param>
 /// <param name="eventName">Name of the event on the view that triggers the ActionMessage.</param>
 /// <param name="methodName">Name of the method to be invoked on the presentation model class.</param>
 /// <param name="parameters">The parameters to pass as part of the method invocation.</param>
 public ActionMessage(Control associatedObject, string eventName, string methodName,
     IEnumerable<Parameter> parameters)
 {
     if (parameters != null)
     {
         foreach (var parameter in parameters)
         {
             parameter.MakeAwareOf(this);
             Parameters.Add(parameter);
         }
     }
     EventName = eventName;
     MethodName = methodName;
     AssociatedObject = associatedObject;
 }
Example #15
0
 /// <summary>
 /// Creates an instance of <see cref="ActionMessage"/>.
 /// </summary>
 /// <param name="associatedObject">The associated <see cref="Control"/> object.</param>
 /// <param name="eventName">Name of the event on the view that triggers the ActionMessage.</param>
 /// <param name="methodName">Name of the method to be invoked on the presentation model class.</param>
 public ActionMessage(Control associatedObject, string eventName, string methodName)
 {
     EventName = eventName;
     MethodName = methodName;
     AssociatedObject = associatedObject;
 }