/// <summary>
        /// Handles invocation of RowClick events
        /// </summary>
        internal bool DoRowClickEvent(GridRow row, RowArea rowArea, MouseEventArgs e)
        {
            if (RowClick != null)
            {
                GridRowClickEventArgs ev =
                    new GridRowClickEventArgs(row.GridPanel, row, rowArea, e);

                RowClick(this, ev);

                return (ev.Cancel);
            }

            return (false);
        }
Beispiel #2
1
 private void sgc_receta_RowClick(object sender, GridRowClickEventArgs e)
 {
     sgc_receta.PrimaryGrid.GridPanel.GetSelectedRows().GetCells();
 }
Beispiel #3
1
        private void sgc_prod_RowClick(object sender, GridRowClickEventArgs e)
        {
            List<GridCell> row = sgc_prod.PrimaryGrid.GridPanel.GetSelectedRows().GetCells();

            if (row.Count != 0)
            {
                id_prod = row[0].Value.ToString();
                cb_cat.SelectedIndex = obtenerIndice(row[1].Value,cb_cat);
                tb_nombre.Text = row[2].Value.ToString();
                tb_desc.Text = row[3].Value.ToString();
                tb_precio.Text = row[4].Value.ToString();
                tb_sact.Text = row[5].Value.ToString();
                tb_smin.Text = row[6].Value.ToString();
                tb_smax.Text = row[7].Value.ToString();
                cb_unidad.SelectedIndex = obtenerIndice(row[9].Value, cb_unidad);

                ruta_imagen = row[10].Value.ToString().Replace("|", "\\");
                pb_carga.ImageLocation = Path.Combine(Application.StartupPath, ruta_imagen);
            }
        }
Beispiel #4
0
        private void sgc_mp_RowClick(object sender, DevComponents.DotNetBar.SuperGrid.GridRowClickEventArgs e)
        {
            List <GridCell> row = sgc_mp.PrimaryGrid.GridPanel.GetSelectedRows().GetCells();

            if (row.Count != 0)
            {
                tb_id.Text      = row[0].Value.ToString();
                tb_id_prov.Text = row[1].Value.ToString();
                tb_rz.Text      = row[2].Value.ToString();
                tb_nombre.Text  = row[3].Value.ToString();
                tb_desc.Text    = row[4].Value.ToString();
                tb_precio.Text  = row[5].Value.ToString();
                tb_sact.Text    = row[6].Value.ToString();
                tb_smin.Text    = row[7].Value.ToString();
                tb_smax.Text    = row[8].Value.ToString();

                if (row[9].Value.ToString().CompareTo("Litros") == 0)
                {
                    cb_unidad.SelectedIndex = 0;
                }
                else
                {
                    cb_unidad.SelectedIndex = 1;
                }
            }
        }
Beispiel #5
0
        private void sgc_cli_RowClick(object sender, DevComponents.DotNetBar.SuperGrid.GridRowClickEventArgs e)
        {
            List <GridCell> row = sgc_cli.PrimaryGrid.GridPanel.GetSelectedRows().GetCells();

            if (row.Count != 0)
            {
                tb_id.Text        = row[0].Value.ToString();
                tb_rs.Text        = row[1].Value.ToString();
                tb_rfc.Text       = row[2].Value.ToString();
                tb_ciudad.Text    = row[3].Value.ToString();
                tb_cp.Text        = row[4].Value.ToString();
                tb_direccion.Text = row[5].Value.ToString();
                tb_tel.Text       = row[6].Value.ToString();
                tb_email.Text     = row[7].Value.ToString();
            }
        }
Beispiel #6
0
        /// <summary>
        /// 收款-列表行单击触发事件
        ///  Created:20170330(ChengMengjia)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridSK_RowClick(object sender, DevComponents.DotNetBar.SuperGrid.GridRowClickEventArgs e)
        {
            DevComponents.DotNetBar.SuperGrid.GridElement list = gridSK.GetSelectedRows()[0];
            string s = list.ToString();

            s = s.Replace("{", ",");
            s = s.Replace("}", ",");
            string[] listS = s.Split(',');
            txtSBatchNo.Tag     = listS[1].Trim();
            txtSBatchNo.Text    = listS[3].Trim();
            txtExplanation.Text = listS[4] == "<null>" ? "" : listS[4].Trim();
            intSRatio.Value     = listS[5] == "<null>" ? 0 : int.Parse(listS[5].Trim());
            txtAmount.Text      = listS[6] == "<null>" ? "0" : listS[6].Trim();
            txtSCondition.Text  = listS[7] == "<null>" ? "" : listS[7].Trim();
            dtSInDate.Value     = listS[9] == "<null>" ? DateTime.Now : DateTime.Parse(listS[9].Trim());
            DataHelper.SetComboBoxSelectItemByText(cbSFinishStatus, listS[8] == "<null>" ? "-1" : listS[8].Trim());
            txtSRemark.Text = listS[10] == "<null>" ? "" : listS[10].Trim();
        }
