Beispiel #1
0
        /// <summary>
        /// Row bound
        /// </summary>
        /// <param name="sender">The source of event.</param>
        /// <param name="e">The <see cref="System.Web.UI.WebControls.GridViewRowEventArgs"/> instance containing the event data.</param>
        protected void gdPages_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                System.Data.DataRowView drv = (System.Data.DataRowView)e.Row.DataItem;

                FullPageName = string.Empty;
                AppendFullPageName(Convert.ToInt32(((System.Web.UI.WebControls.Label)e.Row.FindControl("lblPageID")).Text));
                if (FullPageName.StartsWith("http://") || FullPageName.StartsWith("https://"))
                {
                    ((System.Web.UI.WebControls.Label)e.Row.FindControl("lblPageFullName")).Text = FullPageName;
                }
                else
                {
                    ((System.Web.UI.WebControls.Label)e.Row.FindControl("lblPageFullName")).Text = "/" + FullPageName;
                }

                if (e.Row.RowState == DataControlRowState.Normal || e.Row.RowState == DataControlRowState.Alternate)
                {
                    var frUrl = drv["FriendlyUrl"].ToString();
                    System.Web.UI.WebControls.Label lblPageFriendlyUrl = ((System.Web.UI.WebControls.Label)e.Row.FindControl("lblPageFriendlyUrl"));
                    lblPageFriendlyUrl.Text = (frUrl.StartsWith("/") || frUrl.StartsWith("http://") || frUrl.StartsWith("https://") ? frUrl : "/" + frUrl) + lblFriendlyExtension.Text;
                }
            }
        }
Beispiel #2
0
        protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is Telerik.Web.UI.GridDataItem)
            {
                Telerik.Web.UI.GridDataItem item = (Telerik.Web.UI.GridDataItem)e.Item;
                System.Data.DataRowView     row  = (System.Data.DataRowView)item.DataItem;

                ////item cell 6.Progress bar. Update Progress bar.
                int angka1 = Convert.ToInt32(row.Row["TOTAL_RKP"]);
                int angka2 = Convert.ToInt32(row.Row["TOTAL_EMPLOYEE"]);
                Telerik.Web.UI.RadProgressBar rpb = (Telerik.Web.UI.RadProgressBar)item.Cells[6].FindControl("ProgressBar1");

                if (rpb != null)
                {
                    float persentase = 0;
                    if (angka2 != 0)
                    {
                        persentase = ((float)angka1 / (float)angka2) * 100;
                    }
                    rpb.Value = persentase;
                    rpb.Label = ((int)persentase).ToString() + "%";
                    int groupClass = (int)System.Math.Floor(persentase / 20) * 20;
                    rpb.CssClass = "ProgressBar" + groupClass.ToString();
                }

                //Telerik.Web.UI.GridItem item = (Telerik.Web.UI.GridItem)e.Item;
                //for (int i = 0; i < item.Cells.Count; i++)
                //{
                //    item.Cells[i].Text = i.ToString() + "-" + item.Cells[i].Text + "-" + item.ItemType.ToString();
                //}
            }
        }
        private void btnGenAll_Click(object sender, RoutedEventArgs e)
        {
            BrowserPath = this.txtBrowserPath.Text.Trim();
            // FilePath = txtFilePath.Text.Trim
            var cur = System.Windows.Application.Current.MainWindow.Cursor;
            var Gen = new API.GenXDT(Environment.ExpandEnvironmentVariables(this.txtFilePath.Text.Trim()), My.MySettingsProperty.Settings.XslFileName);

            FilePath = Gen.XMLfilePath;       // if the UI-supplied txtFilePath does not exist, Gen will try to create a default one.  This reassigns Filepath to the default
            this.txtFilePath.Text = FilePath; // makes the same change in the UI
            if (Microsoft.VisualBasic.FileIO.FileSystem.DirectoryExists(FilePath))
            {
                var templatesMap = new Dictionary <string, string>();
                System.Windows.Application.Current.MainWindow.Cursor = Cursors.Wait;
                foreach (var node in this.TreeListView1.Nodes.Where(n => n.IsChecked == true))
                {
                    System.Data.DataRowView dataRowView = node.Content as System.Data.DataRowView;
                    Debug.Print(dataRowView[0].ToString() + Constants.vbCrLf + dataRowView[1].ToString() + Constants.vbCrLf + dataRowView[2].ToString());
                    templatesMap.Add(dataRowView[0].ToString(), dataRowView[2].ToString()); // cols 0 & 3
                }

                Gen.MakeXDTsFromTemplateMap(templatesMap, FilePath, this.chkCreateHTML.IsChecked == true);
            }
            else
            {
                Interaction.Beep();
                Interaction.MsgBox("The file path for saving SDC XML files does not exist at: " + FilePath, MsgBoxStyle.Exclamation, "Folder does not exist");
            }

            System.Windows.Application.Current.MainWindow.Cursor = cur;
        }
