private void RefrescarCeldaGrilla(Infragistics.Win.UltraWinGrid.UltraGridRow oRow)
 {
     oRow.Cells[0].Style                       = Infragistics.Win.UltraWinGrid.ColumnStyle.Button;
     oRow.Cells[0].Appearance.Image            = this.imageList2.Images[0];
     oRow.Cells[0].ButtonAppearance.Image      = this.imageList2.Images[0];
     oRow.Cells[0].ButtonAppearance.TextHAlign = HAlign.Right;
 }
Example #2
0
        private void ultraGridPolicyMetrics_MouseClick(object sender, MouseEventArgs e)
        {
            if (m_allowEdit && e.Button == MouseButtons.Left)
            {
                Infragistics.Win.UIElement selectedElement = ultraGridPolicyMetrics.DisplayLayout.UIElement.ElementFromPoint(new Point(e.X, e.Y));

                if (selectedElement is Infragistics.Win.CheckIndicatorUIElement)
                {
                    Infragistics.Win.UltraWinGrid.UltraGridRow row = selectedElement.SelectableItem as Infragistics.Win.UltraWinGrid.UltraGridRow;
                    if (row != null && row.Cells != null)
                    {
                        // SQLsecure 3.1 (Anshul Aggarwal) - Type of control decides editable columns in the grid.
                        if (m_ControlType == ConfigurePolicyControlType.ImportExportSecurityCheck)
                        {
                            UltraGridCell cell = selectedElement.GetContext(typeof(UltraGridCell)) as UltraGridCell;
                            if (cell != null &&
                                (cell.Column.Key == Utility.Constants.POLICY_METRIC_VALUE_IS_SELECTED))
                            {
                                cell.Value = !((bool)cell.Value);
                                UpdateEnabledCount();
                            }
                        }
                        else
                        {
                            Infragistics.Win.UltraWinGrid.UltraGridCell cell = row.Cells[Utility.Constants.POLICY_METRIC_COLUMN_IS_ENABLED];
                            if (cell != null && cell.Value is bool)
                            {
                                cell.Value = !(bool)cell.Value;
                                UpdateEnabledCount();
                            }
                        }
                    }
                }
            }
        }
        private void grdDataMedicalExamFieldValue_MouseDown(object sender, MouseEventArgs e)
        {
            //if (e.Button == MouseButtons.Right)
            //{
            Point point = new System.Drawing.Point(e.X, e.Y);

            Infragistics.Win.UIElement uiElement = ((Infragistics.Win.UltraWinGrid.UltraGridBase)sender).DisplayLayout.UIElement.ElementFromPoint(point);

            if (uiElement == null || uiElement.Parent == null)
            {
                return;
            }

            Infragistics.Win.UltraWinGrid.UltraGridRow row = (Infragistics.Win.UltraWinGrid.UltraGridRow)uiElement.GetContext(typeof(Infragistics.Win.UltraWinGrid.UltraGridRow));

            if (row != null)
            {
                grdDataMedicalExamFieldValue.Rows[row.Index].Selected = true;
                contextMenuMedicalExamFieldValues.Items["mnuGridNewMedicalExamFieldValue"].Enabled    = true;
                contextMenuMedicalExamFieldValues.Items["mnuGridEditMedicalExamFieldValue"].Enabled   = true;
                contextMenuMedicalExamFieldValues.Items["mnuGridDeleteMedicalExamFieldValue"].Enabled = true;
            }
            else
            {
                contextMenuMedicalExamFieldValues.Items["mnuGridNewMedicalExamFieldValue"].Enabled    = true;
                contextMenuMedicalExamFieldValues.Items["mnuGridEditMedicalExamFieldValue"].Enabled   = false;
                contextMenuMedicalExamFieldValues.Items["mnuGridDeleteMedicalExamFieldValue"].Enabled = false;
            }

            //}
        }
        private void RefrescarCeldaGrilla(Infragistics.Win.UltraWinGrid.UltraGridRow oRow)
        {
            if (Convert.ToDouble(oRow.Cells[4].Value) != 0) // Formulado
            {
                oRow.Cells[4].Style                       = Infragistics.Win.UltraWinGrid.ColumnStyle.Button;
                oRow.Cells[4].Appearance.Image            = this.imageList2.Images[0];
                oRow.Cells[4].ButtonAppearance.Image      = this.imageList2.Images[0];
                oRow.Cells[4].ButtonAppearance.TextHAlign = HAlign.Right;
            }

            if (Convert.ToDouble(oRow.Cells[5].Value) != 0) // Comprometido
            {
                oRow.Cells[5].Style                       = Infragistics.Win.UltraWinGrid.ColumnStyle.Button;
                oRow.Cells[5].Appearance.Image            = this.imageList2.Images[0];
                oRow.Cells[5].ButtonAppearance.Image      = this.imageList2.Images[0];
                oRow.Cells[5].ButtonAppearance.TextHAlign = HAlign.Right;
            }

            if (Convert.ToDouble(oRow.Cells[6].Value) != 0) // Real
            {
                oRow.Cells[6].Style                       = Infragistics.Win.UltraWinGrid.ColumnStyle.Button;
                oRow.Cells[6].Appearance.Image            = this.imageList2.Images[0];
                oRow.Cells[6].ButtonAppearance.Image      = this.imageList2.Images[0];
                oRow.Cells[6].ButtonAppearance.TextHAlign = HAlign.Right;
            }
            if (Convert.ToDouble(oRow.Cells[7].Value) != 0) // Disponible
            {
                oRow.Cells[7].Style                       = Infragistics.Win.UltraWinGrid.ColumnStyle.Button;
                oRow.Cells[7].Appearance.Image            = this.imageList2.Images[0];
                oRow.Cells[7].ButtonAppearance.Image      = this.imageList2.Images[0];
                oRow.Cells[7].ButtonAppearance.TextHAlign = HAlign.Right;
            }
        }
