示例#1
0
 private void grvHocVien_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     btn_ChiTiet.Enabled = true;
     btn_Xoa.Enabled     = true;
 }
示例#2
0
 private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     var tasks = WcfServiceLocator.Create<IProjectPlanManageService>().getTasksByUserId(projectid);
     gcTasks.DataSource = tasks;
 }
示例#3
0
        private void gridView2_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            Frm_ShowUpdate fo = new Frm_ShowUpdate();

            if (e.Column.Name == "Updates")
            {
                //DataTable dt2 = new DataTable();
                //DataTable dt5 = new DataTable();



                if (gridView2.RowCount > 0)
                {
                    fo.grb_sala.Hide();
                    fo.grb_customer.Hide();
                    fo.grb_delivry.Hide();
                    fo.groupControl1.Enabled = false;

                    fo.grb_customer.Enabled = false;
                    fo.grb_delivry.Enabled  = false;
                    fo.grb_sala.Enabled     = false;



                    if (gridView2.GetFocusedRowCellValue(Statues).ToString() == "Delivery")
                    {
                        fo.rdb_delivery.Checked = true;
                        //cmb_customer.Hide();
                        //textEdit1.Show();

                        //textEdit1.Enabled = false;
                        //rdb_clientsave.Enabled = false;
                        //rdb_newclient.Enabled = false;


                        //txt_phones.Enabled = false;
                        //txt_address.Enabled = false;
                        fo.grb_customer.Show();
                        fo.grb_delivry.Show();

                        // fo.grb_customer.Enabled = false;
                        fo.dt2.Clear();
                        fo.dt2 = o.SELECTOrderDetails(Convert.ToInt32(gridView2.GetFocusedRowCellValue(ID_Order)));

                        fo.gridControl2.DataSource = fo.dt2;

                        fo.ID_Dep.Visible   = false;
                        fo.Dep.Visible      = false;
                        fo.ID_Items.Visible = false;


                        fo.dt5.Clear();
                        fo.dt5 = o.SELECTOrder(Convert.ToInt32(gridView2.GetFocusedRowCellValue(ID_Order)));

                        foreach (DataRow dr in fo.dt5.Rows)
                        {
                            fo.Lable_Num.Text   = dr[0].ToString();
                            fo.txt_cust.Text    = dr[1].ToString();
                            fo.textEdit1.Text   = dr[2].ToString();
                            fo.txt_phones.Text  = dr[3].ToString();
                            fo.txt_address.Text = dr[4].ToString();
                            fo.lable_date.Text  = dr[5].ToString();

                            fo.texT.Text = dr[6].ToString();

                            fo.cmb_delivery.Text = dr[9].ToString();
                            fo.txt_delivery.Text = dr[10].ToString();
                            fo.txt_discount.Text = dr[11].ToString();
                        }
                    }
                    else if (gridView2.GetFocusedRowCellValue(Statues).ToString() == "Table")
                    {
                        //  rdb_delivery.Enabled = false;
                        //    cmb_delivery.Enabled = false;
                        //   txt_delivery.Enabled = false;
                        //  txt_phones.Enabled = false;
                        //  textEdit1.Enabled = false;
                        // fo.rdb_sala.Enabled = true;
                        //textEdit1.Enabled = false;
                        fo.grb_sala.Show();
                        fo.rdb_sala.Checked = true;
                        //  cmb_Table.Enabled = false;
                        // fo.grb_sala.Show();
                        // fo.grb_sala.Enabled = false;
                        fo.grb_customer.Hide();
                        fo.grb_delivry.Hide();

                        fo.dt2.Clear();
                        fo.dt2 = o.SELECTOrderDetails(Convert.ToInt32(gridView2.GetFocusedRowCellValue(ID_Order)));

                        fo.gridControl2.DataSource = fo.dt2;
                        fo.ID_Items.Visible        = false;
                        fo.Dep.Visible             = false;
                        fo.ID_Items.Visible        = false;

                        fo.dt5.Clear();
                        fo.dt5 = o.SELECTOrderSala(Convert.ToInt32(gridView2.GetFocusedRowCellValue(ID_Order)));
                        foreach (DataRow dr in fo.dt5.Rows)
                        {
                            fo.Lable_Num.Text = dr[0].ToString();
                            fo.txt_cust.Text  = dr[1].ToString();
                            fo.textEdit1.Text = dr[2].ToString();

                            fo.lable_date.Text = dr[3].ToString();


                            fo.texT.Text = dr[4].ToString();
                            //txt_pay.Text = dr[5].ToString();
                            //txt_mark.Text = dr[6].ToString();
                            // cmb_Table.Text = dr[7].ToString();
                            fo.cmb_Table.Text    = dr[7].ToString();
                            fo.txt_discount.Text = dr[8].ToString();
                            fo.cmb_stuff.Text    = dr[9].ToString();
                        }
                    }
                    else if (gridView2.GetFocusedRowCellValue(Statues).ToString() == "Take away")
                    {
                        //   rdb_delivery.Enabled = false;
                        fo.rdb_takeaway.Checked = true;

                        // txt_phones.Enabled = false;
                        // textEdit1.Enabled = false;

                        // fo.textEdit1.Show();
                        //textEdit1.Enabled = false;
                        fo.grb_customer.Show();
                        fo.grb_delivry.Hide();

                        fo.grb_sala.Hide();


                        fo.dt2.Clear();
                        fo.dt2 = o.SELECTOrderDetails(Convert.ToInt32(gridView2.GetFocusedRowCellValue(ID_Order)));
                        fo.gridControl2.DataSource = fo.dt2;
                        fo.ID_Items.Visible        = false;
                        fo.Dep.Visible             = false;
                        fo.ID_Items.Visible        = false;
                        fo.dt5.Clear();
                        fo.dt5 = o.SELECTOrderTakwAway(Convert.ToInt32(gridView2.GetFocusedRowCellValue(ID_Order)));

                        foreach (DataRow dr in fo.dt5.Rows)
                        {
                            fo.Lable_Num.Text = dr[0].ToString();
                            fo.txt_cust.Text  = dr[1].ToString();
                            fo.textEdit1.Text = dr[2].ToString();

                            fo.lable_date.Text = dr[3].ToString();

                            fo.texT.Text = dr[4].ToString();

                            fo.txt_discount.Text = dr[7].ToString();

                            fo.txt_phones.Text  = dr[8].ToString();
                            fo.txt_address.Text = dr[9].ToString();
                        }
                    }
                    fo.totalInvoice();
                    fo.TOTALFINALYDELIVERY();
                    fo.TOTALFINALYDISCOUNT();
                    fo.ShowDialog();
                }
            }
            else if (e.Column.Name == "Delete")
            {
                if (XtraMessageBox.Show("هل تريد حذف الفاتورة ", "", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                {
                    o.DeleteOrder(Convert.ToInt32(gridView2.GetFocusedRowCellValue(ID_Order)));
                    gridControl2.DataSource = o.SELECtALLORDER(Convert.ToDateTime(FromDate.Text), Convert.ToDateTime(ToDate.Text));
                }
            }
        }
示例#4
0
 void frmDM_LoaiDoiTuong_OnGridCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     SetControl(true);
     Oid = Convert.ToInt32(((DmLoaiDoiTuongInfor)dgvDanhSachMatHang.GetFocusedRow()).IdLoaiDT.ToString());
 }