Beispiel #4
0
        private bool SetParam()
        {
            if (Group.SelectedItem == null || Nutdef.SelectedItem == null)
            {
                MessageBox.Show("The Comboboxes are not set!!!");
                return(false);
            }


            //HACK: change to a list ....
            //System.Data.DataRowView rv0 = (System.Data.DataRowView)Group.SelectedItem;
            //sg = (Sr25DataSet.Fd_GrpRow)rv0.Row;
            if (sg == null)
            {
                sg = new Ext_Groups((int)Group.SelectedValue, Group.Text);
            }
            else
            {
                sg.FdGrp_Desc = Group.Name;
                sg.FdGrp_CD   = (int)Group.SelectedValue;
            }

            System.Data.DataRowView rv1 = (System.Data.DataRowView)Nutdef.SelectedItem;

            ndr = (Sr25DataSet.NUT_DEFRow)rv1.Row;

            if (ndr == null)
            {
                return(false);
            }

            return(true);
        }
Beispiel #5
0
        protected void DataList3_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataListItem            i = e.Item;
                System.Data.DataRowView r = ((System.Data.DataRowView)e.Item.DataItem); // 'r' represents the next row in the table that has been passed here via the 'bind' function.

                // Find the label controls that are associated with this data item.

                Label UsersID_LBL       = (Label)e.Item.FindControl("UsersID_Label");       // Find the ID Label.
                Label Usersname_LBL     = (Label)e.Item.FindControl("Usersname_Label");     // Find the real name Label.
                Label UsersUsername_LBL = (Label)e.Item.FindControl("UsersUsername_Label"); // Find the username Label.
                Label UsersPassword_LBL = (Label)e.Item.FindControl("UsersPassword_Label"); // Find the password Label.
                Label UsersUsertype_LBL = (Label)e.Item.FindControl("UsersUserType_Label"); // Find the password Label.



                UsersID_LBL.Text       = r["ID"].ToString();       // ID
                Usersname_LBL.Text     = r["Name"].ToString();     // real name
                UsersUsername_LBL.Text = r["Username"].ToString(); // username
                UsersPassword_LBL.Text = r["Password"].ToString(); // username
                UsersUsertype_LBL.Text = r["UserType"].ToString(); // user type



                /* Button ViewButton = (Button)e.Item.FindControl("ViewButton");   // Find the button in this row.
                 * ViewButton.CommandArgument = i.ItemIndex.ToString();    // Allocate the row number to the 'command argument' property of the button, so we can identify which button was pressed later.
                 * ViewButton.CommandName = "View"; */
            }
        }
        protected override object GetSnippets(System.Data.DataRowView row, string q, int snippetLength, string highlightTag, int tabChars)
        {
            string snippet = base.GetSnippet(row, q, snippetLength, highlightTag, tabChars).ToString();

            Line[] lines = GetLines(snippet);

            List <object> snippets  = new List <object>();
            string        firstWord = q.Split('%')[0];
            int           start     = 0;
            int           i         = 0;

            while (start < snippet.Length)
            {
                i = snippet.IndexOf(firstWord, start, StringComparison.OrdinalIgnoreCase);

                if (i < 0)
                {
                    break;
                }

                Line line = GetLine(lines, i);
                snippets.Add(new { snippet = GetSnippet(snippetLength, snippet, firstWord, highlightTag, i), line = line.Number, column = GetColumn(i, line, tabChars) });

                start = i + firstWord.Length;
            }

            return(snippets.ToArray());
        }