Example #5
0
        private void grdData_MouseDown(object sender, MouseEventArgs e)
        {
            Point point = new System.Drawing.Point(e.X, e.Y);

            Infragistics.Win.UIElement uiElement = ((Infragistics.Win.UltraWinGrid.UltraGridBase)sender).DisplayLayout.UIElement.ElementFromPoint(point);


            if (uiElement == null || uiElement.Parent == null)
            {
                return;
            }

            Infragistics.Win.UltraWinGrid.UltraGridRow row = (Infragistics.Win.UltraWinGrid.UltraGridRow)uiElement.GetContext(typeof(Infragistics.Win.UltraWinGrid.UltraGridRow));
            if (e.Button == MouseButtons.Left)
            {
                if (row != null)
                {
                    _ServicioId         = grdData.Selected.Rows[0].Cells["ServicioId"].Value.ToString();
                    _RutaLarga          = grdData.Selected.Rows[0].Cells["RutaLarga"].Value.ToString();
                    _Paciente           = grdData.Selected.Rows[0].Cells["Paciente"].Value.ToString();
                    _PersonId           = grdData.Selected.Rows[0].Cells["PersonId"].Value.ToString();
                    _ProtocolId         = grdData.Selected.Rows[0].Cells["ProtocolId"].Value.ToString();
                    btnArchivo1.Enabled = true;
                    btnAgregar.Enabled  = true;
                }
            }
            else
            {
                btnArchivo1.Enabled = false;
                btnAgregar.Enabled  = false;
            }
        }
Example #6
0
 private void ultraGridPolicyMetrics_DoubleClickRow(object sender, DoubleClickRowEventArgs e)
 {
     Infragistics.Win.UltraWinGrid.UltraGridRow row = e.Row;
     if (m_allowEdit && row != null && row.Cells != null)
     {
         Infragistics.Win.UltraWinGrid.UltraGridCell cell = row.Cells[Utility.Constants.POLICY_METRIC_COLUMN_IS_ENABLED];
         if (cell != null && cell.Value is bool)
         {
             cell.Value = !(bool)cell.Value;
             UpdateEnabledCount();
         }
     }
 }