示例#5
0
 private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     // Funciona quando o editable está desativado
 }
示例#6
0
        private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            if (e.Column.Name == "show_print")
            {
                try
                {
                    if (gridView1.RowCount > 0)
                    {
                        XtraReport1Order    ro = new XtraReport1Order();
                        DataSet1            ds = new DataSet1();
                        RPT.Frm_ReportOrder fr = new RPT.Frm_ReportOrder();
                        fr.documentViewer1.Refresh();
                        dt5.Clear();
                        dt5 = o.PrintOrder(Convert.ToInt32(gridView1.GetFocusedRowCellValue("رقم الفاتورة")));
                        if (gridView1.GetFocusedRowCellValue(Statues).ToString() == "Delivery")
                        {
                            dt6.Clear();
                            dt6 = o.Select_DeliveyMan(Convert.ToInt32(gridView1.GetFocusedRowCellValue("رقم الفاتورة")));
                            ro.Txt_DeliveryService.Visible   = true;
                            ro.Lable_DeliveryService.Visible = true;
                            ro.Lable_DeliveryName.Visible    = true;
                            ro.Txt_DeliveryName.Visible      = true;
                            ro.Txt_DeliveryName.Text         = dt6.Rows[0][1].ToString();
                        }

                        if (gridView1.GetFocusedRowCellValue(Statues).ToString() == "Table")
                        {
                            dt6.Clear();
                            dt6 = o.PrintOrderSala(Convert.ToInt32(gridView1.GetFocusedRowCellValue("رقم الفاتورة")));
                            ro.Lable_TableNum.Visible = true;
                            ro.Txt_TableNum.Visible   = true;
                            ro.Txt_TableNum.Text      = dt6.Rows[0][1].ToString();
                        }

                        ds.Tables["Order"].Clear();
                        for (int i = 0; i < dt5.Rows.Count; i++)
                        {
                            ds.Tables["Order"].Rows.Add(dt5.Rows[i][0], dt5.Rows[i][1], dt5.Rows[i][4],
                                                        dt5.Rows[i][5], dt5.Rows[i][7], dt5.Rows[i][6], dt5.Rows[i][9], dt5.Rows[i][8],
                                                        dt5.Rows[i][2], (dt5.Rows[i][3]), dt5.Rows[i][11], dt5.Rows[i][10], dt5.Rows[i][12]);
                        }
                        ro.Txt_Delivery.Visible           = true;
                        ro.DataSource                     = ds;
                        ro.Parameters["Id"].Value         = Convert.ToInt32(gridView1.GetFocusedRowCellValue("رقم الفاتورة"));
                        ro.Parameters["Id"].Visible       = false;
                        fr.documentViewer1.DocumentSource = ro;
                        fr.Show();
                        // ro.Dispose();

                        //System.Drawing.Printing.PrintDocument printDocument = new System.Drawing.Printing.PrintDocument();
                        //ro.PrinterName = printDocument.PrinterSettings.PrinterName;
                        // ro.PrinterName = Properties.Settings.Default.PrinterName;
                        // ro.Print();

                        ////كود طباعة امر التشغيل للمطبخ//////////////

                        //DataTable dt6 = new DataTable();
                        //XtraReportCheck rc = new XtraReportCheck();
                        //DataSet1 ds1 = new DataSet1();
                        //dt6.Clear();
                        //dt6 = o.PrintOrder(Convert.ToInt32(gridView1.GetFocusedRowCellValue("رقم الفاتورة")));
                        //if (dt5.Rows[0][11].ToString() == "Table")
                        //{
                        //    dt6.Clear();

                        //    dt6 = o.PrintOrderSala(Convert.ToInt32(gridView1.GetFocusedRowCellValue("رقم الفاتورة")));
                        //    rc.Label_TableNum.Visible = true;
                        //    rc.Txt_TableNum.Visible = true;
                        //    rc.Txt_TableNum.Text = dt5.Rows[0][1].ToString();
                        //}

                        //dt6.Clear();
                        //dt6 = o.PrintOrder(Convert.ToInt32(gridView1.GetFocusedRowCellValue("رقم الفاتورة")));
                        //ds.Tables["Order"].Clear();
                        //for (int i = 0; i < dt6.Rows.Count; i++)
                        //{
                        //    ds.Tables["Order"].Rows.Add(dt6.Rows[i][0], dt6.Rows[i][1], dt6.Rows[i][4],
                        //    dt6.Rows[i][5], dt6.Rows[i][7], dt6.Rows[i][6], dt6.Rows[i][9], dt6.Rows[i][8],
                        //    dt6.Rows[i][2], (dt6.Rows[i][3]), dt6.Rows[i][11], dt6.Rows[i][10], dt6.Rows[i][12]);
                        //}
                        //rc.DataSource = ds;
                        //rc.Parameters["Id"].Value = Convert.ToInt32(gridView1.GetFocusedRowCellValue("رقم الفاتورة"));
                        //rc.Parameters["Id"].Visible = false;
                        ////System.Drawing.Printing.PrintDocument printDocumentch = new System.Drawing.Printing.PrintDocument();
                        //// ro.PrinterName = printDocument.PrinterSettings.PrinterName;
                        //rc.PrinterName = Properties.Settings.Default.PrinterName;
                        //rc.Print();
                    }
                    else
                    {
                        MessageBox.Show("لايوجد بيانات للطباعه");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else if (e.Column.Name == "print")
            {
                try
                {
                    if (gridView1.RowCount > 0)
                    {
                        XtraReport1Order    ro = new XtraReport1Order();
                        DataSet1            ds = new DataSet1();
                        RPT.Frm_ReportOrder fr = new RPT.Frm_ReportOrder();
                        dt5.Clear();
                        dt5 = o.PrintOrder(Convert.ToInt32(gridView1.GetFocusedRowCellValue("رقم الفاتورة")));
                        if (gridView1.GetFocusedRowCellValue(Statues).ToString() == "Delivery")
                        {
                            dt6.Clear();
                            dt6 = o.Select_DeliveyMan(Convert.ToInt32(gridView1.GetFocusedRowCellValue("رقم الفاتورة")));
                            ro.Txt_DeliveryService.Visible   = true;
                            ro.Lable_DeliveryService.Visible = true;
                            ro.Lable_DeliveryName.Visible    = true;
                            ro.Txt_DeliveryName.Visible      = true;
                            ro.Txt_DeliveryName.Text         = dt6.Rows[0][1].ToString();
                        }

                        if (gridView1.GetFocusedRowCellValue(Statues).ToString() == "Table")
                        {
                            dt6.Clear();
                            dt6 = o.PrintOrderSala(Convert.ToInt32(gridView1.GetFocusedRowCellValue("رقم الفاتورة")));
                            ro.Lable_TableNum.Visible = true;
                            ro.Txt_TableNum.Visible   = true;
                            ro.xrLabel11.Visible      = true;
                            ro.txtcaptin.Visible      = true;
                            ro.Txt_TableNum.Text      = dt6.Rows[0][1].ToString();
                            ro.txtcaptin.Text         = dt6.Rows[0][3].ToString();
                        }

                        ds.Tables["Order"].Clear();
                        for (int i = 0; i < dt5.Rows.Count; i++)
                        {
                            ds.Tables["Order"].Rows.Add(dt5.Rows[i][0], dt5.Rows[i][1], dt5.Rows[i][4],
                                                        dt5.Rows[i][5], dt5.Rows[i][7], dt5.Rows[i][6], dt5.Rows[i][9], dt5.Rows[i][8],
                                                        dt5.Rows[i][2], (dt5.Rows[i][3]), dt5.Rows[i][11], dt5.Rows[i][10], dt5.Rows[i][12]);
                        }
                        ro.Txt_Delivery.Visible     = true;
                        ro.DataSource               = ds;
                        ro.Parameters["Id"].Value   = Convert.ToInt32(gridView1.GetFocusedRowCellValue("رقم الفاتورة"));
                        ro.Parameters["Id"].Visible = false;

                        System.Drawing.Printing.PrintDocument printDocument = new System.Drawing.Printing.PrintDocument();
                        ro.PrinterName = printDocument.PrinterSettings.PrinterName;
                        ro.PrinterName = Properties.Settings.Default.PrinterOrderClient;
                        ro.Print();

                        ro.Dispose();
                        ////كود طباعة امر التشغيل للمطبخ//////////////

                        //DataTable dt6 = new DataTable();
                        //XtraReportCheck rc = new XtraReportCheck();
                        //DataSet1 ds1 = new DataSet1();
                        //dt6.Clear();
                        //dt6 = o.PrintOrder(Convert.ToInt32(gridView1.GetFocusedRowCellValue("رقم الفاتورة")));
                        //if (dt5.Rows[0][11].ToString() == "Table")
                        //{
                        //    dt6.Clear();

                        //    dt6 = o.PrintOrderSala(Convert.ToInt32(gridView1.GetFocusedRowCellValue("رقم الفاتورة")));
                        //    rc.Label_TableNum.Visible = true;
                        //    rc.Txt_TableNum.Visible = true;
                        //    rc.Txt_TableNum.Text = dt5.Rows[0][1].ToString();
                        //}

                        //dt6.Clear();
                        //dt6 = o.PrintOrder(Convert.ToInt32(gridView1.GetFocusedRowCellValue("رقم الفاتورة")));
                        //ds.Tables["Order"].Clear();
                        //for (int i = 0; i < dt6.Rows.Count; i++)
                        //{
                        //    ds.Tables["Order"].Rows.Add(dt6.Rows[i][0], dt6.Rows[i][1], dt6.Rows[i][4],
                        //    dt6.Rows[i][5], dt6.Rows[i][7], dt6.Rows[i][6], dt6.Rows[i][9], dt6.Rows[i][8],
                        //    dt6.Rows[i][2], (dt6.Rows[i][3]), dt6.Rows[i][11], dt6.Rows[i][10], dt6.Rows[i][12]);
                        //}
                        //rc.DataSource = ds;
                        //rc.Parameters["Id"].Value = Convert.ToInt32(gridView1.GetFocusedRowCellValue("رقم الفاتورة"));
                        //rc.Parameters["Id"].Visible = false;
                        ////System.Drawing.Printing.PrintDocument printDocumentch = new System.Drawing.Printing.PrintDocument();
                        //// ro.PrinterName = printDocument.PrinterSettings.PrinterName;
                        //rc.PrinterName = Properties.Settings.Default.PrinterName;
                        //rc.Print();
                    }
                    else
                    {
                        MessageBox.Show("لايوجد بيانات للطباعه");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
示例#7
0
 private void gvBolum_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     BolumID        = Convert.ToInt32(gvBolum.GetRowCellValue(gvBolum.FocusedRowHandle, "BolumId"));
     editBolum.Text = gvBolum.GetRowCellValue(gvBolum.FocusedRowHandle, "BolumAdi").ToString();
 }
 void frmDM_SegmentChildLoai_OnGridCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     SetControl(true);
     Info           = ((SegmentChildInfo)dgvDanhSachMatHang.GetFocusedRow());
     btnXoa.Enabled = false;
 }
示例#9
0
        private void gridView_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            try
            {
                butAdd.Enabled    = false;
                butDelete.Enabled = true;
                butUpdate.Enabled = true;
                listchkFileAttack.UnCheckAll();
                int.TryParse(gridView.GetRowCellValue(gridView.FocusedRowHandle, "Id").ToString(), out mailTemplateId);
                txtName.Text        = gridView.GetRowCellValue(gridView.FocusedRowHandle, "Name").ToString();
                txtDescription.Text = gridView.GetRowCellValue(gridView.FocusedRowHandle, "Description").ToString();
                txtSubject.Text     = gridView.GetRowCellValue(gridView.FocusedRowHandle, "Subject").ToString();
                txtContent.Text     = gridView.GetRowCellValue(gridView.FocusedRowHandle, "Content").ToString();
                chkIsActive.Checked = bool.Parse(gridView.GetRowCellValue(gridView.FocusedRowHandle, "IsActive").ToString());
                chkIsActive.Enabled = true;
                var t = cbbMailSend.Items.Cast <MailSend_Model>().FirstOrDefault(x => x.Id == int.Parse(gridView.GetRowCellValue(gridView.FocusedRowHandle, "MailSendId").ToString()));
                if (t != null)
                {
                    cbbMailSend.SelectedItem = t;
                }

                cbbMailReceives.SetEditValue(string.Empty);
                var mailRe = gridView.GetRowCellValue(gridView.FocusedRowHandle, "MailReceiveIds") != null?gridView.GetRowCellValue(gridView.FocusedRowHandle, "MailReceiveIds").ToString() : string.Empty;

                if (!string.IsNullOrEmpty(mailRe))
                {
                    var arrReceiveId = mailRe.Split('|');
                    if (arrReceiveId != null && arrReceiveId.Count() > 0)
                    {
                        if (this.cbbMailReceives.Properties.Items != null && this.cbbMailReceives.Properties.Items.Count > 0)
                        {
                            foreach (CheckedListBoxItem item in this.cbbMailReceives.Properties.Items)
                            {
                                foreach (var id in arrReceiveId)
                                {
                                    int receiveId = 0;
                                    if (!string.IsNullOrEmpty(id))
                                    {
                                        int.TryParse(id, out receiveId);
                                    }
                                    if ((int)item.Value == receiveId)
                                    {
                                        item.CheckState = CheckState.Checked;
                                        break;
                                    }
                                    else
                                    {
                                        item.CheckState = CheckState.Unchecked;
                                    }
                                }
                            }
                        }
                    }
                }

                var mFiles = gridView.GetRowCellValue(gridView.FocusedRowHandle, "MailFileIds") != null?gridView.GetRowCellValue(gridView.FocusedRowHandle, "MailFileIds").ToString() : string.Empty;

                if (!string.IsNullOrEmpty(mFiles))
                {
                    var fileids = mFiles.Split('|').Select(x => Convert.ToInt32(x));
                    if (fileids != null && fileids.Count() > 0)
                    {
                        if (this.listchkFileAttack.Items != null && this.listchkFileAttack.Items.Count > 0)
                        {
                            foreach (CheckedListBoxItem item in this.listchkFileAttack.Items)
                            {
                                foreach (var id in fileids)
                                {
                                    if ((int)item.Value == id)
                                    {
                                        item.CheckState = CheckState.Checked;
                                        break;
                                    }
                                    else
                                    {
                                        item.CheckState = CheckState.Unchecked;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Lỗi: Bind dữ liệu bị lỗi\n" + ex.Message);
            }
        }
示例#10
0
        private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            try
            {
                if (loaded)
                {
                    row1 = gridView1.GetDataRow(gridView1.GetRowHandle(e.RowHandle));

                    dbconnection.Open();
                    string       query = "select CustomerBill_ID from customer_bill where Branch_BillNumber=" + row1["فاتورة رقم"].ToString() + " and Branch_ID=" + UserControl.EmpBranchID;
                    MySqlCommand com1  = new MySqlCommand(query, dbconnection);
                    id = Convert.ToInt32(com1.ExecuteScalar());

                    query = "select customer_bill.Bill_Date,product_bill.Delegate_ID from customer_bill inner join product_bill on product_bill.CustomerBill_ID=customer_bill.CustomerBill_ID where customer_bill.CustomerBill_ID=" + id + " order by product_bill.ProductBill_ID desc limit 1";
                    MySqlCommand    com = new MySqlCommand(query, dbconnection);
                    MySqlDataReader dr  = com.ExecuteReader();
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            dateTimePickerBill.Text   = dr["Bill_Date"].ToString();
                            comDelegate.SelectedValue = dr["Delegate_ID"].ToString();
                        }
                    }
                    else
                    {
                        dateTimePickerBill.Value  = DateTime.Now.Date;
                        comDelegate.SelectedIndex = -1;
                    }
                    dr.Close();

                    query = "select sum(product_bill.Quantity) as 'Quantity' from customer_bill inner join product_bill on product_bill.CustomerBill_ID=customer_bill.CustomerBill_ID inner join data on data.Data_ID=product_bill.Data_ID where customer_bill.CustomerBill_ID=" + id + " and data.Carton=0 group by product_bill.Data_ID";
                    com   = new MySqlCommand(query, dbconnection);
                    dr    = com.ExecuteReader();
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            txtQuantity.Text = dr["Quantity"].ToString();
                        }
                    }
                    else
                    {
                        txtQuantity.Text = "";
                    }
                    dr.Close();

                    query = "select sum(product_bill.Cartons) as 'Cartons' from customer_bill inner join product_bill on product_bill.CustomerBill_ID=customer_bill.CustomerBill_ID inner join data on data.Data_ID=product_bill.Data_ID where customer_bill.CustomerBill_ID=" + id + " and data.Carton<>0 group by product_bill.Data_ID";
                    com   = new MySqlCommand(query, dbconnection);
                    dr    = com.ExecuteReader();
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            txtCartons.Text = dr["Cartons"].ToString();
                        }
                    }
                    else
                    {
                        txtCartons.Text = "";
                    }
                    dr.Close();


                    if (row1["Client_ID"].ToString() != "")
                    {
                        dbconnection.Close();
                        loaded                  = false;
                        radClient.Checked       = true;
                        loaded                  = true;
                        comClient.SelectedValue = row1["Client_ID"].ToString();
                    }
                    else if (row1["Customer_ID"].ToString() != "")
                    {
                        //dbconnection.Open();
                        query = "select Customer_Type from customer where Customer_ID=" + row1["Customer_ID"].ToString();
                        MySqlCommand comm         = new MySqlCommand(query, dbconnection);
                        string       customerType = comm.ExecuteScalar().ToString();
                        dbconnection.Close();

                        loaded = false;
                        if (customerType == "مهندس")
                        {
                            radEng.Checked = true;
                        }
                        else if (customerType == "مقاول")
                        {
                            radContractor.Checked = true;
                        }
                        else if (customerType == "تاجر")
                        {
                            radDealer.Checked = true;
                        }
                        loaded = true;
                        comClient.SelectedValue = row1["Customer_ID"].ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            dbconnection.Close();
        }
示例#11
0
        /// <summary>
        /// 主从显示
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridView_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            DataRow mydatarow = this.gridView.GetDataRow(this.gridView.FocusedRowHandle);

            BindManager.SetControlValue(mydatarow, grpUserInfo, "fld", null);
        }
示例#12
0
        private void dbGrid_RowCellClick_1(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            DataRow      drv   = this.dbGrid.GetDataRow(e.RowHandle);
            FrmInParkPic frmIn = new FrmInParkPic();
            string       img   = this.dbGrid.GetDataRow(e.RowHandle)["入场图片"].ToString();

            //Billy
            byte[]     byData1   = new byte[100];
            char[]     charData1 = new char[1000];
            FileStream sFile1    = null;

            try
            {
                sFile1 = new FileStream(img, FileMode.Open, FileAccess.Read);
                sFile1.Seek(55, SeekOrigin.Begin);
                sFile1.Read(byData1, 0, 100); //第一个参数是被传进来的字节数组,用以接受FileStream对象中的数据,第2个参数是字节数组中开始写入数据的位置,它通常是0,表示从数组的开端文件中向数组写数据,最后一个参数规定从文件读多少字符.
            }
            catch
            {
                MessageBox.Show("读取图片失败");
                return;
            }
            Decoder d1 = Encoding.UTF8.GetDecoder();

            d1.GetChars(byData1, 0, byData1.Length, charData1, 0);
            picpark.BackgroundImage = Image.FromStream(sFile1);

            return;

            string server = DataAccRes.AppSettings("服务器");

            if (server != "127.0.0.1")
            {
                string pic = img;
                if (string.IsNullOrEmpty(pic))
                {
                    return;
                }
                string[] sArray = pic.Split('\\');
                string   path   = "\\\\" + server + @"\D$" + @"\images";


                string[] test      = Directory.GetFiles(path);
                string   strResult = string.Empty;
                string   sss       = "\\\\" + server + @"\D$" + @"\images\" + sArray[2].ToString();
                if (Array.IndexOf(test, sss) != -1)
                {
                    byte[]     byData   = new byte[100];
                    char[]     charData = new char[1000];
                    FileStream sFile    = null;

                    try
                    {
                        sFile = new FileStream(sss, FileMode.Open, FileAccess.Read);
                        sFile.Seek(55, SeekOrigin.Begin);
                        sFile.Read(byData, 0, 100); //第一个参数是被传进来的字节数组,用以接受FileStream对象中的数据,第2个参数是字节数组中开始写入数据的位置,它通常是0,表示从数组的开端文件中向数组写数据,最后一个参数规定从文件读多少字符.
                    }
                    catch
                    {
                        MessageBox.Show("读取图片失败");
                        return;
                    }
                    Decoder d = Encoding.UTF8.GetDecoder();
                    d.GetChars(byData, 0, byData.Length, charData, 0);
                    picpark.BackgroundImage = Image.FromStream(sFile);
                }
            }
        }
示例#13
0
 void frmDM_Kho_OnGridCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     SetControl(true);
     Oid = ((DMKhoGridLoadInfo)dgvDanhSachMatHang.GetFocusedRow()).IdKho;
 }
 private void grvUCList_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     _tenNgayNghi   = grvUCList.GetRowCellDisplayText(e.RowHandle, "TenNgayNghi");
     btnXoa.Enabled = true;
 }
示例#15
0
 private void grvCongThuc_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     maNguyenLieu = grvCongThuc.GetRowCellValue(e.RowHandle, "MaNguyenLieu").ToString();
     EnableControl();
 }
示例#16
0
 private void gridVUsuarios_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     Cancel();
 }