Beispiel #7
0
        /// <summary>
        /// 时间变更列表行点击事件
        /// 2017/04/18(zhuguanjun)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void superDate_RowClick(object sender, DevComponents.DotNetBar.SuperGrid.GridRowClickEventArgs e)
        {
            var rows = superDate.PrimaryGrid.GetSelectedRows();

            if (rows.Count != 1)
            {
                MessageBox.Show("请选择一行");
                superDate.PrimaryGrid.ClearSelectedColumns();
                return;
            }
            btnClearFile_Click(null, null);

            GridRow row = (GridRow)rows[0];

            DomainDLL.Change change = new DomainDLL.Change();
            DataTable        files  = new DataTable();

            bll.GetChangeInfo(row.Cells["ID"].Value.ToString(), out change, out files);
            CHANGEDATEID = row.Cells["ID"].Value.ToString();
            if (change != null)
            {
                txtCost.Text    = change.Cost;
                txtName.Text    = change.Name;
                txtPayment.Text = change.Payment;
                txtReason.Text  = change.Reason;
                string[] temp = change.AfterInfo.Split('-');
                if (temp != null && temp.Count() == 2)
                {
                    dtiAfter1.Value = Convert.ToDateTime(temp[0]);
                    dtiAfter2.Value = Convert.ToDateTime(temp[1]);
                }
                string[] tempb = change.BeforeInfo.Split('-');
                if (tempb != null && tempb.Count() == 2)
                {
                    dtiBefore1.Value = Convert.ToDateTime(tempb[0]);
                    dtiBefore2.Value = Convert.ToDateTime(tempb[1]);
                }
                _changedateid = change.ID;//实际id
            }
            superGridControl1.PrimaryGrid.DataSource = files;
        }
Beispiel #8
0
        /// <summary>
        /// Grid点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void superGridControl1_RowClick(object sender, DevComponents.DotNetBar.SuperGrid.GridRowClickEventArgs e)
        {
            var rows = superGridControl1.PrimaryGrid.GetSelectedRows();

            if (rows.Count != 1)
            {
                MessageBox.Show("请选择一行");
                superGridControl1.PrimaryGrid.ClearSelectedColumns();
                return;
            }
            GridRow row = (GridRow)rows[0];

            txtAddr.Text     = row.Cells["Addr"].Value.ToString();
            txtLegalMan.Text = row.Cells["LegalMan"].Value.ToString();
            txtManager.Text  = row.Cells["Manager"].Value.ToString();
            txtName.Text     = row.Cells["Name"].Value.ToString();
            txtTel.Text      = row.Cells["Tel"].Value.ToString();
            ZGZ              = row.Cells["PathZGZ"].Value.ToString();
            YYZZ             = row.Cells["PathYYZZ"].Value.ToString();
            DMZ              = row.Cells["PathDMZ"].Value.ToString();
            ID               = row.Cells["ID"].Value.ToString();
            dtiCREATED.Value = Convert.ToDateTime(row.Cells["CREATED"].Value.ToString());
            LoadFile();
        }
Beispiel #9
0
        private void sgrid_tratamientos_RowClick(object sender, GridRowClickEventArgs e)
        {
            GridRow tupla = (GridRow)sgrid_tratamientos.ActiveRow;

            if (tupla != null)
            {
                desc_esp_t.Text = tupla.Cells[2].Value.ToString();
                SC.llena_detalle("MXTC", tupla[0].Value.ToString(), sgrid_det_med);
            }
        }
Beispiel #10
0
        private void sgrid_sus_RowClick(object sender, GridRowClickEventArgs e)
        {
            GridRow tupla = (GridRow)sgrid_sus.ActiveRow;

            if (tupla != null)
            {
                indicaciones_hist.Text = tupla.Cells[6].Value.ToString();
                SC.llena_detalle("MXRF", tupla[0].Value.ToString(), sgrid_det_medrec);
            }
        }
Beispiel #11
0
        private void sgrid_pr_RowClick(object sender, GridRowClickEventArgs e)
        {
            GridRow tupla = (GridRow)e.GridRow;

            if (tupla != null)
            {
                GridCellCollection celdas = tupla.Cells;
                String codigo = celdas[2].Value.ToString();
                String consultorio = celdas[1].Value.ToString();
                //sgrid_pr.PrimaryGrid.Rows.Clear();
                if (codigo != "")
                    SC.llena_detalle_tratamiento(codigo, consultorio, sgrid_mr, sgrid_rmtos);
                else
                    mensaje_error("Antes de editar una receta debe\nasignar un tratamiento al paciente.");
            }
        }
Beispiel #12
0
 //Interfaz citas
 private void sgrid_pc_RowClick(object sender, GridRowClickEventArgs e)
 {
     boton_si.Enabled = boton_no.Enabled = false;
 }
Beispiel #13
0
        private void gCompanies_RowClick(object sender, GridRowClickEventArgs e)
        {
            if (e.MouseEventArgs.Button == MouseButtons.Right)
            {
                Point pos = gCompanies.PointToClient(Cursor.Position);
                mCompanies.Show(gCompanies, pos);
            }
            else if (e.MouseEventArgs.Button == MouseButtons.Left)
            {
                if (e.GridRow.RowIndex > -1 && e.MouseEventArgs.Button == MouseButtons.Left)
                {
                    GridElement row = gCompanies.PrimaryGrid.Rows[e.GridRow.RowIndex];

                    Program.DB.AddParameter("ID", row.Tag);
                    DataSet c = Program.DB.SelectAll("SELECT * FROM Companies WHERE ID=@ID;");
                    if (c.Tables.Count > 0 && c.Tables[0].Rows.Count > 0)
                    {
                        SharedData.iCompanyID = Convert.ToInt32(c.Tables[0].Rows[0]["ID"]);

                        txtCompanyName.Text = c.Tables[0].Rows[0]["Name"].ToString();
                        txtCompanyTrading.Text = c.Tables[0].Rows[0]["TradingAs"].ToString();
                        txtCompanyReg.Text = c.Tables[0].Rows[0]["RegNumber"].ToString();
                        txtCompanyRegVat.Text = c.Tables[0].Rows[0]["RegNumberVat"].ToString();
                        txtCompanyPhone.Text = c.Tables[0].Rows[0]["Phones"].ToString();
                        txtCompanyEmail.Text = c.Tables[0].Rows[0]["Emails"].ToString();
                        txtCompanyAddress.Text = c.Tables[0].Rows[0]["Addresses"].ToString();
                        txtCompanyNotes.Text = c.Tables[0].Rows[0]["Notes"].ToString();

                        if (c.Tables[0].Rows[0]["Contacts"].ToString().Trim().Length > 0)
                        {
                            AutoCompleteStringCollection asContacts = new AutoCompleteStringCollection();
                            DataSet t = Program.DB.SelectAll("SELECT NameFirst,NameLast FROM Contacts WHERE ID IN (" + c.Tables[0].Rows[0]["Contacts"].ToString() + ");");
                            if (t.Tables.Count > 0 && t.Tables[0].Rows.Count > 0)
                            {
                                foreach (DataRow r in t.Tables[0].Rows)
                                {
                                    asContacts.Add(r["NameFirst"].ToString() + " " + r["NameLast"].ToString());
                                }
                            }
                            txtCompanyContact.AutoCompleteCustomSource = asContacts;
                        }
                    }
                }
            }
        }