Example #7
0
        private void RePrint()
        {
            if (ultraGrid1.ActiveRow != null && ultraGrid1.ActiveRow.Index >= 0)
            {
                if (ultraComboEditor1.SelectedIndex < 0)
                {
                    MessageBox.Show("请选择打印的计量点!");
                    return;
                }
                else
                {
                    try
                    {
                        string pointCode = ultraComboEditor1.SelectedValue.ToString();
                        Infragistics.Win.UltraWinGrid.UltraGridRow uRow    = ultraGrid1.ActiveRow;
                        YGJZJL.CarSip.Client.App.HgLable           hgLable = _carWeightDataManage.GetPrintData(uRow.Cells["FS_WEIGHTNO"].Value.ToString());
                        if (hgLable != null)
                        {
                            string grossTime = uRow.Cells["FD_GROSSDATETIME"].Value.ToString();
                            string tareTime  = uRow.Cells["FD_TAREDATETIME"].Value.ToString();

                            hgLable.WeightPoint = (string.Compare(grossTime, tareTime) > 0) ? uRow.Cells["FS_GROSSPOINT"].Value.ToString() : uRow.Cells["FS_TAREPOINT"].Value.ToString();
                            //hgLable.BarCode = uRow.Cells["FS_WEIGHTNO"].Value.ToString();
                            hgLable.MeasTech     = (string.Compare(grossTime, tareTime) > 0) ? uRow.Cells["FS_GROSSPERSON"].Value.ToString() : uRow.Cells["FS_TAREPERSON"].Value.ToString();
                            hgLable.Type         = YGJZJL.CarSip.Client.App.LableType.CAR;
                            _printer.Data        = hgLable;
                            _printer.PrinterName = pointCode;
                            _printer.Print();

                            //纸张-1
                            _carWeightDataManage.ReducePrinterPaper(pointCode);
                            //int count = 0;
                            //int.TryParse(txtZZ.Text.Trim(), out count);
                            //txtZZ.Text = (--count).ToString();
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(string.Format("未配置{0}的打印机", ultraComboEditor1.Text));
                    }
                }
            }
            else
            {
                MessageBox.Show("请选择需要打印的计量记录!");
            }
        }
 private void RefrescarCeldaGrilla(Infragistics.Win.UltraWinGrid.UltraGridRow oRow)
 {
     //if (Convert.ToInt32(oRow.Cells[7].Value) !=0 )  // Monto Orden
     //{
     //    oRow.Cells[7].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Button;
     //    oRow.Cells[7].Appearance.Image = this.imageList2.Images[0];
     //    oRow.Cells[7].ButtonAppearance.Image = this.imageList2.Images[0];
     //    oRow.Cells[7].ButtonAppearance.TextHAlign = HAlign.Right;
     //}
     if (Convert.ToDouble(oRow.Cells[9].Value) != 0) // Monto Conformidad
     {
         oRow.Cells[8].Style                       = Infragistics.Win.UltraWinGrid.ColumnStyle.Button;
         oRow.Cells[8].Appearance.Image            = this.imageList2.Images[0];
         oRow.Cells[8].ButtonAppearance.Image      = this.imageList2.Images[0];
         oRow.Cells[8].ButtonAppearance.TextHAlign = HAlign.Right;
     }
 }
Example #9
0
 private void ultraGridPolicyMetrics_KeyDown(object sender, KeyEventArgs e)
 {
     if (m_allowEdit && e.KeyCode == Keys.Space)
     {
         if (ultraGridPolicyMetrics.Selected.Rows.Count > 0)
         {
             Infragistics.Win.UltraWinGrid.UltraGridRow row = ultraGridPolicyMetrics.Selected.Rows[0];
             if (row != null && row.Cells != null)
             {
                 Infragistics.Win.UltraWinGrid.UltraGridCell cell = row.Cells[Utility.Constants.POLICY_METRIC_COLUMN_IS_ENABLED];
                 if (cell != null && cell.Value is bool)
                 {
                     cell.Value = !(bool)cell.Value;
                     UpdateEnabledCount();
                 }
             }
         }
     }
 }
Example #10
0
        private void ultraGrid1_Click(object sender, EventArgs e)
        {
            if (ultraGrid1.ActiveRow == null || ultraGrid1.ActiveRow.Index < 0)
            {
                return;
            }
            switch (m_DataType)
            {
            case "Material":
                this.tbMaterialName.Text = ultraGrid1.ActiveRow.Cells["FS_MATERIALNAME"].Text.Trim();
                this.tbMaterialCode.Text = ultraGrid1.ActiveRow.Cells["FS_WL"].Text.Trim();
                break;

            case "Receiver":
                this.tbMaterialName.Text = ultraGrid1.ActiveRow.Cells["FS_MEMO"].Text.Trim();
                this.tbMaterialCode.Text = ultraGrid1.ActiveRow.Cells["FS_SH"].Text.Trim();
                break;

            case "Sender":
                this.tbMaterialName.Text = ultraGrid1.ActiveRow.Cells["FS_SUPPLIERNAME"].Text.Trim();
                this.tbMaterialCode.Text = ultraGrid1.ActiveRow.Cells["FS_GY"].Text.Trim();
                break;

            case "Trans":
                this.tbMaterialName.Text = ultraGrid1.ActiveRow.Cells["FS_TRANSNAME"].Text.Trim();
                this.tbMaterialCode.Text = ultraGrid1.ActiveRow.Cells["FS_CY"].Text.Trim();
                break;

            case "Provider":
                Infragistics.Win.UltraWinGrid.UltraGridRow uRow = ultraGrid1.ActiveRow;
                this.tbMaterialName.Text = uRow.Cells["FS_PROVIDERNAME"].Text.Trim();
                this.tbMaterialCode.Text = uRow.Cells["FS_SP"].Text.Trim();
                break;

            default:
                break;
            }
        }
Example #11
0
        private void grdDataServiceComponent_MouseDown(object sender, MouseEventArgs e)
        {
            Point point = new System.Drawing.Point(e.X, e.Y);

            Infragistics.Win.UIElement uiElement = ((Infragistics.Win.UltraWinGrid.UltraGridBase)sender).DisplayLayout.UIElement.ElementFromPoint(point);

            if (uiElement == null || uiElement.Parent == null)
            {
                return;
            }

            Infragistics.Win.UltraWinGrid.UltraGridRow row = (Infragistics.Win.UltraWinGrid.UltraGridRow)uiElement.GetContext(typeof(Infragistics.Win.UltraWinGrid.UltraGridRow));

            if (row != null)
            {
                grdDataServiceComponent.Rows[row.Index].Selected    = true;
                contextMenuStrip2.Items["btnRemoverEsamen"].Enabled = true;
            }
            else
            {
                contextMenuStrip2.Items["btnRemoverEsamen"].Enabled = false;
            }
        }
        private void grdDataPeople_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                System.Drawing.Point       point     = new System.Drawing.Point(e.X, e.Y);
                Infragistics.Win.UIElement uiElement = ((Infragistics.Win.UltraWinGrid.UltraGridBase)sender).DisplayLayout.UIElement.ElementFromPoint(point);

                if (uiElement == null || uiElement.Parent == null)
                {
                    return;
                }

                // Capturar valor de una celda especifica al hace click derecho sobre la celda k se quiere su valor
                Infragistics.Win.UltraWinGrid.UltraGridCell cell = (Infragistics.Win.UltraWinGrid.UltraGridCell)uiElement.GetContext(typeof(Infragistics.Win.UltraWinGrid.UltraGridCell));
                Infragistics.Win.UltraWinGrid.UltraGridRow  row  = (Infragistics.Win.UltraWinGrid.UltraGridRow)uiElement.GetContext(typeof(Infragistics.Win.UltraWinGrid.UltraGridRow));

                if (row != null)
                {
                    grdDataPeople.Rows[row.Index].Selected = true;
                    _IndexgrdDataPeople = row.Index;
                }
            }
        }