Beispiel #7
0
        protected void DataList1_OnRenderCell(object sender, System.Data.DataRowView rs, SmoothEnterprise.Web.UI.WebControl.DataColumn column, SmoothEnterprise.Web.UI.WebControl.DataCell cell, EventArgs e)
        {
            bool isDisplay = getEditUser();

            if (isDisplay == false)
            {
                isDisplay = IPQC_RaBase.isManage;
            }

            if (column.ID.Contains("edit"))
            {
                cell.OutputHTML = "<a href=\"" + getEdit + "?rowid=" + rs["rowid"] + "&lab_id=" + rs["lab_id"] + "\"><img src=\"/Lib/Img/icon-edit.gif\" border=\"0\"></a>";
            }

            if (column.ID.Contains("view"))
            {
                cell.OutputHTML = "<a href=Lab/LabView.aspx?rowid=" + rs["rowid"] + "&lab_id=" + rs["lab_id"] + "><img src=\"/lib/img/icon-zoom.gif\" border=\"0\"></a>";
            }

            if (column.ID == "status")
            {
                //tranfer_status("0"), tranfer_status("1"), tranfer_status("2"), tranfer_status("3"), tranfer_status("4"), getStr("no_inspection")
                string Action = rs["status"].ToString();

                string html = "";

                if (!string.IsNullOrEmpty(Action))
                {
                    html = tranfer_status(Action);
                }
                else
                {
                    html = "<div style=\"color:red\" >" + getStr("no_inspection") + "</div>";
                }
                cell.OutputHTML = html;
            }

            if (column.ID == "result")
            {
                string show = "";

                if (!string.IsNullOrEmpty(rs["result"].ToString()))
                {
                    if (rs["status"].ToString() == "3") //¼f®Ö§¹²¦
                    {
                        bool isPass = (bool)rs["result"];
                        if (isPass)
                        {
                            show = "<font color=\"green\" >PASS</font>";
                        }
                        else
                        {
                            show = "<font color=\"red\" >FAIL</font>";
                        }
                    }
                }

                cell.OutputHTML = show;
            }
        }
Beispiel #8
0
 private void BtnEditUsuario_Click(object sender, RoutedEventArgs e)
 {
     if (DgUsuario.SelectedIndex == -1)
     {
         MessageBox.Show("Seleccione una fila de la tabla.");
     }
     else
     {
         try
         {
             System.Data.DataRowView row = (System.Data.DataRowView)DgUsuario.SelectedItems[0];
             TxtIDUsuario.Text          = row[0].ToString().Trim();
             TxtUsuario.Text            = row[2].ToString().Trim();
             TxtPassword.Password       = Core.Utils.StringCipher.Decrypt(row[3].ToString().Trim(), ConfigurationManager.AppSettings["UsuarioSAN"].Trim());
             VerPassword.Text           = Core.Utils.StringCipher.Decrypt(row[3].ToString().Trim(), ConfigurationManager.AppSettings["UsuarioSAN"].Trim());
             GridNewUsuario.Visibility  = Visibility.Collapsed;
             GridEditUsuario.Visibility = Visibility.Visible;
             Dispatcher.BeginInvoke((Action)(() => TabSAN.SelectedIndex = 4));
         }
         catch
         {
             MessageBox.Show("Seleccione una fila válida.");
         }
     }
 }
Beispiel #9
0
        /// <summary>
        /// Sets the supplied collection records to a System.Windows.Forms.CheckState value.
        /// </summary>
        /// <param name="ArrayOf_PK_Sup_GuidID">Primary keys of the records to set the check state for.</param>
        /// <param name="value">One of the System.Windows.Forms.CheckState values.</param>
        public void SetRecordsCheckState(WS_Supplier.WSGuid[] ArrayOf_PK_Sup_GuidID, System.Windows.Forms.CheckState value)
        {
            if (ArrayOf_PK_Sup_GuidID != null && ArrayOf_PK_Sup_GuidID.Length > 0)
            {
                int primaryKeysWereFound    = 0;
                int totalPrimaryKeysNumber  = ArrayOf_PK_Sup_GuidID.Length;
                int totalDataRowViewsNumber = this.Items.Count;

                this.internalItemCheckStateUpdateInProgress = true;

                for (int index = 0; index < totalDataRowViewsNumber; index++)
                {
                    System.Data.DataRowView dataRowView       = (System.Data.DataRowView) this.Items[index];
                    System.Guid             currentPrimaryKey = (System.Guid)dataRowView.Row[0];

                    foreach (WS_Supplier.WSGuid record in ArrayOf_PK_Sup_GuidID)
                    {
                        if (record.Value == currentPrimaryKey)
                        {
                            this.SetItemChecked(index, true);
                            primaryKeysWereFound++;

                            break;
                        }
                    }

                    if (totalPrimaryKeysNumber == primaryKeysWereFound)
                    {
                        break;
                    }
                }

                this.internalItemCheckStateUpdateInProgress = false;
            }
        }
