Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string strcmd            = @"update [dbo].[orderchanged]
                                set  [orderchanged].OrderChangedCategoryCode ='E'
                                where [orderchanged].OrderID = @OrderID";
            List <SqlParameter> sqls = new List <SqlParameter>();

            sqls.Add(SqlHelper.CreateParameter("@OrderID", SqlDbType.VarChar, 14, this.orderID));
            if (SqlHelper.ExecuteNonQuery(strcmd, sqls) == 1)
            {
                MessageBox.Show("訂單已答交");
                CheckOrderForm frm = new CheckOrderForm(this.orderID, "view");
                Common.ContainerForm.NextForm(frm);
            }
            else
            {
                MessageBox.Show("訂單同意失敗");
            }
        }
Ejemplo n.º 2
0
 private void datagridviewOrder_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (this.buyerLoginAccount != null)
     {
         // 如果按下編輯 進入編輯頁面
         //FOR 採購人員
         if (this.dataGridView1.Columns[e.ColumnIndex].Name == "edit")
         {
             //label5.Text = this.datagridviewOrder.Rows[e.RowIndex].Cells[5].Value.ToString();
             if (this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "訂單取消" ||
                 this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "訂單已答交" ||
                 this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "訂單已出貨" ||
                 this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "貨品已點交" ||
                 this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "訂單已逾期" ||
                 this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "訂單已送出"
                 )
             {
                 MessageBox.Show(this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString());
             }
             else
             {
                 string          editstr         = this.dataGridView1.Columns[e.ColumnIndex].Name;
                 string          s               = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
                 DataGridViewRow DataGridViewRow = this.dataGridView1.CurrentRow;
                 CheckOrderForm  frm             = new CheckOrderForm(this.buyerLoginAccount, DataGridViewRow, s, editstr);
                 Common.ContainerForm.NextForm(frm);
             }
         }
         // 如果按下檢視進入檢視頁面
         else if (this.dataGridView1.Columns[e.ColumnIndex].Name == "view")
         {
             //===============
             if (this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "訂單取消" ||
                 this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "訂單已答交" ||
                 this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "訂單已出貨" ||
                 this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "貨品已點交" ||
                 this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "訂單已逾期" ||
                 this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "訂單已送出"
                 )
             {
                 string          viewstr         = this.dataGridView1.Columns[e.ColumnIndex].Name;
                 string          orderID         = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
                 DataGridViewRow dataGridViewRow = this.dataGridView1.CurrentRow;
                 CheckOrderForm  frm             = new CheckOrderForm(this.buyerLoginAccount, dataGridViewRow, orderID, viewstr);
                 Common.ContainerForm.NextForm(frm);
             }
             else
             {
                 MessageBox.Show(this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString());
             }
         }
     }
     //FOR 供應商
     else if (this.SupplierLoginAccount != null)
     {
         if (this.dataGridView1.Columns[e.ColumnIndex].Name == "edit")
         {
             if (
                 this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "訂單已送出"
                 )
             {
                 string         orderID = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
                 CheckOrderForm frm     = new CheckOrderForm(orderID, "edit");
                 Common.ContainerForm.NextForm(frm);
             }
             else
             {
                 MessageBox.Show(this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString());
             }
         }
         else if (this.dataGridView1.Columns[e.ColumnIndex].Name == "view")
         {
             if (
                 this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "訂單取消" ||
                 this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "訂單已答交" ||
                 this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "訂單已出貨" ||
                 this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "貨品已點交" ||
                 this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString() == "訂單已逾期"
                 //|| this.datagridviewOrder.Rows[e.RowIndex].Cells[5].Value.ToString() == "訂單已送出"
                 )
             {
                 string         orderID = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
                 CheckOrderForm frm     = new CheckOrderForm(orderID, "view");
                 Common.ContainerForm.NextForm(frm);
             }
             else
             {
                 MessageBox.Show(this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString());
             }
         }
     }
 }