示例#17
0
        private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            try
            {
                string Id = gridView1.GetFocusedDataRow()[0].ToString();
                SelectItemRow = Convert.ToInt32(Id);

                string CarNumber = gridView1.GetFocusedDataRow()[1].ToString();
                if (gridView1.DataRowCount == 0)
                {
                    textEdit1.Visible     = false;
                    memoEdit1.Visible     = false;
                    simpleButton1.Visible = false;
                }
                else
                {
                    if (CarNumber != string.Empty)
                    {
                        string    query = "select [dbo].[CheckCarService] (" + CarNumber + "," + Id + ")";
                        DataTable dt    = DbConnection.DBConnect(query);
                        int       State = Convert.ToInt32(dt.Rows[0][0].ToString());
                        if (State == 1)
                        {
                            textEdit1.Visible     = true;
                            simpleButton1.Visible = true;
                            string Message = "В/Ц " + CarNumber + " проходил обработку в течении последних 14 дней.";
                            textEdit1.Text = Message;
                        }
                        else
                        {
                            textEdit1.Visible     = false;
                            simpleButton1.Visible = false;
                        }

                        string    LastRent = "exec dbo.LastRent " + CarNumber;
                        DataTable dt1      = DbConnection.DBConnect(LastRent);
                        if (dt1.Rows.Count > 0)
                        {
                            memoEdit1.Visible = true;
                            memoEdit1.Text    = "Последняя заявка: " + dt1.Rows[0][1] + " от " + dt1.Rows[0][2] + "" + "\r\n" + "Продукт: " + dt1.Rows[0][5] + "" + "\r\n" + "Была передача: " + dt1.Rows[0][3];
                        }
                        else
                        {
                            memoEdit1.Visible = false;
                        }
                    }
                    else
                    {
                        textEdit1.Visible     = false;
                        memoEdit1.Visible     = false;
                        simpleButton1.Visible = false;
                    }
                }
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#18
0
 private void Grviewsanpham_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
 }