Beispiel #10
0
        private void dataGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
        {
            tmp = e.Row.Item as System.Data.DataRowView;
            Attribute atr1 = new Attribute();

            atr1.typeOfAttribute = (dataGrid.SelectedItem as Attribute).typeOfAttribute;
        }
Beispiel #11
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            int input;

            try
            {
                DataGridCell            dgc     = (DataGridCell)value;
                System.Data.DataRowView rowView = (System.Data.DataRowView)dgc.DataContext;
                input = (int)rowView.Row.ItemArray[dgc.Column.DisplayIndex];
            }
            catch (InvalidCastException)
            {
                return(DependencyProperty.UnsetValue);
            }
            switch (input)
            {
            case 1: return(Brushes.Red);

            case 2: return(Brushes.White);

            case 3: return(Brushes.Blue);

            default: return(DependencyProperty.UnsetValue);
            }
        }
Beispiel #12
0
        protected void DataList1_OnRenderCell(object sender, System.Data.DataRowView rs, SmoothEnterprise.Web.UI.WebControl.DataColumn column, SmoothEnterprise.Web.UI.WebControl.DataCell cell, System.EventArgs e)
        {
            if (column.ID.ToUpper().Contains("EDIT"))
            {
                cell.OutputHTML = "<a href=\"" + getEdit + "?rowid=" + rs["rowid"] + "\"><img src=\"/Lib/Img/icon-edit.gif\" border=\"0\"></a>";
            }

            //if (column.ID == "up")
            //{
            //    string color = "#000000";

            //    if (!string.IsNullOrEmpty(rs["upper"].ToString()))
            //    {
            //        color = rs["upper"].ToString();
            //    }

            //    cell.Value = "<font color=\"" + color + " \" >" + rs["up"] + "</font>";
            //}

            //if (column.ID == "down")
            //{

            //    string color = "#000000";

            //    if (!string.IsNullOrEmpty(rs["lower"].ToString()))
            //    {
            //        color = rs["lower"].ToString();
            //    }

            //    cell.Value = "<font color=\"" + color + " \" >" + rs["down"] + "</font>";
            //}
        }
 private void BtnEditar_Click(object sender, RoutedEventArgs e)
 {
     if (DgContacto.SelectedIndex == -1)
     {
         MessageBox.Show("Seleccione una fila de la tabla.");
     }
     else
     {
         try
         {
             System.Data.DataRowView row = (System.Data.DataRowView)DgContacto.SelectedItems[0];
             TxtIDE.Text        = row[0].ToString();
             CmbProveedorE.Text = row[1].ToString();
             TxtNombreE.Text    = row[2].ToString();
             TxtTelefonoE.Text  = row[3].ToString();
             if (row[4].ToString().Equals("SI"))
             {
                 ChkEmergenciaE.IsChecked = true;
             }
             else
             {
                 ChkEmergenciaE.IsChecked = false;
             }
             Dispatcher.BeginInvoke((Action)(() => TabContacto.SelectedIndex = 2));
         }
         catch { MessageBox.Show("Seleccione una fila válida."); }
     }
 }
        private void CopyToDataSet(System.Data.DataView dv)
        {
            int idx = 0;
            PatientVisitDataSet ds = new PatientVisitDataSet();

            string[] strColNames = new string[ds.V_PATIENT_VISIT.Columns.Count];
            foreach (System.Data.DataColumn col in ds.V_PATIENT_VISIT.Columns)
            {
                strColNames[idx++] = col.ColumnName;
            }

            IEnumerator viewEnumerator = dv.GetEnumerator();

            while (viewEnumerator.MoveNext())
            {
                System.Data.DataRowView drv = (System.Data.DataRowView)viewEnumerator.Current;
                PatientVisitDataSet.V_PATIENT_VISITRow dr = ds.V_PATIENT_VISIT.NewV_PATIENT_VISITRow();

                foreach (string strName in strColNames)
                {
                    dr[strName] = drv[strName];
                }

                ds.V_PATIENT_VISIT.AddV_PATIENT_VISITRow(dr);
            }

            _ds = ds;
        }