Example #13
0
        private void grdDataCalendar_MouseDown(object sender, MouseEventArgs e)
        {
            Point point = new System.Drawing.Point(e.X, e.Y);

            Infragistics.Win.UIElement uiElement = ((Infragistics.Win.UltraWinGrid.UltraGridBase)sender).DisplayLayout.UIElement.ElementFromPoint(point);


            if (uiElement == null || uiElement.Parent == null)
            {
                return;
            }

            Infragistics.Win.UltraWinGrid.UltraGridRow row = (Infragistics.Win.UltraWinGrid.UltraGridRow)uiElement.GetContext(typeof(Infragistics.Win.UltraWinGrid.UltraGridRow));
            if (e.Button == MouseButtons.Right)
            {
                if (row != null)
                {
                    _RowIndexgrdDataCalendar = row.Index;
                    grdDataCalendar.Rows[row.Index].Selected = true;
                    int CalendarStatusId = int.Parse(grdDataCalendar.Selected.Rows[0].Cells["i_CalendarStatusId"].Value.ToString());
                    int LineStatusId     = int.Parse(grdDataCalendar.Selected.Rows[0].Cells["i_LineStatusId"].Value.ToString());
                    int ServiceStatusId  = int.Parse(grdDataCalendar.Selected.Rows[0].Cells["i_ServiceStatusId"].Value.ToString());
                    _PacientId = grdDataCalendar.Selected.Rows[0].Cells["v_PersonId"].Value.ToString();

                    if (CalendarStatusId == (int)Common.CalendarStatus.Agendado)
                    {
                        contextMenuStrip1.Items["mnuCancelCalendar"].Enabled   = true;
                        contextMenuStrip1.Items["mnuFinCircuito"].Enabled      = false;
                        contextMenuStrip1.Items["mnuComenzarCircuito"].Enabled = true;
                        contextMenuStrip1.Items["mnuReagendarCita"].Enabled    = true;
                    }
                    else if (CalendarStatusId == (int)Common.CalendarStatus.Atendido)
                    {
                        contextMenuStrip1.Items["mnuCancelCalendar"].Enabled   = false;
                        contextMenuStrip1.Items["mnuFinCircuito"].Enabled      = true;
                        contextMenuStrip1.Items["mnuComenzarCircuito"].Enabled = false;
                        contextMenuStrip1.Items["mnuReagendarCita"].Enabled    = false;
                    }
                    else if (CalendarStatusId == (int)Common.CalendarStatus.Cancelado)
                    {
                        contextMenuStrip1.Items["mnuCancelCalendar"].Enabled   = false;
                        contextMenuStrip1.Items["mnuFinCircuito"].Enabled      = false;
                        contextMenuStrip1.Items["mnuComenzarCircuito"].Enabled = false;
                        contextMenuStrip1.Items["mnuReagendarCita"].Enabled    = true;
                    }

                    if (LineStatusId == (int)Common.LineStatus.FueraCircuito && CalendarStatusId == (int)Common.CalendarStatus.Atendido)
                    {
                        contextMenuStrip1.Items["mnuCancelCalendar"].Enabled   = false;
                        contextMenuStrip1.Items["mnuFinCircuito"].Enabled      = false;
                        contextMenuStrip1.Items["mnuComenzarCircuito"].Enabled = false;
                        contextMenuStrip1.Items["mnuReagendarCita"].Enabled    = false;
                    }

                    OperationResult             objOperationResult   = new OperationResult();
                    ServiceBL                   objServiceBL         = new ServiceBL();
                    List <ServiceComponentList> ListServiceComponent = new List <ServiceComponentList>();
                    _strServicelId       = grdDataCalendar.Selected.Rows[0].Cells[5].Value.ToString();
                    ListServiceComponent = objServiceBL.GetServiceComponents(ref objOperationResult, _strServicelId);
                    grdDataServiceComponent.DataSource = ListServiceComponent;
                }
                else
                {
                    contextMenuStrip1.Items["mnuCancelCalendar"].Enabled   = false;
                    contextMenuStrip1.Items["mnuFinCircuito"].Enabled      = false;
                    contextMenuStrip1.Items["mnuComenzarCircuito"].Enabled = false;
                    contextMenuStrip1.Items["mnuReagendarCita"].Enabled    = false;
                }
            }

            if (e.Button == MouseButtons.Left)
            {
                if (row != null)
                {
                    OperationResult             objOperationResult   = new OperationResult();
                    ServiceBL                   objServiceBL         = new ServiceBL();
                    List <ServiceComponentList> ListServiceComponent = new List <ServiceComponentList>();
                    PacientBL                   objPacientBL         = new PacientBL();
                    personDto                   objpersonDto         = new personDto();
                    _PacientId = grdDataCalendar.Selected.Rows[0].Cells["v_PersonId"].Value.ToString();
                    //string strServicelId = grdDataCalendar.Selected.Rows[0].Cells[5].Value.ToString();
                    _strServicelId       = grdDataCalendar.Selected.Rows[0].Cells[5].Value.ToString();
                    ListServiceComponent = objServiceBL.GetServiceComponents(ref objOperationResult, _strServicelId);
                    grdDataServiceComponent.DataSource = ListServiceComponent;

                    txtTrabajador.Text = grdDataCalendar.Selected.Rows[0].Cells["v_Pacient"].Value.ToString();

                    if (grdDataCalendar.Selected.Rows[0].Cells["v_WorkingOrganizationName"].Value != null)
                    {
                        WorkingOrganization.Text = grdDataCalendar.Selected.Rows[0].Cells["v_WorkingOrganizationName"].Value.ToString();
                    }

                    txtProtocol.Text = grdDataCalendar.Selected.Rows[0].Cells["v_ProtocolName"].Value == null ? "" : grdDataCalendar.Selected.Rows[0].Cells["v_ProtocolName"].Value.ToString();
                    txtService.Text  = grdDataCalendar.Selected.Rows[0].Cells["v_ServiceName"].Value.ToString();

                    if (grdDataCalendar.Selected.Rows[0].Cells["v_ProtocolId"].Value != null)
                    {
                        if (grdDataCalendar.Selected.Rows[0].Cells["v_ProtocolId"].Value.ToString() == Constants.CONSULTAMEDICA)
                        {
                            txtTypeESO.Text = "";
                        }
                        else
                        {
                            txtTypeESO.Text = grdDataCalendar.Selected.Rows[0].Cells["v_EsoTypeName"].Value.ToString();
                        }
                    }

                    _personName = grdDataCalendar.Selected.Rows[0].Cells["v_Pacient"].Value.ToString();

                    objpersonDto = objPacientBL.GetPerson(ref objOperationResult, _PacientId);

                    Byte[] ooo = objpersonDto.b_PersonImage;

                    if (ooo == null)
                    {
                        pbImage.Image = Resources.nofoto;
                    }
                    else
                    {
                        pbImage.Image = Common.Utils.BytesArrayToImageOficce(ooo, pbImage);
                        _personImage  = ooo;
                    }

                    // Huella y Firma
                    if (objpersonDto.b_FingerPrintImage == null)
                    {
                        txtExisteHuella.Text      = "NO REGISTRADO";
                        txtExisteHuella.ForeColor = Color.Red;
                    }
                    else
                    {
                        txtExisteHuella.Text      = "REGISTRADO";
                        txtExisteHuella.ForeColor = Color.DarkBlue;
                    }

                    // Firma
                    if (objpersonDto.b_RubricImage == null)
                    {
                        txtExisteFirma.Text      = "NO REGISTRADO";
                        txtExisteFirma.ForeColor = Color.Red;
                    }
                    else
                    {
                        txtExisteFirma.Text      = "REGISTRADO";
                        txtExisteFirma.ForeColor = Color.DarkBlue;
                    }
                }
            }
        }
        private bool RetrieveValuesFromUI()
        {
            bool bAllowContinue = true;

            if (Visible && !m_InternalUpdate)
            {
                //if(!OKToSave())
                //{
                //    return false;
                //}
                Infragistics.Win.UltraWinGrid.UltraGridRow row = ultraGridPolicyMetrics.ActiveRow;
                if (row != null)
                {
                    if (row.IsDataRow)
                    {
                        bool refreshSort = false;
                        if (row.Cells[colReportKey].Value.ToString() != textBox_ReportKey.Text ||
                            (radioButton_SeverityLow.Checked && row.Cells[colSeverity].Value.ToString() != "1") ||
                            (radioButton_SeverityMedium.Checked && row.Cells[colSeverity].Value.ToString() != "2") ||
                            (radioButton_SeverityCritical.Checked && row.Cells[colSeverity].Value.ToString() != "3"))
                        {
                            refreshSort = true;
                        }

                        row.Cells[colReportText].Value = textBox_ReportText.Text;
                        row.Cells[colReportKey].Value  = textBox_ReportKey.Text;

                        if (radioButton_SeverityLow.Checked)
                        {
                            row.Cells[colSeverity].Value = "1";
                        }
                        else if (radioButton_SeverityMedium.Checked)
                        {
                            row.Cells[colSeverity].Value = "2";
                        }
                        else
                        {
                            row.Cells[colSeverity].Value = "3";
                        }

                        StringBuilder values = new StringBuilder();
                        if (groupBox_CriteriaMultiple.Visible)
                        {
                            if (checkBox1.Checked)
                            {
                                values.Append("'");
                                values.Append(checkBox1.Tag);
                                values.Append("'");
                            }
                            if (checkBox2.Checked)
                            {
                                if (values.Length > 0)
                                {
                                    values.Append(",");
                                }
                                values.Append("'");
                                values.Append(checkBox2.Tag);
                                values.Append("'");
                            }
                            if (checkBox3.Checked)
                            {
                                if (values.Length > 0)
                                {
                                    values.Append(",");
                                }
                                values.Append("'");
                                values.Append(checkBox3.Tag);
                                values.Append("'");
                            }
                            if (checkBox4.Checked)
                            {
                                if (values.Length > 0)
                                {
                                    values.Append(",");
                                }
                                values.Append("'");
                                values.Append(checkBox4.Tag);
                                values.Append("'");
                            }
                            if (checkBox5.Checked)
                            {
                                if (values.Length > 0)
                                {
                                    values.Append(",");
                                }
                                values.Append("'");
                                values.Append(checkBox5.Tag);
                                values.Append("'");
                            }
                            if (checkBox6.Checked)
                            {
                                if (values.Length > 0)
                                {
                                    values.Append(",");
                                }
                                values.Append("'");
                                values.Append(checkBox6.Tag);
                                values.Append("'");
                            }
                            if (checkBox7.Checked)
                            {
                                if (values.Length > 0)
                                {
                                    values.Append(",");
                                }
                                values.Append("'");
                                values.Append(checkBox7.Tag);
                                values.Append("'");
                            }
                            if (checkBox8.Checked)
                            {
                                if (values.Length > 0)
                                {
                                    values.Append(",");
                                }
                                values.Append("'");
                                values.Append(checkBox8.Tag);
                                values.Append("'");
                            }
                        }
                        else if (groupBox_TriggerSingle.Visible)
                        {
                            if (radioButton1.Checked)
                            {
                                values.Append("'");
                                values.Append(radioButton1.Tag);
                                values.Append("'");
                            }
                            if (radioButton2.Checked)
                            {
                                values.Append("'");
                                values.Append(radioButton2.Tag);
                                values.Append("'");
                            }
                            if (radioButton3.Checked)
                            {
                                values.Append("'");
                                values.Append(radioButton3.Tag);
                                values.Append("'");
                            }
                            if (radioButton4.Checked)
                            {
                                values.Append("'");
                                values.Append(radioButton4.Tag);
                                values.Append("'");
                            }
                            if (radioButton5.Checked)
                            {
                                values.Append("'");
                                values.Append(radioButton5.Tag);
                                values.Append("'");
                            }
                            if (radioButton6.Checked)
                            {
                                values.Append("'");
                                values.Append(radioButton6.Tag);
                                values.Append("'");
                            }
                            if (radioButton7.Checked)
                            {
                                values.Append("'");
                                values.Append(radioButton7.Tag);
                                values.Append("'");
                            }
                            if (radioButton8.Checked)
                            {
                                values.Append("'");
                                values.Append(radioButton8.Tag);
                                values.Append("'");
                            }
                        }
                        else if (groupBox_CriteriaUserEnterMultiple.Visible)
                        {
                            foreach (ListViewItem i in listView_MultiSelect.Items)
                            {
                                if (values.Length > 0)
                                {
                                    values.Append(",");
                                }
                                values.Append("'");
                                values.Append(i.Text);
                                values.Append("'");
                            }
                        }
                        else if (groupBox_CriteriaUserEnterSingle.Visible)
                        {
                            values.Append("'");
                            values.Append(textBox_UserEnterSingle.Text);
                            values.Append("'");
                        }

                        row.Cells[colSeverityValues].Value = values.ToString();

                        if (refreshSort)
                        {
                            ultraGridPolicyMetrics.DisplayLayout.Bands[0].SortedColumns.RefreshSort(true);
                        }

                        UpdateEnabledCount();
                    }
                }
            }

            return(bAllowContinue);
        }