示例#19
0
 private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     focuseName = e.Column.FieldName;
 }
 private void gridView一览_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     this.TaskDTO = new TaskDTO().buildRead(this.gridView一览.GetRowCellValue(e.RowHandle, "remark_id").ToString());
     new Frm任务(this.TaskDTO, false).ShowDialog();
 }
示例#21
0
 private void grvDanhSach_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     btnMoPhieu.Enabled = true;
 }
示例#22
0
        private void gridViewFiles_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            try
            {
                tb_Comprobante_Info InfoCbteT = new tb_Comprobante_Info();

                string MensajeError = "";


                switch (e.Column.Name)
                {
                case "colRide":

                    XtraReport Reporte = new XtraReport();
                    string     msg     = "";


                    InfoCbteT = (tb_Comprobante_Info)gridViewFiles.GetFocusedRow();

                    Reporte = Rpt_Ride_Bus.Optener_reporte(InfoCbteT, ref msg);         //FAct Imporpoint
                    Reporte.ShowPreview();

                    break;

                case "colXml":


                    InfoCbteT = (tb_Comprobante_Info)gridViewFiles.GetFocusedRow();

                    tb_Comprobante_Bus BusCbte = new tb_Comprobante_Bus();
                    string             sXML    = "";
                    sXML = BusCbte.Get_XML(InfoCbteT.IdEmpresa, InfoCbteT.IdComprobante, ref MensajeError);

                    XmlDocument xmlOrigen = new XmlDocument();
                    xmlOrigen.Load(new StringReader(sXML));



                    Stream         myStream;
                    SaveFileDialog saveFileDialog1 = new SaveFileDialog();

                    saveFileDialog1.Filter           = "xml files (*.xml)|*.xml";
                    saveFileDialog1.FilterIndex      = 2;
                    saveFileDialog1.RestoreDirectory = true;
                    saveFileDialog1.FileName         = "SRI_" + InfoCbteT.Nombre_file;

                    if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                    {
                        if ((myStream = saveFileDialog1.OpenFile()) != null)
                        {
                            xmlOrigen.Save(myStream);
                            myStream.Close();
                        }
                    }


                    break;

                case "colEliminar":



                    string msgError = "";

                    InfoCbteT = (tb_Comprobante_Info)gridViewFiles.GetFocusedRow();
                    if (InfoCbteT.EstadoDoc == "NO AUTORIZADO")
                    {
                        if (MessageBox.Show("Esta seguro que desear anular el comprobante #:" + InfoCbteT.IdComprobante, "Efirm confirmacion", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            if (buscomp.Eliminar_Cbte(InfoCbteT.IdEmpresa, InfoCbteT.IdComprobante, "", "", ref msgError))
                            {
                                MessageBox.Show("Eliminacion de comprobante Ok", "Efirm", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                        }
                    }

                    if (InfoCbteT.EstadoDoc == "AUTORIZADO")
                    {
                        if (Efirm.Properties.Settings.Default.P_ESTADO_CARGA_EFIRM == "CLIENTE")
                        {
                            MessageBox.Show("Usted no tiene Permiso para Eliminar Comprobantes AUTORIZADOS .. solicite a sistemas o inicie como administrador", "Efirm", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            return;
                        }


                        if (MessageBox.Show("Esta seguro que desear anular el comprobante #:" + InfoCbteT.IdComprobante, "Efirm confirmacion", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            if (MessageBox.Show("Esta REALMENTE seguro que desear anular el comprobante #:" + InfoCbteT.IdComprobante + " RECUERDE EL COMPROBANTE ESTA AUTORIZADO DEBERA REALIZAR TODO EL PROCESO NUEVAMENTE", "Efirm confirmacion", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
                            {
                                if (MessageBox.Show("***ATENCION....CUIDADO ESTA ELIMINANDO UN CBTE *AUTORIZADO* ESTE COMPROBANTE YA ESTA EN LA BASE DEL SRI y no sera elimado del mismo solo se eliminara de efirm... comprobante #:" + InfoCbteT.IdComprobante, "Efirm confirmacion", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                                {
                                    frmAuditoria_Anulacion frm = new frmAuditoria_Anulacion();
                                    frm.ShowDialog();

                                    if (buscomp.Eliminar_Cbte(InfoCbteT.IdEmpresa, InfoCbteT.IdComprobante, frm.txt_usuario_anulacion.Text, frm.txt_motivo_anulacion.Text, ref msgError))
                                    {
                                        MessageBox.Show("Eliminacion de comprobante Ok", "Efirm", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    }
                                }
                            }
                        }
                    }


                    break;



                default:
                    string mensaje = (string)gridViewFiles.GetFocusedRowCellValue(e.Column);


                    if (mensaje != "")
                    {
                        frmMensaje frmsg = new frmMensaje();
                        frmsg.richTextBoxMensaje.Text = mensaje;
                        frmsg.WindowState             = FormWindowState.Maximized;
                        frmsg.ShowDialog();
                    }

                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
                BusSisLog.Log_Error(ex.Message.ToString(), eTipoError.ERROR, this.ToString());
            }
        }
示例#23
0
 private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
 }
示例#24
0
        private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            int index = this.checkedListBoxControl1.Items.IndexOf(e.Column.FieldName);

            this.checkedListBoxControl1.SelectedIndex = index;
        }