Beispiel #15
0
 private void BtnEditar_Click(object sender, RoutedEventArgs e)
 {
     if (DgSAN.SelectedIndex == -1)
     {
         MessageBox.Show("Seleccione una fila de la tabla.");
     }
     else
     {
         try
         {
             TabEdicion.SelectedIndex = 0;
             System.Data.DataRowView row = (System.Data.DataRowView)DgSAN.SelectedItems[0];
             TxtIDSanE.Text       = row[0].ToString().Trim();
             TxtIDSanP.Text       = row[0].ToString().Trim();
             TxtIDSanU.Text       = row[0].ToString().Trim();
             TxtIDSanUrl.Text     = row[0].ToString().Trim();
             TxtNombreSanE.Text   = row[1].ToString().Trim();
             TxtNombreSanP.Text   = row[1].ToString().Trim();
             TxtNombreSanU.Text   = row[1].ToString().Trim();
             TxtNombreSanUrl.Text = row[1].ToString().Trim();
             WSGCIS.Data Datos = client.SelectUrlAdministracionSAN("%" + row[1].ToString().Trim() + "%", App.Current.Properties["Username"].ToString());
             DgUrl.ItemsSource     = Datos.Tabla.DefaultView;
             Datos                 = client.SelectUsuarioSAN("%" + row[1].ToString().Trim() + "%", App.Current.Properties["Username"].ToString());
             DgUsuario.ItemsSource = Datos.Tabla.DefaultView;
             Datos                 = client.SelectPoolBySan("%" + row[1].ToString().Trim() + "%", App.Current.Properties["Username"].ToString());
             DgPool.ItemsSource    = Datos.Tabla.DefaultView;
             Dispatcher.BeginInvoke((Action)(() => TabSAN.SelectedIndex = 2));
         }
         catch
         {
             MessageBox.Show("Seleccione una fila válida.");
         }
     }
 }
        /// <summary>
        /// Sets the supplied collection records to a System.Windows.Forms.CheckState value.
        /// </summary>
        /// <param name="ArrayOf_PK_JobPartId">Primary keys of the records to set the check state for.</param>
        /// <param name="value">One of the System.Windows.Forms.CheckState values.</param>
        public void SetRecordsCheckState(System.Data.SqlTypes.SqlInt32[] ArrayOf_PK_JobPartId, System.Windows.Forms.CheckState value)
        {
            if (ArrayOf_PK_JobPartId != null && ArrayOf_PK_JobPartId.Length > 0)
            {
                int PrimaryKeysWereFound    = 0;
                int TotalPrimaryKeysNumber  = ArrayOf_PK_JobPartId.Length;
                int TotalDataRowViewsNumber = this.Items.Count;

                this.internalItemCheckStateUpdateInProgress = true;

                for (int Index = 0; Index < TotalDataRowViewsNumber; Index++)
                {
                    System.Data.DataRowView       dataRowView       = (System.Data.DataRowView) this.Items[Index];
                    System.Data.SqlTypes.SqlInt32 CurrentPrimaryKey = new System.Data.SqlTypes.SqlInt32((Int32)dataRowView.Row[SPs.spS_JobPart_Display.Resultset1.Fields.Column_ID1.ColumnName]);

                    if (System.Array.IndexOf(ArrayOf_PK_JobPartId, CurrentPrimaryKey) != -1)
                    {
                        this.SetItemChecked(Index, true);
                        PrimaryKeysWereFound++;

                        if (TotalPrimaryKeysNumber == PrimaryKeysWereFound)
                        {
                            break;
                        }
                    }
                }

                this.internalItemCheckStateUpdateInProgress = false;
            }
        }
Beispiel #17
0
        /// <summary>
        /// 当默认配色执行完毕后调用特殊配色方案
        /// </summary>
        /// <param name="e"></param>
        private void SetRowColor(int rowHandle, DevExpress.Utils.AppearanceObject appearance)
        {
            //类别颜色配置

            object oRowObject = this.GetRow(rowHandle);

            System.Data.DataRowView info = (oRowObject as System.Data.DataRowView);
            if (info != null)
            {
                //取类别

                if (this.m_SchemeColor != null)
                {
                    appearance.BeginUpdate();
                    _SpecialStyleInfo style = this.m_SchemeColor.SpecialStyle.Get(info["LB"].ToString());
                    if (style != null)
                    {
                        appearance.Font = new Font(appearance.Font.FontFamily, appearance.Font.Size, style.Font);
                        //字体颜色
                        appearance.ForeColor = style.ForeColor.IsEmpty ? appearance.ForeColor : style.ForeColor;
                        //背景颜色
                        appearance.BackColor = style.BColor.IsEmpty ? appearance.BackColor : style.BColor;

                        appearance.BackColor2 = style.BColor2.IsEmpty ? appearance.BackColor2 : style.BColor2;

                        this.OnSetRowColor(oRowObject, this.m_SchemeColor, appearance);
                        appearance.EndUpdate();
                    }
                }
            }
        }