Beispiel #14
0
 private void gComments_RowClick(object sender, GridRowClickEventArgs e)
 {
     if (e.MouseEventArgs.Button == MouseButtons.Right)
     {
         Point pos = gComments.PointToClient(Cursor.Position);
         mComments.Show(gComments, pos);
     }
     else if (e.MouseEventArgs.Button == MouseButtons.Left)
     {
         if (rComment != null && e.MouseEventArgs.Button == MouseButtons.Left)
         {
             txtComment.Text = rComment.Cells[2].Value.ToString();
         }
     }
 }
Beispiel #15
0
        private void g_RowClick(object sender, GridRowClickEventArgs e)
        {
            if (e.MouseEventArgs.Button == MouseButtons.Right)
            {
                Point pos = g.PointToClient(Cursor.Position);
                m.Show(g, pos);
            }
            else if (e.MouseEventArgs.Button == MouseButtons.Left)
            {
                if (e.GridRow.RowIndex > -1 && e.MouseEventArgs.Button == MouseButtons.Left)
                {
                    iID = Convert.ToInt32(g.PrimaryGrid.Rows[e.GridRow.RowIndex].Tag);

                    Program.DB.AddParameter("ID", iID);
                    DataSet d = Program.DB.SelectAll("SELECT * FROM WorkSheets WHERE ID=@ID;");
                    if (d.Tables.Count > 0 && d.Tables[0].Rows.Count > 0)
                    {
                        DataRow r = d.Tables[0].Rows[0];

                        txtName.Text = r["Name"].ToString();
                        dtFrom.Text = Convert.ToDateTime(r["Start"].ToString()).ToShortDateString();
                        dtTo.Text = Convert.ToDateTime(r["Finish"].ToString()).ToShortDateString();

                        string[] sRooms = r["Rooms"].ToString().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        foreach (TreeNode n in tv.Nodes)
                        {
                            n.Checked = false;
                            if (sRooms.Contains(n.Tag.ToString()))
                            {
                                n.Checked = true;
                                if (n.Nodes.Count > 0)
                                {
                                    foreach (TreeNode nc in n.Nodes)
                                    {
                                        nc.Checked = false;
                                        if (sRooms.Contains(nc.Tag.ToString()))
                                        {
                                            nc.Checked = true;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Beispiel #16
0
        /// <summary>
        /// 选中一行
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void superGridControl1_RowClick(object sender, DevComponents.DotNetBar.SuperGrid.GridRowClickEventArgs e)
        {
            txtDependency.Clear();
            foreach (var node in advTree1.CheckedNodes)
            {
                node.Checked = false;
            }
            var rows = superGridControl1.PrimaryGrid.GetSelectedRows();

            if (rows.Count != 1)
            {
                MessageBox.Show("请选择一行");
                superGridControl1.PrimaryGrid.ClearSelectedColumns();
                return;
            }
            GridRow row = (GridRow)rows[0];

            cmbtSource.SelectedIndex    = -1;
            cmbtDepenency.SelectedIndex = -1;

            //识别风险
            //来源
            if (!string.IsNullOrEmpty(row.Cells["Source"].Value.ToString()))
            {
                DataHelper.SetTreeSelectByValue(cmbtSource.AdvTree, row.Cells["Source"].Value.ToString());
            }
            txtName.Text = row.Cells["Name"].Value.ToString();
            txtDesc.Text = row.Cells["Desc"].Value.ToString();
            if (!string.IsNullOrEmpty(row.Cells["FindDate"].Value.ToString()))
            {
                dtiFindDate.Value = Convert.ToDateTime(row.Cells["FindDate"].Value.ToString());
            }

            //评估风险
            txtCostTime.Text = row.Cells["CostTime"].Value.ToString();
            string select = string.IsNullOrEmpty(row.Cells["Probability2"].Value.ToString()) ? "0" : row.Cells["Probability2"].Value.ToString();

            DataHelper.SetComboBoxSelectItemByValue(cmbProbability, select);
            string select1 = string.IsNullOrEmpty(row.Cells["Level2"].Value.ToString()) ? "0" : row.Cells["Level2"].Value.ToString();

            DataHelper.SetComboBoxSelectItemByValue(cmbLevel, select1);
            //依赖关系
            if (!string.IsNullOrEmpty(row.Cells["Dependency"].Value.ToString()))
            {
                string[] str = row.Cells["Dependency"].Value.ToString().Split(',');
                DataHelper.SetAdvTreeData(this.advTree1, ProjectId, 0, str);
                string text = ""; //显示值
                string vall = ""; //实际值
                txtDependency.Clear();
                foreach (dynamic node in advTree1.Nodes)
                {
                    if (node.Checked)
                    {
                        text += node.Text + ",";
                        vall += node.Name + ",";
                    }
                    nodetext(node, text, vall);
                }
                this.txtDependency.Text = text;
                this.txtDependency.Tag  = vall;
            }
            //DataHelper.SetTreeSelectByValue(cmbtDepenency.AdvTree, row.Cells["Dependency"].Value.ToString());

            txtAcessDesc.Text = row.Cells["AssessDesc"].Value.ToString();
            if (!string.IsNullOrEmpty(row.Cells["AssessDate"].Value.ToString()))
            {
                dtiAccessDesc.Value = Convert.ToDateTime(row.Cells["AssessDate"].Value.ToString());
            }

            //应对风险
            string select2 = string.IsNullOrEmpty(row.Cells["HandleType2"].Value.ToString()) ? "0" : row.Cells["HandleType2"].Value.ToString();

            DataHelper.SetComboBoxSelectItemByValue(cmbHandleType, select2);
            txtHandleDesc.Text = row.Cells["HandleDesc"].Value.ToString();
            if (!string.IsNullOrEmpty(row.Cells["HandleDate"].Value.ToString()))
            {
                dtiHandleDate.Value = Convert.ToDateTime(row.Cells["HandleDate"].Value.ToString());
            }

            ID = row.Cells["ID"].Value.ToString();
            if (!string.IsNullOrEmpty(row.Cells["CREATED"].Value.ToString()))
            {
                CREATED = Convert.ToDateTime(row.Cells["CREATED"].Value.ToString());
            }
        }
Beispiel #17
0
 /// <summary>
 /// 行点击
 /// 2017/05/08(zhuguanjun)
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void superGridControl1_RowClick(object sender, DevComponents.DotNetBar.SuperGrid.GridRowClickEventArgs e)
 {
 }
Beispiel #18
0
        private void gItems_RowClick(object sender, GridRowClickEventArgs e)
        {
            if (e.MouseEventArgs.Button == MouseButtons.Right)
            {
                Point pos = gItems.PointToClient(Cursor.Position);
                cmItems.Show(gItems, pos);
            }
            else if (e.MouseEventArgs.Button == MouseButtons.Left)
            {
                if (e.GridRow.RowIndex > -1 && e.MouseEventArgs.Button == MouseButtons.Left)
                {
                    iItem = Convert.ToInt32(e.GridRow.Tag);
                    GridElement row = gItems.PrimaryGrid.Rows[e.GridRow.RowIndex];

                    Program.SQL.AddParameter("@id", row.Tag.ToString());
                    DataSet d = Program.SQL.SelectAll("SELECT * FROM items WHERE id=@id;");
                    if (d.Tables.Count > 0 && d.Tables[0].Rows.Count > 0)
                    {
                        DataRow r = d.Tables[0].Rows[0];

                        txtItemACat.Text = r["atex_category"].ToString();
                        txtItemAccess.Text = r["access_req"].ToString();
                        txtItemAGroup.Text = r["area_group"].ToString();
                        txtItemATRating.Text = r["area_trating"].ToString();
                        txtItemAZone.Text = r["area_zone"].ToString();
                        txtItemBarcode.Text = r["barcode"].ToString();
                        txtItemCableID.Text = r["cableid"].ToString();
                        txtItemCE.Text = r["ce_number"].ToString();
                        txtItemDescription.Text = r["description"].ToString();
                        txtItemDLDrawing.Text = r["drawing_device_loop"].ToString();
                        txtItemDType.Text = r["type_device"].ToString();
                        txtItemECert.Text = r["cert_equipment"].ToString();
                        txtItemIP.Text = r["ip_rating"].ToString();
                        txtItemMType.Text = r["type_model"].ToString();
                        txtItemPType.Text = r["type_protection"].ToString();
                        txtItemSerial.Text = r["serial"].ToString();
                        txtItemTag.Text = r["tag"].ToString();
                        txtItemTemp.Text = r["temp_range"].ToString();
                        txtItemTRating.Text = r["trating"].ToString();
                        txtItemCPRef.Text = r["cpref"].ToString();

                        cbxItemAGroup.SelectedIndex = -1;
                        foreach (DevComponents.Editors.ComboItem i in cbxItemAGroup.Items)
                        {
                            if (i.Text == r["atex_group"].ToString())
                            {
                                cbxItemAGroup.SelectedItem = i;
                                break;
                            }
                        }
                        cbxItemAProt.SelectedIndex = -1;
                        foreach (DevComponents.Editors.ComboItem i in cbxItemAProt.Items)
                        {
                            if (i.Text == r["atex_protection"].ToString())
                            {
                                cbxItemAProt.SelectedItem = i;
                                break;
                            }
                        }
                        cbxItemBarrier.SelectedIndex = -1;
                        foreach (DevComponents.Editors.ComboItem i in cbxItemBarrier.Items)
                        {
                            if (i.Text == r["barrier"].ToString())
                            {
                                cbxItemBarrier.SelectedItem = i;
                                break;
                            }
                        }
                        cbxItemDrawing.SelectedIndex = -1;
                        foreach (DevComponents.Editors.ComboItem i in cbxItemDrawing.Items)
                        {
                            if (i.Value.ToString().Equals(r["drawing"].ToString()))
                            {
                                cbxItemDrawing.SelectedItem = i;
                                break;
                            }
                        }
                        cbxItemEGroup.SelectedIndex = -1;
                        foreach (DevComponents.Editors.ComboItem i in cbxItemEGroup.Items)
                        {
                            if (i.Text == r["group_equipment"].ToString())
                            {
                                cbxItemEGroup.SelectedItem = i;
                                break;
                            }
                        }
                        cbxItemEPL.SelectedIndex = -1;
                        foreach (DevComponents.Editors.ComboItem i in cbxItemEPL.Items)
                        {
                            if (i.Text == r["epl"].ToString())
                            {
                                cbxItemEPL.SelectedItem = i;
                                break;
                            }
                        }
                        cbxItemEType.SelectedIndex = -1;
                        foreach (DevComponents.Editors.ComboItem i in cbxItemEType.Items)
                        {
                            if (i.Text == r["type_equipment"].ToString())
                            {
                                cbxItemEType.SelectedItem = i;
                                break;
                            }
                        }
                        cbxItemDrawingHac.SelectedIndex = -1;
                        foreach (DevComponents.Editors.ComboItem i in cbxItemDrawingHac.Items)
                        {
                            if (i.Value.ToString().Equals(r["drawing_hac"].ToString()))
                            {
                                cbxItemDrawingHac.SelectedItem = i;
                                break;
                            }
                        }
                        cbxItemManufacturer.SelectedIndex = -1;
                        foreach (DevComponents.Editors.ComboItem i in cbxItemManufacturer.Items)
                        {
                            if (i.Value.ToString().Equals(r["manufacturer"].ToString()))
                            {
                                cbxItemManufacturer.SelectedItem = i;
                                break;
                            }
                        }
                        cbxItemSuitable.SelectedIndex = -1;
                        foreach (DevComponents.Editors.ComboItem i in cbxItemSuitable.Items)
                        {
                            if (i.Text == r["suitable"].ToString())
                            {
                                cbxItemSuitable.SelectedItem = i;
                                break;
                            }
                        }
                        cbxItemTraceHC.SelectedIndex = -1;
                        foreach (DevComponents.Editors.ComboItem i in cbxItemTraceHC.Items)
                        {
                            if (i.Value.ToString().Equals(r["tracehc"].ToString()))
                            {
                                cbxItemTraceHC.SelectedItem = i;
                                break;
                            }
                        }
                    }
                }
            }
        }
Beispiel #19
0
 private void gBookings_RowClick(object sender, GridRowClickEventArgs e)
 {
     if (e.MouseEventArgs.Button == MouseButtons.Right)
     {
         Point pos = gBookings.PointToClient(Cursor.Position);
         mBookingsList.Show(gBookings, pos);
     }
     else if (e.MouseEventArgs.Button == MouseButtons.Left)
     {
         if (e.GridRow.RowIndex > -1 && e.MouseEventArgs.Button == MouseButtons.Left)
         {
             SharedData.iBookingID = Convert.ToInt32(gBookings.PrimaryGrid.Rows[e.GridRow.RowIndex].Tag);
         }
     }
 }
Beispiel #20
0
        private void gEnquiries_RowClick(object sender, GridRowClickEventArgs e)
        {
            if (e.MouseEventArgs.Button == MouseButtons.Right)
            {
                Point pos = gEnquiries.PointToClient(Cursor.Position);
                mEnquiries.Show(gEnquiries, pos);
            }
            else if (e.MouseEventArgs.Button == MouseButtons.Left)
            {
                if (e.GridRow.RowIndex > -1 && e.MouseEventArgs.Button == MouseButtons.Left)
                {
                    GridElement row = gEnquiries.PrimaryGrid.Rows[e.GridRow.RowIndex];

                    Program.DB.AddParameter("ID", row.Tag);
                    DataSet c = Program.DB.SelectAll("SELECT * FROM Jobs WHERE ID=@ID;");
                    if (c.Tables.Count > 0 && c.Tables[0].Rows.Count > 0)
                    {
                        SharedData.iEnquiryID = Convert.ToInt32(c.Tables[0].Rows[0]["ID"]);
                        lblEnquiryNumberVal.Text = SharedData.iEnquiryID.ToString("D6");

                        txtEnquiryName.Text = c.Tables[0].Rows[0]["EName"].ToString();
                        txtEnquiryCompany.Text = c.Tables[0].Rows[0]["ECompany"].ToString();
                        txtEnquiryPhone.Text = c.Tables[0].Rows[0]["EPhone"].ToString();
                        txtEnquiryEmail.Text = c.Tables[0].Rows[0]["EEmail"].ToString();
                        txtEnquiryInfo.Text = c.Tables[0].Rows[0]["EInfo"].ToString();
                        txtEnquiryReferrer.Text = c.Tables[0].Rows[0]["EReferer"].ToString();
                        txtEnquiryInfoWanted.Text = c.Tables[0].Rows[0]["EInfoWanted"].ToString();
                        
                        foreach (ComboItem ci in cbxEnquiryType.Items)
                        {
                            if (ci.Text.Equals(c.Tables[0].Rows[0]["EType"]))
                            {
                                cbxEnquiryType.SelectedItem = ci;
                            }
                        }

                        foreach (ListViewItem i in lvEnquiryCourses.Items)
                        {
                            i.Checked = false;
                        }

                        if (lvEnquiryDocs.Items.Count > 0)
                        {
                            lvEnquiryDocs.Clear();
                        }

                        string sPath = Properties.Settings.Default.PathToData + @"\" + SharedData.iEnquiryID.ToString("D6") + @"\Enquiry";
                        if (System.IO.Directory.Exists(sPath))
                        {
                            string[] sFiles = System.IO.Directory.GetFiles(sPath);
                            foreach (string sFile in sFiles)
                            {
                                lvEnquiryDocs.Items.Add(System.IO.Path.GetFileNameWithoutExtension(sFile));
                            }
                        }
                    }
                }
            }
        }
Beispiel #21
0
        private void gContacts_RowClick(object sender, GridRowClickEventArgs e)
        {
            if (e.MouseEventArgs.Button == MouseButtons.Right)
            {
                Point pos = gContacts.PointToClient(Cursor.Position);
                mContacts.Show(gContacts, pos);
            }
            else if (e.MouseEventArgs.Button == MouseButtons.Left)
            {
                if (e.GridRow.RowIndex > -1 && e.MouseEventArgs.Button == MouseButtons.Left)
                {
                    GridElement row = gContacts.PrimaryGrid.Rows[e.GridRow.RowIndex];

                    Program.DB.AddParameter("ID", row.Tag);
                    DataSet c = Program.DB.SelectAll("SELECT * FROM Contacts WHERE ID=@ID;");
                    if (c.Tables.Count > 0 && c.Tables[0].Rows.Count > 0)
                    {
                        SharedData.iContactID = Convert.ToInt32(c.Tables[0].Rows[0]["ID"]);

                        txtContactNameTitle.Text = c.Tables[0].Rows[0]["NameTitle"].ToString();
                        txtContactNameFirst.Text = c.Tables[0].Rows[0]["NameFirst"].ToString();
                        txtContactNameLast.Text = c.Tables[0].Rows[0]["NameLast"].ToString();
                        txtContactPhone.Text = c.Tables[0].Rows[0]["Phones"].ToString();
                        txtContactEmail.Text = c.Tables[0].Rows[0]["Emails"].ToString();
                        txtContactAddress.Text = c.Tables[0].Rows[0]["Addresses"].ToString();
                        txtContactNotes.Text = c.Tables[0].Rows[0]["Notes"].ToString();
                    }
                }
            }
        }
Beispiel #22
0
        private void gInspections_RowClick(object sender, GridRowClickEventArgs e)
        {
            if (e.MouseEventArgs.Button == MouseButtons.Right)
            {
                Point pos = gInspections.PointToClient(Cursor.Position);
                cmInspections.Show(gInspections, pos);
            }
            else if (e.MouseEventArgs.Button == MouseButtons.Left)
            {
                if (e.GridRow.RowIndex > -1 && e.MouseEventArgs.Button == MouseButtons.Left)
                {
                    iInspection = Convert.ToInt32(e.GridRow.Tag);
                    GridElement row = gInspections.PrimaryGrid.Rows[e.GridRow.RowIndex];

                    Program.SQL.AddParameter("@id", row.Tag.ToString());
                    DataSet d = Program.SQL.SelectAll("SELECT * FROM inspections WHERE id=@id;");
                    if (d.Tables.Count > 0 && d.Tables[0].Rows.Count > 0)
                    {
                        if (gInspectionAnswers.PrimaryGrid.Rows.Count > 0)
                        {
                            gInspectionAnswers.PrimaryGrid.Rows.Clear();
                        }

                        DataRow r = d.Tables[0].Rows[0];

                        txtInspectionWorkOrder.Text = r["workorder"].ToString();
                        txtInspectionElectrical.Text = r["electrical"].ToString();
                        txtInspectionMechanical.Text = r["mechanical"].ToString();
                        txtInspectionComments.Text = r["comments"].ToString();

                        foreach (DataRow dr in dsItems.Tables[0].Rows)
                        {
                            if (dr["id"].ToString().Equals(r["item"].ToString()))
                            {
                                txtInspectionTag.Text = dr["tag"].ToString().Length > 0 ? dr["tag"].ToString() : (dr["barcode"].ToString().Length > 0 ? dr["barcode"].ToString() : dr["id"].ToString());
                                break;
                            }
                        }

                        foreach (DevComponents.Editors.ComboItem i in cbxInspectionInspector.Items)
                        {
                            if (i.Value.ToString().Equals(r["inspector"].ToString()))
                            {
                                cbxInspectionInspector.SelectedItem = i;
                                break;
                            }
                        }

                        foreach (DevComponents.Editors.ComboItem i in cbxInspectionSchedule.Items)
                        {
                            if (i.Value.ToString().Equals(r["schedule"].ToString()))
                            {
                                cbxInspectionSchedule.SelectedItem = i;
                                break;
                            }
                        }

                        foreach (DevComponents.Editors.ComboItem i in cbxInspectionPriority.Items)
                        {
                            if (i.Value.ToString().Equals(r["priority"].ToString()))
                            {
                                cbxInspectionPriority.SelectedItem = i;
                                break;
                            }
                        }

                        DataSet st = Program.SQL.SelectAll("SELECT questions FROM schedules WHERE id=" + r["schedule"].ToString() + ";");
                        if (st.Tables.Count == 1 && st.Tables[0].Rows.Count > 0 && st.Tables[0].Rows[0]["questions"].ToString() != "")
                        {
                            List<string> lQuestions = new List<string>();
                            string[] sQIDs = st.Tables[0].Rows[0]["questions"].ToString().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                            foreach (string sQ in sQIDs)
                            {
                                string sQuestion = sQ.IndexOf(':') > 0 ? sQ.Substring(0, sQ.IndexOf(':')) : sQ;
                                if (!lQuestions.Contains(sQuestion))
                                {
                                    lQuestions.Add(sQuestion);
                                }
                            }

                            DataSet at = Program.SQL.SelectAll("SELECT id,question,part,answer FROM inspections_answers WHERE inspection=" + iInspection + ";");
                            DataSet ft = Program.SQL.SelectAll("SELECT id,question,part,fault FROM inspections_faults WHERE inspection=" + iInspection + ";");
                            DataSet qt = Program.SQL.SelectAll("SELECT id,section,letter,number,question,parts FROM schedules_questions WHERE id IN (" + string.Join(",", lQuestions) + ");");
                            if (qt.Tables.Count == 1 && qt.Tables[0].Rows.Count > 0)
                            {
                                foreach (DataRow qr in qt.Tables[0].Rows)
                                {
                                    bool bHasFault = false;
                                    if (ft.Tables.Count == 1 && ft.Tables[0].Rows.Count > 0)
                                    {
                                        foreach (DataRow fr in ft.Tables[0].Rows)
                                        {
                                            if (fr["question"].ToString().Equals(qr["id"].ToString()))
                                            {
                                                bHasFault = true;
                                                break;
                                            }
                                        }
                                    }

                                    string sQuestion = qr["question"].ToString(), sAnswer = "";
                                    string sQSec = qr["letter"].ToString(), sQNum = Convert.ToInt32(qr["number"]).ToString("D2");
                                    string[] sParts = qr["parts"] != DBNull.Value ? qr["parts"].ToString().TrimStart('{').TrimEnd('}').Split(new char[] { '}', '{' }, StringSplitOptions.RemoveEmptyEntries) : new string[] { };

                                    foreach (DataRow ar in at.Tables[0].Rows)
                                    {
                                        if (ar["question"].ToString() == qr["id"].ToString())
                                        {
                                            sAnswer = ar["answer"].ToString();
                                            if (sParts.Length > 0)
                                            {
                                                for (int i = 0; i < sParts.Length; i++)
                                                {
                                                    if (ar["part"].ToString() != (i + 1).ToString())
                                                    {
                                                        continue;
                                                    }
                                                    sQuestion = qr["question"].ToString() + " [" + sParts[i] + "]";
                                                    GridRow ir = new GridRow(new object[] { qr["id"].ToString(), sQSec, sQNum, (i + 1), sQuestion, sAnswer });
                                                    ir.Tag = ar["id"].ToString();
                                                    if (bHasFault)
                                                    {
                                                        ir.CellStyles.Default.Background.Color1 = Color.Red;
                                                        ir.CellStyles.Default.Background.Color2 = Color.Red;
                                                        ir.CellStyles.Default.TextColor = Color.White;
                                                    }
                                                    gInspectionAnswers.PrimaryGrid.Rows.Add(ir);
                                                }
                                            }
                                            else
                                            {
                                                GridRow ir = new GridRow(new object[] { qr["id"].ToString(), sQSec, sQNum, "", sQuestion, sAnswer });
                                                ir.Tag = ar["id"].ToString();
                                                if (bHasFault)
                                                {
                                                    ir.CellStyles.Default.Background.Color1 = Color.Red;
                                                    ir.CellStyles.Default.Background.Color2 = Color.Red;
                                                    ir.CellStyles.Default.TextColor = Color.White;
                                                }
                                                gInspectionAnswers.PrimaryGrid.Rows.Add(ir);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Beispiel #23
0
        //Interfaz medicos
        private void sgrid_medicos_RowClick(object sender, GridRowClickEventArgs e)
        {
            GridRow tupla = (GridRow)e.GridRow;
            GridCellCollection celdas = tupla.Cells;

            this.nombre_m.Text = celdas[2].Value.ToString();
            this.app_m.Text = celdas[3].Value.ToString();
            this.apm_m.Text = celdas[4].Value.ToString();
            this.consultorio_m.Text = celdas[1].Value.ToString();
            this.especialidad_m.Text = celdas[6].Value.ToString();

            if (celdas[5].Value.ToString() == "Matutino")
                this.turnom_m.Checked = true;
            else
                this.turnov_m.Checked = true;
        }
Beispiel #24
0
 private void nodelist_RowClick(object sender, GridRowClickEventArgs e)
 {
     string nodename = (string)e.GridPanel.GetCell(e.GridRow.RowIndex, 0).Value;
     updateDrop(nodename,checkBox1.Checked);
 }
Beispiel #25
0
        //Interfaz medicamentos
        private void sgrid_mt_RowClick(object sender, GridRowClickEventArgs e)
        {
            GridRow tupla = (GridRow)e.GridRow;
            GridCellCollection celdas = tupla.Cells;

            this.compuesto_mt.Text = celdas[2].Value.ToString();
            this.tipo_mt.Text = celdas[1].Value.ToString();
            this.presentacion_mt.Text = celdas[3].Value.ToString();
            this.contenido_mt.Text = celdas[4].Value.ToString();
            this.via_admon_mt.Text = celdas[5].Value.ToString();
            this.cbp_mt.Text = celdas[6].Value.ToString();
            this.existencias_mt.Value = Convert.ToInt32(celdas[7].Value.ToString());
        }
Beispiel #26
0
        /// <summary>
        /// 选中
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void superGridControl1_RowClick(object sender, DevComponents.DotNetBar.SuperGrid.GridRowClickEventArgs e)
        {
            var rows = superGridControl1.PrimaryGrid.GetSelectedRows();

            if (rows.Count != 1)
            {
                MessageBox.Show("请选择一行");
                superGridControl1.PrimaryGrid.ClearSelectedColumns();
                return;
            }

            //清空
            ClearAll();

            GridRow                  row          = (GridRow)rows[0];
            Stakeholders             stakeholders = new Stakeholders();
            List <CommunicationFXFA> list         = new List <CommunicationFXFA>();

            bll.GetCommunicationMatix(ProjectId, row.Cells["ID"].Value.ToString(), out stakeholders, out list);
            if (stakeholders != null)
            {
                txtCompanyName.Text   = stakeholders.CompanyName;
                txtDuty.Text          = stakeholders.Duty;
                txtEmail.Text         = stakeholders.Email;
                txtName.Text          = stakeholders.Name;
                txtPosition.Text      = stakeholders.Position;
                txtQQ.Text            = stakeholders.QQ;
                txtTel.Text           = stakeholders.Tel;
                txtWechat.Text        = stakeholders.Wechat;
                cbIspublic.CheckValue = stakeholders.IsPublic;
                dtiCREATED.Value      = stakeholders.CREATED;
                type     = stakeholders.Type;
                sendtype = stakeholders.SendType;
                ID       = stakeholders.ID;
                CREATED  = stakeholders.CREATED;
            }
            if (list != null && list.Count > 0)
            {
                txtAddress1.Text         = list[0].Addr;
                txtContent1.Text         = list[0].Content;
                txtCommunicateDate1.Text = list[0].CommunicateDate;
                txtFrenquence1.Text      = list[0].Frequency;
                DataHelper.SetComboBoxSelectItemByValue(cmbCommunication1, list[0].CID);
                FXFAID1 = list[0].ID;
                if (list.Count > 1)
                {
                    txtAddress2.Text         = list[1].Addr;
                    txtContent2.Text         = list[1].Content;
                    txtConmunicateDate2.Text = list[0].CommunicateDate;
                    txtFrenquence2.Text      = list[0].Frequency;
                    DataHelper.SetComboBoxSelectItemByValue(cmbCommunication2, list[1].CID);
                    FXFAID2 = list[1].ID;
                }
                if (list.Count > 2)
                {
                    txtAddress3.Text         = list[2].Addr;
                    txtContent3.Text         = list[2].Content;
                    txtConmunicateDate3.Text = list[0].CommunicateDate;
                    txtFrenquence3.Text      = list[0].Frequency;
                    DataHelper.SetComboBoxSelectItemByValue(cmbCommunication3, list[2].CID);
                    FXFAID3 = list[2].ID;
                }
            }
        }
Beispiel #27
0
        //Interfaz pacientes
        private void sgrid_pacientes_RowClick(object sender, GridRowClickEventArgs e)
        {
            GridRow tupla = (GridRow)e.GridRow;
            GridCellCollection celdas = tupla.Cells;

            this.consultorio_p.Text = celdas[2].Value.ToString();
            this.nombre_p.Text = celdas[3].Value.ToString();
            this.app_p.Text = celdas[4].Value.ToString();
            this.apm_p.Text = celdas[5].Value.ToString();
            this.fn_p.Text = celdas[6].Value.ToString();
            this.edad_p.Text = celdas[7].Value.ToString();
            this.sexo_p.Text = celdas[8].Value.ToString();
        }
Beispiel #28
0
        /// <summary>
        /// Handles invocation of RowInfoClick events
        /// </summary>
        internal void DoRowInfoClickEvent(GridRow gridRow, MouseEventArgs e)
        {
            if (RowInfoClick != null)
            {
                GridRowClickEventArgs ev = new
                    GridRowClickEventArgs(gridRow.GridPanel, gridRow, RowArea.InRowInfo, e);

                RowInfoClick(this, ev);
            }
        }
Beispiel #29
0
        private void gCourses_RowClick(object sender, GridRowClickEventArgs e)
        {
            if (e.MouseEventArgs.Button == MouseButtons.Right)
            {
                Point pos = gCourses.PointToClient(Cursor.Position);
                mCourses.Show(gCourses, pos);
            }
            else if (e.MouseEventArgs.Button == MouseButtons.Left)
            {
                if (e.GridRow.RowIndex > -1 && e.MouseEventArgs.Button == MouseButtons.Left)
                {
                    GridElement row = gCourses.PrimaryGrid.Rows[e.GridRow.RowIndex];

                    Program.DB.AddParameter("ID", row.Tag);
                    DataSet c = Program.DB.SelectAll("SELECT * FROM Courses WHERE ID=@ID;");
                    if (c.Tables.Count > 0 && c.Tables[0].Rows.Count > 0)
                    {
                        SharedData.iCourseID = Convert.ToInt32(c.Tables[0].Rows[0]["ID"]);

                        txtCourseName.Text = c.Tables[0].Rows[0]["Name"].ToString();
                        txtCourseCert.Text = c.Tables[0].Rows[0]["Certification"].ToString();
                        txtCourseDuration.Text = c.Tables[0].Rows[0]["Duration"].ToString();
                        txtCoursePricing.Text = c.Tables[0].Rows[0]["Pricing"].ToString();
                        txtCourseDetails.Text = c.Tables[0].Rows[0]["Details"].ToString();
                    }
                }
            }
        }
Beispiel #30
0
 private void sgrid_citas_RowClick(object sender, GridRowClickEventArgs e)
 {
     boton_si.Enabled = boton_no.Enabled = true;
 }
Beispiel #31
0
 private void sgc_mp_RowClick(object sender, DevComponents.DotNetBar.SuperGrid.GridRowClickEventArgs e)
 {
     mp_select = sgc_mp.PrimaryGrid.GridPanel.GetSelectedRows().GetCells();
 }