Example #15
0
        private void btnToss_Click(object sender, System.EventArgs e)
        {
            Common.Domain.IDomainDataProvider erpDataProvider = Common.DomainDataProvider.DomainDataProviderManager.DomainDataProvider(DBName.ERP);
            //ugrdREC.Selected


            ERPSRMX srmx = new ERPSRMX();

            string factory = "PO";

            if (System.Configuration.ConfigurationSettings.AppSettings["InvFactory"] != null)
            {
                factory = System.Configuration.ConfigurationSettings.AppSettings["InvFactory"].Trim();
            }


            InventoryFacade mesFac = new InventoryFacade(DataProvider);
            //Laws Lu,2006/11/13 uniform system collect date
            DBDateTime dbDateTime;

            dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider);

            DateTime workDateTime = FormatHelper.ToDateTime(dbDateTime.DBDate, dbDateTime.DBTime);


            srmx.SRMXNO = mesFac.GetMaxSRNO(int.Parse(workDateTime.Year.ToString().Substring(2, 2)), factory);

            ArrayList arSRMX = new ArrayList();

//			foreach(Infragistics.Win.UltraWinGrid.UltraGridRow row in ugrdREC.Rows)
            for (int iGridRowLoopIndex = 0; iGridRowLoopIndex < ugrdREC.Rows.Count; iGridRowLoopIndex++)
            {
                Infragistics.Win.UltraWinGrid.UltraGridRow row = ugrdREC.Rows[iGridRowLoopIndex];
                if (row.Selected == true)
                {
                    DataProvider.BeginTransaction();
                    erpDataProvider.BeginTransaction();

                    try
                    {
                        srmx.ENDATE = FormatHelper.TODateInt(workDateTime);
                        string mocode = row.Cells["工单号"].Text.Trim().Substring(5, row.Cells["工单号"].Text.Trim().Length - 5);
                        srmx.SONO   = Convert.ToInt32(mocode);
                        srmx.FINQTY = Convert.ToDecimal(row.Cells["数量"].Text.Trim());
                        srmx.SRPROD = row.Cells["产品代码"].Text.Trim();
                        srmx.SRDESC = row.Cells["产品代码"].Text.Trim();
                        srmx.UID    = ApplicationService.Current().UserCode;
                        srmx.STA    = "F";


                        if (!arSRMX.Contains(srmx.SRMXNO + srmx.SONO))
                        {
                            arSRMX.Add(srmx.SRMXNO + srmx.SONO.ToString());
                            //向ERP中插入数据
                            erpDataProvider.Insert(srmx);
                        }
                        else
                        {
                            erpDataProvider.CustomExecute(new SQLCondition("UPDATE SRMX SET \"uid\" = '"
                                                                           + ApplicationService.Current().UserCode
                                                                           + "',FINQTY = FINQTY + "
                                                                           + Convert.ToDecimal(row.Cells["数量"].Text.Trim())
                                                                           + ",ENDATE = " + FormatHelper.TODateInt(workDateTime)
                                                                           + " WHERE SRMXNO = '" + srmx.SRMXNO + "' AND SONO = " + srmx.SONO));
                        }

                        object objErp = mesFac.GetERPINVInterface(
                            row.Cells["入库单号"].Text.Trim(),
                            row.Cells["工单号"].Text.Trim(),
                            Web.Helper.INVERPType.INVERPTYPE_NEW
                            , InventoryFacade.NewSRNO);

                        if (objErp != null)
                        {
                            ERPINVInterface erp = objErp as ERPINVInterface;
                            //更新系统数据
                            erp.SRNO       = srmx.SRMXNO;
                            erp.UPLOADUSER = ApplicationService.Current().UserCode;
                            erp.UPLOADDATE = FormatHelper.TODateInt(workDateTime);
                            erp.UPLOADTIME = FormatHelper.TOTimeInt(workDateTime);
                            erp.STATUS     = Web.Helper.INVERPType.INVERPTYPE_PROCESSED;
                            mesFac.UpdateERPINVInterfaceStatus(erp);
                        }

                        DataProvider.CommitTransaction();
                        erpDataProvider.CommitTransaction();
                    }
                    catch (Exception ex)
                    {
                        Log.Error(ex.Message);
                        ApplicationRun.GetInfoForm().Add(new UserControl.Message(ex));

                        erpDataProvider.RollbackTransaction();
                        DataProvider.RollbackTransaction();
                    }
                    finally
                    {
                        ((SQLDomainDataProvider)DataProvider).PersistBroker.CloseConnection();
                        ((SQLDomainDataProvider)erpDataProvider).PersistBroker.CloseConnection();
                    }
                }
            }
            ugrdREC_InitializeLayout(null, null);
            InitializeGrid();
            InitialForm();
        }
 private void MostrarIconoGrilla_Row(Infragistics.Win.UltraWinGrid.UltraGridRow oRow)
 {
     oRow.Cells[0].Style                  = Infragistics.Win.UltraWinGrid.ColumnStyle.Button;
     oRow.Cells[0].Appearance.Image       = this.imageList2.Images[3];
     oRow.Cells[0].ButtonAppearance.Image = this.imageList2.Images[3];
 }