Beispiel #18
0
        public void SetValue(CellContext cellContext, object p_Value)
        {
            //Convert the null value to DbNull
            if (p_Value == null)
            {
                p_Value = System.DBNull.Value;
            }

            DevAge.ComponentModel.ValueEventArgs valArgs = new DevAge.ComponentModel.ValueEventArgs(p_Value);
            if (cellContext.Grid != null)
            {
                cellContext.Grid.Controller.OnValueChanging(cellContext, valArgs);
            }

            DataGrid grid = (DataGrid)cellContext.Grid;

            if (cellContext.Position.Row != grid.EditingRow)
            {
                throw new SourceGridException("Invalid editing row, cannot set a value for a cell not in editing mode");
            }
            System.Data.DataRowView row = grid.EditingDataRow;
            row[m_Column] = valArgs.Value;

            if (cellContext.Grid != null)
            {
                cellContext.Grid.Controller.OnValueChanged(cellContext, EventArgs.Empty);
            }
        }
Beispiel #19
0
        /// <summary>
        /// Check if the specified row is the active row (focused), return false if it is not the active row. Then call the BeginEdit on the associated DataRowView. Add a row to the DataView if required. Returns true if the method sucesfully call the BeginEdit and set the EditingRow property.
        /// </summary>
        /// <param name="gridRow"></param>
        /// <returns></returns>
        public bool BeginEditRow(int gridRow)
        {
//			if (Selection.ActivePosition.IsEmpty() || Selection.ActivePosition.Row != gridRow)
//				return false;

            if (gridRow != EditingRow)
            {
                EndEditingRow(false);                 //Terminate the old edit if present

                System.Data.DataRowView newEditingRow = null;
                if (DataSource != null)
                {
                    int dataIndex = Rows.IndexToDataSourceIndex(gridRow);

                    if (dataIndex == DataSource.Count && DataSource.AllowNew)                     //Last Row
                    {
                        DataSource.AddNew();

                        newEditingRow = DataSource[dataIndex];
                    }
                    else if (dataIndex < DataSource.Count)
                    {
                        newEditingRow = DataSource[dataIndex];
                    }
                }

                if (newEditingRow != null)
                {
                    mEditingInfo = new EditingInfo(newEditingRow, gridRow);
                    EditingDataRow.BeginEdit();
                }
            }

            return(true);
        }
        private void DetailsView1_DataBound1(object sender, EventArgs e)
        {
            DetailsView o = this.DetailsView1;

            System.Data.DataRowView drw = o.DataItem as System.Data.DataRowView;

            if (null != drw)
            {
                string condDecision     = drw.Row["CondCreditDecision"] as String;
                string condDecisionDate = (drw.Row["CondCreditDecisionDate"] == null) ? String.Empty : (drw.Row["CondCreditDecisionDate"]).ToString();
                string condDecSent      = (drw.Row["CondCreditDecisionInformed"] == null) ?  String.Empty : (drw.Row["CondCreditDecisionInformed"]).ToString();

                if ((!String.IsNullOrEmpty(condDecision)) || (!String.IsNullOrEmpty(condDecisionDate)))
                {
                    btnCondApprove.Enabled        = false;
                    lblCondApproved.Visible       = true;
                    lblCondDecLbl.Visible         = true;
                    lblCondDecInformedLbl.Visible = true;

                    if ("C" == condDecision)
                    {
                        lblCondApproved.Text      = "Conditionally Approved";
                        lblCondApproved.BackColor = System.Drawing.Color.Green;
                    }
                    else if ("R" == condDecision)
                    {
                        lblCondApproved.Text      = "Rejected";
                        lblCondApproved.BackColor = System.Drawing.Color.Red;
                    }

                    if (String.IsNullOrEmpty(condDecSent))
                    {
                        lblCondDecInformed.Text       = "No";
                        lblCondDecInformed.BackColor  = System.Drawing.Color.Red;
                        lblCondDecInformedLbl.Visible = true;
                        lblCondDecInformed.Visible    = true;
                        btnCondResultSent.Enabled     = true;
                    }
                    else
                    {
                        lblCondDecInformed.Text       = condDecSent;
                        lblCondDecInformed.BackColor  = System.Drawing.Color.Green;
                        lblCondDecInformedLbl.Visible = true;
                        lblCondDecInformed.Visible    = true;
                        btnCondResultSent.Enabled     = false;
                    }
                }
                else
                {
                    lblCondApproved.Text          = String.Empty;
                    lblCondApproved.Visible       = false;
                    lblCondDecLbl.Visible         = false;
                    lblCondDecInformed.Text       = String.Empty;
                    lblCondDecInformed.Visible    = false;
                    lblCondDecInformedLbl.Visible = false;
                    btnCondResultSent.Enabled     = false;
                }
            }
        }
Beispiel #21
0
 private void BtnEditar_Click(object sender, RoutedEventArgs e)
 {
     if (DgDatabases.SelectedIndex == -1)
     {
         MessageBox.Show("Seleccione una fila de la tabla.");
     }
     else
     {
         try
         {
             TabEdicion.SelectedIndex = 0;
             System.Data.DataRowView row = (System.Data.DataRowView)DgDatabases.SelectedItems[0];
             TxtIDDatabaseE.Text          = row[0].ToString().Trim();
             TxtIDDatabaseU.Text          = row[0].ToString().Trim();
             TxtIDDatabaseM.Text          = row[0].ToString().Trim();
             TxtIDInstanciaE.Text         = row[1].ToString().Trim();
             TxtIDInstanciaU.Text         = row[1].ToString().Trim();
             TxtIDInstanciaM.Text         = row[1].ToString().Trim();
             TxtNombreInstanciaE.Text     = row[2].ToString().Trim();
             TxtNombreInstanciaU.Text     = row[2].ToString().Trim();
             TxtNombreInstanciaM.Text     = row[2].ToString().Trim();
             TxtNombreDatabaseE.Text      = row[3].ToString().Trim();
             TxtNombreDatabaseU.Text      = row[3].ToString().Trim();
             TxtNombreDatabaseM.Text      = row[3].ToString().Trim();
             TxtDescripcionDatabaseE.Text = row[4].ToString().Trim();
             WSGCIS.Data Datos = client.SelectDatabaseUsuario("%" + TxtNombreDatabaseE.Text.Trim() + "%", App.Current.Properties["Username"].ToString());
             DgUsuarios.ItemsSource = Datos.Tabla.DefaultView;
             Datos = client.SelectDatabaseMantenimiento(int.Parse(TxtIDDatabaseE.Text.Trim()), App.Current.Properties["Username"].ToString());
             DgMaintenance.ItemsSource = Datos.Tabla.DefaultView;
             Datos = client.SelectUsuarioInstancia("%" + row[2].ToString().Trim() + "%", App.Current.Properties["Username"].ToString());
             usuarios.Clear();
             idusuarios.Clear();
             for (int i = 0; i < Datos.Tabla.Rows.Count; i++)
             {
                 idusuarios.Add(Datos.Tabla.Rows[i][0].ToString());
                 usuarios.Add(Datos.Tabla.Rows[i][2].ToString());
             }
             ListUsuariosU.ItemsSource = usuarios;
             ListUsuariosU.Items.Refresh();
             Datos = client.SelectPlanMantenimiento("%" + row[2].ToString().Trim() + "%", App.Current.Properties["Username"].ToString());
             maintenance.Clear();
             idmaintenance.Clear();
             for (int i = 0; i < Datos.Tabla.Rows.Count; i++)
             {
                 idmaintenance.Add(Datos.Tabla.Rows[i][0].ToString());
                 maintenance.Add(Datos.Tabla.Rows[i][2].ToString());
             }
             ListMantenimientoM.ItemsSource = maintenance;
             ListMantenimientoM.Items.Refresh();
             GridEditDatabase.Visibility = Visibility.Visible;
             //GridNewDatabase.Visibility = Visibility.Collapsed;
             Dispatcher.BeginInvoke((Action)(() => TabDatabases.SelectedIndex = 1));
         }
         catch
         {
             MessageBox.Show("Seleccione una fila válida.");
         }
     }
 }
Beispiel #22
0
        private void ButtonSelect_Click(object sender, RoutedEventArgs e)
        {
            row = (System.Data.DataRowView) this.DataGridPerson.SelectedItems[0];

            ReturnVal();

            this.Close();
        }
 protected void GridViewConsultantInfo_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         System.Data.DataRowView drv = e.Row.DataItem as System.Data.DataRowView;
         e.Row.Attributes.Add("ondblclick", String.Format("window.location='AddConsultant.aspx?name={0}'", drv["username"]));
     }
 }
Beispiel #24
0
 private void gridEx_SelectionChanged(object sender, System.EventArgs e)
 {
     if (gridEx.SelectedItems.Count > 0)
     {
         System.Data.DataRowView dataRowSelected = (System.Data.DataRowView)gridEx.SelectedItems[0].GetRow().DataRow;
         _uiController.IdPersonaSeleccionada = Convert.ToString(dataRowSelected["IdPersona"]);
     }
 }
Beispiel #25
0
 private void bb_clifor_Click(object sender, EventArgs e)
 {
     System.Data.DataRowView linha = FormBusca.UtilPesquisa.BTN_BuscaClifor(null, "a.tp_pessoa|=|'J'");
     if (linha != null)
     {
         NR_CGC.Text = linha["nr_cgc"].ToString();
     }
 }
Beispiel #26
0
 public void RemoveSelectedRoleEvent()
 {
     // DataRow
     System.Data.DataRowView dataRowView = this.listBoxRoleEvents.SelectedItem as System.Data.DataRowView;
     if (dataRowView != null)
     {
         dataRowView.Delete();
     }
 }
Beispiel #27
0
 public void Clear()
 {
     Data        = null;
     DOC_NUMBER  = string.Empty;
     BASKET_CODE = string.Empty;
     BASKET_DESC = string.Empty;
     REMAIN      = 0;
     GOOD_NUMBER = 0;
 }
Beispiel #28
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="uid"></param>
 /// <param name="col"></param>
 /// <param name="val"></param>
 protected bool markMessage(System.String uid, int col, bool val)
 {
     System.Data.DataRowView msg = this.GetMessageObject(uid);
     if (msg != null && !msg[col].Equals(val))
     {
         msg[col] = val;
         return(true);
     }
     return(false);
 }
Beispiel #29
0
 public System.Object[] this [System.String uid] {
     get {
         System.Data.DataRowView msg = this.GetMessageObject(uid);
         if (msg != null)
         {
             return(msg.Row.ItemArray);
         }
         return(null);
     }
 }
Beispiel #30
0
 protected void ProjectList_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         System.Data.DataRowView row = (System.Data.DataRowView)e.Item.DataItem;
         int   ProjectID             = Convert.ToInt32(row["ProjectID"]);
         Label label = (Label)e.Item.FindControl("PrintNum");
         label.Text = WebBLL.Tbl_ProjectArchiveRequestManager.GetDataTableByCount("requesttype='出版申请' and nodeno='已出版' and projectid=" + ProjectID.ToString()).ToString();
     }
 }
Beispiel #31
0
		public virtual void EndEdit(bool cancel)
		{
			if (mEditingRow == null)
				return;

			if (cancel)
				mEditingRow.CancelEdit();
			else
				mEditingRow.EndEdit();

			mEditingRow = null;

			//when CancelEdit the DataView doesn't automatically call a ListChanged event, so I will call it manually
			if (cancel)
				OnListChanged(new System.ComponentModel.ListChangedEventArgs(System.ComponentModel.ListChangedType.Reset, -1));
		}
Beispiel #32
0
		public virtual int BeginAddNew()
		{
			if (mEditingRow != null)
				throw new DevAgeApplicationException("There is already a row in editing state, call EndEdit first");

			mEditingRow = m_dataView.AddNew();

			mEditingRow.BeginEdit();

			System.Collections.IList list = (System.Collections.IList)m_dataView;

			return list.IndexOf(mEditingRow);
		}
Beispiel #33
0
		public virtual void BeginEdit(int index)
		{
			if (mEditingRow != null)
				throw new DevAgeApplicationException("There is already a row in editing state, call EndEdit first");

			mEditingRow = m_dataView[index];

			mEditingRow.BeginEdit();
		}
Beispiel #34
0
        public static System.Data.DataSet SelectedRowsDataSet(System.Data.DataView dv, ArrayList selectedRows)
        {
            System.Data.DataSet ds = new System.Data.DataSet();
            System.Data.DataTable dt = new System.Data.DataTable();
            System.Data.DataRowView[] selectedRowsView = new System.Data.DataRowView[selectedRows.Count];

            foreach(System.Data.DataColumn col in dv.Table.Columns)
            {
                dt.Columns.Add(col.ColumnName, col.DataType);
            }

            for (int i = 0; i < selectedRows.Count; i++)
            {
                dt.ImportRow(dv[(int)(selectedRows.ToArray())[i]].Row);
            }

            ds.Tables.Add(dt);

            return(ds);
        }