Пример #1
1
        /// <summary>
        /// Enable/Disable the embedded control
        /// </summary>
        /// <param name="row"></param>
        /// <param name="enable"></param>
        public void SetCellEmbeddedControlStatus(GridViewDataRowInfo row, bool enable)
        {
            CSPropertyGridCellElement cellElement = row.Cells[_columnFieldName].CellElement as CSPropertyGridCellElement;

            if (cellElement != null)
            {
                cellElement.ActiveControl.Enabled = enable;
            }
        }
        public void UpdateView()
        {
            GridViewDataRowInfo dataRow = this.GridViewElement.GridControl.CurrentRow as GridViewDataRowInfo;

            if (dataRow != null)
            {
                byte[] photo = dataRow.Cells["Photo"].Value as byte[];
                using (Image originalImage = ImageHelper.GetImageFromBytes(photo))
                    using (Bitmap bitmap2 = new Bitmap(originalImage))
                    {
                        imagePrimitive.Image = bitmap2.GetThumbnailImage(100, 100, null, IntPtr.Zero);
                    }

                string name        = String.Format("{0} {1} {2}", dataRow.Cells["TitleOfCourtesy"].Value, dataRow.Cells["FirstName"].Value, dataRow.Cells["LastName"].Value);
                string position    = String.Format("<html><b>Position:</b><br/> {0} ", dataRow.Cells["Title"].Value);
                string dateOfBirth = String.Format(@"<html><b>Date of Birth:</b><br/> {0:D}", dataRow.Cells["BirthDate"].Value);
                string hiredDate   = String.Format(@"<html><b>Date of Hire:</b><br/> {0:D}", dataRow.Cells["HireDate"].Value);
                string notes       = String.Format(@"<html><b>Notes: </b><br/> {0}", dataRow.Cells["Notes"].Value);

                this.groupBoxElement.HeaderText = name;

                this.labelPosition.Text  = position;
                this.labelBirthDate.Text = dateOfBirth;
                this.labelHireDate.Text  = hiredDate;
                this.labelNotes.Text     = notes;
            }
        }
Пример #3
0
        public void FillPaidAccountingRadGridViewRad()
        {
            if (this.PaidAccountsRadGridView.Rows.Count > 0)
            {
                this.PaidAccountsRadGridView.Rows.Clear();
            }

            #region Columns of the GridView
            try
            {
                foreach (PaidAccount pa in this._currentPaidAccountsList)
                {
                    GridViewDataRowInfo row = new GridViewDataRowInfo(this.PaidAccountsRadGridView.MasterView);
                    row.Cells["PaidAccountID"].Value  = pa.PaidAccountID;
                    row.Cells["InvoiceNumber"].Value  = pa.Invoice.InvoiceNumber.GetInvoiceNumberExt();
                    row.Cells["DateEmit"].Value       = pa.DateEmit;
                    row.Cells["ExpirationDate"].Value = pa.ExpirationDate;
                    row.Cells["Amount"].Value         = pa.Amount;
                    row.Cells["DayDelay"].Value       = pa.DayDelay;
                    row.Cells["AmountPending"].Value  = pa.AmountPending;
                    row.Cells["State"].Value          = pa.State;

                    this.PaidAccountsRadGridView.Rows.Add(row);
                }
                DisplayOtherData();
                ClearSelectionRadGridView();
            }
            catch (Exception) { }

            #endregion
        }
Пример #4
0
        private void gridBlocks_CellClick(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
        {
            gridData.Rows.Clear();
            int extraRows = 0;

            if (gridBlocks.SelectedRows.Count > 0)
            {
                Register b = Blocks[Convert.ToInt32(gridBlocks.SelectedRows[0].Cells[0].Value)];
                for (int i = 0; i < b.values.Count; i++)
                {
                    extraRows = blockSize - b.values[i].Count;
                    for (int j = 0; j < b.values[i].Count; j++)
                    {
                        GridViewDataRowInfo rowInfo = new GridViewDataRowInfo(gridData.MasterView);

                        rowInfo.Cells[0].Value = b.values[i][j].val;
                        rowInfo.Cells[1].Value = b.values[i][j].dir;
                        gridData.Rows.Add(rowInfo);
                    }
                    for (int k = 0; k < extraRows; k++)
                    {
                        GridViewDataRowInfo rowInfo = new GridViewDataRowInfo(gridData.MasterView);
                        gridData.Rows.Add(rowInfo);
                    }
                }
            }
        }
Пример #5
0
        private void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
        {
            GridDataCellElement dataCell = e.CellElement as GridDataCellElement;

            if (dataCell.ColumnInfo.Name == "Name")
            {
                GridViewDataRowInfo dataRow = dataCell.RowInfo as GridViewDataRowInfo;
                dataCell.ImageAlignment = ContentAlignment.MiddleLeft;

                string valueType = Convert.ToString(dataRow.Cells["Type"].Value).ToUpperInvariant();

                if (valueType.Contains("FILE") || valueType.Contains("DOCUMENT"))
                {
                    dataCell.Image = this.imageList1.Images[2];
                }
                else if (dataRow.IsExpanded)
                {
                    dataCell.Image = this.imageList1.Images[1];
                }
                else
                {
                    dataCell.Image = this.imageList1.Images[0];
                }

                dataCell.TextImageRelation = TextImageRelation.ImageBeforeText;
            }
            else
            {
                dataCell.ResetValue(LightVisualElement.ImageProperty, Telerik.WinControls.ValueResetFlags.Local);
                dataCell.ResetValue(LightVisualElement.ImageAlignmentProperty, Telerik.WinControls.ValueResetFlags.Local);
                dataCell.ResetValue(LightVisualElement.TextImageRelationProperty, Telerik.WinControls.ValueResetFlags.Local);
                dataCell.ResetValue(LightVisualElement.ImageLayoutProperty, Telerik.WinControls.ValueResetFlags.Local);
            }
        }
Пример #6
0
        private void addRow(GridViewDataRowInfo row)
        {
            if (tbTemplate.SelectedPage == radPageViewPage1)
            {
                this.gvTemplateKategori.Rows.Insert(0, row);
            }

            if (tbTemplate.SelectedPage == radPageViewPage2)
            {
                this.gvAsalSurat.Rows.Insert(0, row);
            }

            if (tbTemplate.SelectedPage == radPageViewPage3)
            {
                this.gvPenerima.Rows.Insert(0, row);
            }

            if (tbTemplate.SelectedPage == radPageViewPage4)
            {
                this.gvTkKeamanan.Rows.Insert(0, row);
            }

            if (tbTemplate.SelectedPage == radPageViewPage5)
            {
                this.gvLokasi.Rows.Insert(0, row);
            }

            if (tbTemplate.SelectedPage == radPageViewPage6)
            {
                this.gvJenisPengiriman.Rows.Insert(0, row);
            }
        }
        private void cmbProduct_SelectedValueChanged(object sender, EventArgs e)
        {
            GridViewDataRowInfo selectedRow = (GridViewDataRowInfo)cmbProduct.SelectedItem;

            txtOrderProductName.Text = string.Format(selectedRow.Cells[2].Value.ToString());
            txtUnitPrice.Text        = selectedRow.Cells[4].Value.ToString();
        }
Пример #8
0
        private void deleteButton_Click(object sender, EventArgs e)
        {
            GridViewDataRowInfo dataRowInfo = this.radGridView1.CurrentRow as GridViewDataRowInfo;

            if (dataRowInfo != null)
            {
                this.radGridView1.Rows.Remove(dataRowInfo);
                this.UpdatePanelInfo(this.radGridView1.CurrentRow);
            }
        }
Пример #9
0
        private void InsertSingleData(string _template, string _status)
        {
            GridViewDataRowInfo dataRowInfo = new GridViewDataRowInfo(this.gvTemplateKategori.MasterView);

            dataRowInfo.Cells[0].Value = txtNama.Text;
            dataRowInfo.Cells[1].Value = txtSimbol.Text;
            dataRowInfo.Cells[2].Value = txtKeterangan.Text;
            dataRowInfo.Cells[3].Value = _template;
            dataRowInfo.Cells[4].Value = _status;
            this.gvTemplateKategori.Rows.Insert(0, dataRowInfo);
        }
Пример #10
0
        private GridViewRowInfo GetDataRow(DataTable dt, int i)
        {//select SQL_NO_CACHE `id`, `nomor_surat`, `datetime_input`, `kolom`, `data_lama`, `data_baru`, `user` ");
            GridViewDataRowInfo dataRowInfo = new GridViewDataRowInfo(this.gvHistoryLoginUser.MasterView);

            dataRowInfo.Cells[0].Value = dt.Rows[i][0];
            dataRowInfo.Cells[1].Value = dt.Rows[i][1];
            dataRowInfo.Cells[2].Value = string.Format("{0:dd MMM yyyy}", dt.Rows[i][2]);
            dataRowInfo.Cells[3].Value = string.Format("{0:HH:mm:ss}", dt.Rows[i][2]);
            dataRowInfo.Cells[4].Value = dt.Rows[i][3];
            dataRowInfo.Cells[5].Value = dt.Rows[i][4];
            dataRowInfo.Cells[6].Value = dt.Rows[i][5];
            dataRowInfo.Cells[7].Value = dt.Rows[i][6];
            return(dataRowInfo);
        }
Пример #11
0
        private GridViewRowInfo GetDataRow(DataTable dt, int i)
        {
            GridViewDataRowInfo dataRowInfo = new GridViewDataRowInfo(this.gvHistoryLoginUser.MasterView);

            dataRowInfo.Cells[0].Value = dt.Rows[i][0];
            dataRowInfo.Cells[1].Value = dt.Rows[i][1];
            dataRowInfo.Cells[2].Value = string.Format("{0:dd MMM yyyy}", dt.Rows[i][2]);
            dataRowInfo.Cells[3].Value = string.Format("{0:HH:mm:ss}", dt.Rows[i][2]);
            dataRowInfo.Cells[4].Value = dt.Rows[i][3];
            dataRowInfo.Cells[5].Value = dt.Rows[i][4];
            dataRowInfo.Cells[6].Value = dt.Rows[i][5];
            dataRowInfo.Cells[7].Value = dt.Rows[i][6];
            return(dataRowInfo);
        }
Пример #12
0
        private void deleteButton_Click(object sender, EventArgs e)
        {
            GridViewDataRowInfo dataRowInfo = radGridView1.CurrentRow as GridViewDataRowInfo;

            if (dataRowInfo != null)
            {
                //delete worker succsesed
                if (DeleteFromDb() == true)
                {
                    radGridView1.Rows.Remove(dataRowInfo);
                    UpdatePanelInfo(radGridView1.CurrentRow);
                }
            }
        }
Пример #13
0
        private GridViewDataRowInfo GetDataRow(System.Data.DataTable dt, int i)
        {
            GridViewDataRowInfo dataRowInfo = new GridViewDataRowInfo(this.gvSejarahDisposisi.MasterView);

            dataRowInfo.Cells[0].Value = dt.Rows[i][0];
            dataRowInfo.Cells[1].Value = dt.Rows[i][1];
            dataRowInfo.Cells[2].Value = string.Format("{0:dd MMM yyyy}", dt.Rows[i][2]);
            dataRowInfo.Cells[3].Value = string.Format("{0:HH:mm:ss}", dt.Rows[i][2]);
            dataRowInfo.Cells[4].Value = string.Format("{0:dd MMM yyyy}", dt.Rows[i][3]);
            dataRowInfo.Cells[5].Value = dt.Rows[i][4];
            dataRowInfo.Cells[6].Value = dt.Rows[i][5];
            dataRowInfo.Cells[7].Value = dt.Rows[i][6];
            return(dataRowInfo);
        }
Пример #14
0
        public void InsertSingleData(FrmTambahUser _frmTambahUser)
        {
            GridViewDataRowInfo dataRowInfo = new GridViewDataRowInfo(this.gvUser.MasterView);

            dataRowInfo.Cells[0].Value = _frmTambahUser.txtUsername.Text;
            dataRowInfo.Cells[1].Value = T8GlobalFunc.MD5Encrypt(_frmTambahUser.txtPassword.Text);
            dataRowInfo.Cells[2].Value = _frmTambahUser.hakAksesUser;
            dataRowInfo.Cells[3].Value = null;
            dataRowInfo.Cells[4].Value = null;
            dataRowInfo.Cells[5].Value = _frmTambahUser.status;
            dataRowInfo.Cells[6].Value = string.Format("{0:dd MMM yyyy}", DateTime.Now);
            dataRowInfo.Cells[7].Value = string.Format("{0:HH:mm:ss}", DateTime.Now);
            dataRowInfo.Cells[8].Value = T8UserLoginInfo.Username;
            gvUser.Rows.Insert(0, dataRowInfo);
        }
Пример #15
0
        private void RestoreExpandedStates(GridViewDataRowInfo rowToRestore)
        {
            if (rowToRestore != null && rowToRestore.DataBoundItem != null &&
                nodeStates.ContainsKey(rowToRestore.DataBoundItem))
            {
                rowToRestore.IsExpanded = nodeStates[rowToRestore.DataBoundItem].Expanded;
                rowToRestore.IsCurrent  = nodeStates[rowToRestore.DataBoundItem].Selected;
                rowToRestore.IsSelected = nodeStates[rowToRestore.DataBoundItem].Selected;
            }

            foreach (GridViewDataRowInfo childRow in rowToRestore.ChildRows)
            {
                RestoreExpandedStates(childRow);
            }
        }
Пример #16
0
        public void PopulateGrid(RadGridView rgv, Button btnEnable,
                                 ComboBox cbUnit, Label remainingSpace, TextBox tbExportPath)
        {
            rgv.Rows.Clear();

            List <Tuple <string, int> > hiddenFiles =
                algorithm.LookForHiddenFiles();

            foreach (Tuple <string, int> file in hiddenFiles)
            {
                rgv.Rows.Add(file.Item1, ConvertSizeToUnit(file.Item2,
                                                           cbUnit.SelectedItem.ToString()));
            }

            if (rgv.RowCount > 0 && tbExportPath.Text != string.Empty)
            {
                btnEnable.Enabled = true;
            }
            else
            {
                btnEnable.Enabled = false;
            }

            return;

            /////////////////////////////////////////////////
            List <Tuple <string, int> > fileNamesWithByteSize
                = filesProcessor.GetFileNamesWithByteSize();

            GridViewDataRowInfo[] rows =
                new GridViewDataRowInfo[fileNamesWithByteSize.Count];

            for (int i = 0; i < rows.Length; i++)
            {
                Tuple <string, int> file = fileNamesWithByteSize[i];

                rows[i] = new GridViewDataRowInfo(rgv.MasterView);

                rows[i].Cells[0].Value = file.Item1;
                rows[i].Cells[1].Value =
                    ConvertSizeToUnit(file.Item2,
                                      cbUnit.SelectedItem.ToString()
                                      ) + " " +
                    cbUnit.SelectedItem.ToString();
            }

            rgv.Rows.AddRange(rows);
        }
Пример #17
0
        private void radGridViewExtended1_Click(object sender, EventArgs e)
        {
            if (this.radGridViewExtended1.SelectedRows.Count > 0)
            {
                GridViewDataRowInfo[] rows = new GridViewDataRowInfo[this.radGridViewExtended1.SelectedRows.Count];
                this.radGridViewExtended1.SelectedRows.CopyTo(rows, 0);

                this.radGridViewExtended1.GridElement.BeginUpdate();

                for (int i = 0; i < rows.Length; i++)
                {
                    rows[i].Delete();
                }

                this.radGridViewExtended1.GridElement.EndUpdate();
            }
        }
Пример #18
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (this.dgvResult.SelectedRows.Count > 0)
            {
                GridViewDataRowInfo[] rows = new GridViewDataRowInfo[this.dgvResult.SelectedRows.Count];
                this.dgvResult.SelectedRows.CopyTo(rows, 0);

                this.dgvResult.GridElement.BeginUpdate();

                for (int i = 0; i < rows.Length; i++)
                {
                    this.dgvResult.Rows.Remove(rows[i]);
                }

                this.dgvResult.GridElement.EndUpdate();
            }
        }
Пример #19
0
        /// <summary>
        /// Get the gridview row according to the data bound item
        /// </summary>
        /// <param name="dataBoundItem">data bound item</param>
        /// <returns></returns>
        public GridViewDataRowInfo GetRowByDataBoundItem(DataRow dataBoundItem)
        {
            GridViewDataRowInfo row = null;

            if (dataBoundItem != null)
            {
                foreach (GridViewDataRowInfo r in this.Rows)
                {
                    if ((r.DataBoundItem as DataRowView).Row.Equals(dataBoundItem))
                    {
                        row = r;
                        break;
                    }
                }
            }
            return(row);
        }
Пример #20
0
 private void gridFK_CellClick(object sender, GridViewCellEventArgs e)
 {
     foreach (var r in headers)
     {
         if (r.val == gridFK.SelectedRows[0].Cells[1].Value)
         {
             gridFKData.Rows.Clear();
             foreach (var b in r.bloque)
             {
                 GridViewDataRowInfo rowInfo = new GridViewDataRowInfo(gridFKData.MasterView);
                 rowInfo.Cells[0].Value = b;
                 gridFKData.Rows.Add(rowInfo);
             }
             return;
         }
     }
 }
Пример #21
0
        private void _searchGrid_CurrentRowChanged(object sender, CurrentRowChangedEventArgs e)
        {
            var data = _repo.getById(_tableName, e.CurrentRow.Cells["Id"].Value.ToString());

            if (data != null)
            {
                radGridView1.Rows.Clear();
                GridViewDataRowInfo rowInfo = new GridViewDataRowInfo(this.radGridView1.MasterView);
                foreach (var item in radGridView1.Columns)
                {
                    Type a = item.DataType;
                    rowInfo.Cells[item.Name].Value = data.FieldValue <object>(item.Name);
                }
                radGridView1.Rows.Add(rowInfo);
                radGridView1.BringToFront();
                _searchGrid.Hide();
            }
        }
Пример #22
0
 private void SaveExpandedStates(GridViewDataRowInfo rowToSave)
 {
     if (rowToSave != null && rowToSave.DataBoundItem != null)
     {
         if (!nodeStates.ContainsKey(rowToSave.DataBoundItem))
         {
             nodeStates.Add(rowToSave.DataBoundItem, new State(rowToSave.IsExpanded, rowToSave.IsCurrent));
         }
         else
         {
             nodeStates[rowToSave.DataBoundItem] = new State(rowToSave.IsExpanded, rowToSave.IsCurrent);
         }
     }
     foreach (GridViewDataRowInfo childRow in rowToSave.ChildRows)
     {
         SaveExpandedStates(childRow);
     }
 }
Пример #23
0
        private void btnRemoveRow_Click(object sender, EventArgs e)
        {
            GridViewDataRowInfo dataRowInfo = this.dgvOrderItems.CurrentRow as GridViewDataRowInfo;

            if (dataRowInfo != null)
            {
                int productID    = dataRowInfo.Cells[5].Value.ToInt();
                int saleDetailID = dataRowInfo.Cells[6].Value.ToInt();

                this.dgvOrderItems.Rows.Remove(dataRowInfo);
                _dirty = true;
                CalculateSaleCost();

                UpdateUI(_currentSale.SaleStatusID);

                _affectedProduts.Add(new AffectedProductsViewModel {
                    ProductID = productID, State = ProductState.Deleted, SaleDetailID = saleDetailID
                });
            }
        }
Пример #24
0
        private GridViewDataRowInfo GetDataRow(DataTable dt, int i)
        {
            GridViewDataRowInfo dataRowInfo = null;

            if (tbTemplate.SelectedPage == radPageViewPage1)
            {
                dataRowInfo = new GridViewDataRowInfo(this.gvTemplateKategori.MasterView);
            }

            if (tbTemplate.SelectedPage == radPageViewPage2)
            {
                dataRowInfo = new GridViewDataRowInfo(this.gvAsalSurat.MasterView);
            }

            if (tbTemplate.SelectedPage == radPageViewPage3)
            {
                dataRowInfo = new GridViewDataRowInfo(this.gvPenerima.MasterView);
            }

            if (tbTemplate.SelectedPage == radPageViewPage4)
            {
                dataRowInfo = new GridViewDataRowInfo(this.gvTkKeamanan.MasterView);
            }

            if (tbTemplate.SelectedPage == radPageViewPage5)
            {
                dataRowInfo = new GridViewDataRowInfo(this.gvLokasi.MasterView);
            }

            if (tbTemplate.SelectedPage == radPageViewPage6)
            {
                dataRowInfo = new GridViewDataRowInfo(this.gvJenisPengiriman.MasterView);
            }
            dataRowInfo.Cells[0].Value = dt.Rows[i][0];
            dataRowInfo.Cells[1].Value = dt.Rows[i][1];
            dataRowInfo.Cells[2].Value = dt.Rows[i][2];
            dataRowInfo.Cells[3].Value = dt.Rows[i][3];
            dataRowInfo.Cells[4].Value = dt.Rows[i][4];
            return(dataRowInfo);
        }
Пример #25
0
        private void DetailViewSK()
        {
            GridViewDataRowInfo dr = new GridViewDataRowInfo(this.gvSuratKeluar.MasterView);
            dr.Cells[0].Value = gvSuratKeluar.MasterView.Rows[gvSuratKeluar.SelectedRows[0].Index].Cells[0].Value;
            dr.Cells[1].Value = gvSuratKeluar.MasterView.Rows[gvSuratKeluar.SelectedRows[0].Index].Cells[4].Value;
            dr.Cells[2].Value = gvSuratKeluar.MasterView.Rows[gvSuratKeluar.SelectedRows[0].Index].Cells[5].Value;
            dr.Cells[3].Value = gvSuratKeluar.MasterView.Rows[gvSuratKeluar.SelectedRows[0].Index].Cells[6].Value;
            dr.Cells[4].Value = gvSuratKeluar.MasterView.Rows[gvSuratKeluar.SelectedRows[0].Index].Cells[7].Value;
            dr.Cells[5].Value = gvSuratKeluar.MasterView.Rows[gvSuratKeluar.SelectedRows[0].Index].Cells[8].Value;
            dr.Cells[6].Value = gvSuratKeluar.MasterView.Rows[gvSuratKeluar.SelectedRows[0].Index].Cells[9].Value;

            Surat.FrmInfoSuratKeluar frmDetailSurat = new Surat.FrmInfoSuratKeluar(dr);
            frmDetailSurat.ShowDialog();
        }
Пример #26
0
        private void GenerateDataSuratMasuk()
        {
            ClearItem();

            InitIndex();
            this.agenda_variable = new List <string>();

            nIDLen.Value = (int)AppDefaultSetting.surat_masuk_minimum_id_lenght;

            if (AppDefaultSetting.surat_masuk_index_start.ToLower() == "Message Box Confirmation Before Input".ToLower())
            {
                rdoMessage.IsChecked = true;
            }
            else
            {
                rdoFlat.IsChecked = true;
            }

            lblNomorAgenda.Text = AppDefaultSetting.surat_masuk_format_nomor_agenda;

            string[] format_nomor_agenda = AppDefaultSetting.surat_masuk_format_nomor_agenda.Split(AppDefaultSetting.surat_masuk_concat_nomor_agenda);

            this.radGridView1.Rows.Clear();
            for (int i = 0; i < format_nomor_agenda.Length; i++)
            {
                if (format_nomor_agenda[i].ToLower() == "{id}".ToLower())
                {
                    ddIdxId.SelectedIndex = i;
                    this.agenda_variable.Insert(i, format_nomor_agenda[i]);
                }
                else if (format_nomor_agenda[i].ToLower() == "{kategori}".ToLower())
                {
                    chkKategori.Checked = AppDefaultSetting.surat_keluar_include_kategori_nomor_agenda;
                }
                else if (format_nomor_agenda[i].ToLower() == "{day}".ToLower())
                {
                    chkIncludeDay.Checked = AppDefaultSetting.surat_keluar_include_day_nomor_agenda;
                }
                else if (format_nomor_agenda[i].ToLower() == "{month}".ToLower())
                {
                    chkIncludeMonth.Checked = AppDefaultSetting.surat_keluar_include_month_nomor_agenda;
                }
                else if (format_nomor_agenda[i].ToLower() == "{year}".ToLower())
                {
                    chkIncludeYear.Checked = AppDefaultSetting.surat_keluar_include_year_nomor_agenda;
                }
                else if (format_nomor_agenda[i].ToLower() == "{tkkeamanan}".ToLower())
                {
                    chkTkKeamanan.Checked = AppDefaultSetting.surat_keluar_include_tingkat_keamanan_nomor_agenda;
                }
                else
                {
                    GridViewDataRowInfo dataRowInfo = new GridViewDataRowInfo(this.radGridView1.MasterView);
                    dataRowInfo.Cells[0].Value = format_nomor_agenda[i];
                    dataRowInfo.Cells[1].Value = "";
                    this.radGridView1.Rows.Insert(0, dataRowInfo);
                    this.agenda_variable.Insert(i, format_nomor_agenda[i]);
                    this.idxStaticValue.Add(this.agenda_variable.Count - 1);
                }
            }

            ddFormatDay.Text   = AppDefaultSetting.surat_masuk_format_day;
            ddFormatMonth.Text = AppDefaultSetting.surat_masuk_format_month;
            ddFormatYear.Text  = AppDefaultSetting.surat_masuk_format_year;

            if (AppDefaultSetting.surat_masuk_reset_role.ToLower() != "")
            {
                chkReset.Checked = true;

                if (AppDefaultSetting.surat_masuk_reset_role.ToString().ToLower() == "Kategori".ToLower())
                {
                    ddReset.SelectedIndex = 0;
                }
                else if (AppDefaultSetting.surat_masuk_reset_role.ToString().ToLower() == "TkKeamanan".ToLower())
                {
                    ddReset.SelectedIndex = 1;
                }
                else if (AppDefaultSetting.surat_masuk_reset_role.ToString().ToLower() == "Daily".ToLower())
                {
                    ddReset.SelectedIndex = 2;
                }
                else if (AppDefaultSetting.surat_masuk_reset_role.ToString().ToLower() == "Monthly".ToLower())
                {
                    ddReset.SelectedIndex = 3;
                }
                else if (AppDefaultSetting.surat_masuk_reset_role.ToString().ToLower() == "Yearly".ToLower())
                {
                    ddReset.SelectedIndex = 4;
                }
            }

            if (AppDefaultSetting.surat_masuk_concat_nomor_agenda.ToString().ToLower() == "/")
            {
                ddConcat.SelectedIndex = 0;
            }
            else if (AppDefaultSetting.surat_masuk_concat_nomor_agenda.ToString().ToLower() == "-")
            {
                ddConcat.SelectedIndex = 1;
            }
            else if (AppDefaultSetting.surat_masuk_concat_nomor_agenda.ToString().ToLower() == ".")
            {
                ddConcat.SelectedIndex = 2;
            }
            else if (AppDefaultSetting.surat_masuk_concat_nomor_agenda.ToString().ToLower() == " ")
            {
                ddConcat.SelectedIndex = 3;
            }
            GenerateIDX();
            ChangeIndex();
        }
Пример #27
0
        public void insertSingleSurat(FrmSuratMasuk frmSuratMasuk)
        {
            GridViewDataRowInfo dataRowInfo = new GridViewDataRowInfo(this.gvSuratMasuk.MasterView);
            dataRowInfo.Cells[0].Value = frmSuratMasuk.nomor_agenda;
            dataRowInfo.Cells[1].Value = string.Format("{0:dd MMM yyyy}", DateTime.Now);
            dataRowInfo.Cells[2].Value = string.Format("{0:HH:mm:ss}", DateTime.Now);
            dataRowInfo.Cells[3].Value = string.Format("{0:dd MMM yyyy}", frmSuratMasuk.dtTanggalMasuk.Value);
            dataRowInfo.Cells[4].Value = frmSuratMasuk.dropDownTipe.Text;
            dataRowInfo.Cells[5].Value = frmSuratMasuk.txtNomorSurat.Text;
            dataRowInfo.Cells[6].Value = string.Format("{0:dd MMM yyyy}", frmSuratMasuk.dtTanggalSurat.Value);
            dataRowInfo.Cells[7].Value = frmSuratMasuk.txtAsalSurat.Text;
            dataRowInfo.Cells[8].Value = frmSuratMasuk.txtPerihalSurat.Text;
            dataRowInfo.Cells[9].Value = frmSuratMasuk.dropDownTingkatKeamanan.Text;
            dataRowInfo.Cells[10].Value = frmSuratMasuk.txtRingkasanIsi.Text;
            dataRowInfo.Cells[11].Value = frmSuratMasuk.txtLampiran.Text;
            dataRowInfo.Cells[12].Value = T8UserLoginInfo.Username;
            this.gvSuratMasuk.Rows.Insert(0, dataRowInfo);

            object[] itmRow = new object[12];
            itmRow[0] = frmSuratMasuk.nomor_agenda;
            itmRow[1] = DateTime.Now;
            itmRow[2] = string.Format("{0:dd MMM yyyy}", frmSuratMasuk.dtTanggalMasuk.Value);
            itmRow[3] = frmSuratMasuk.dropDownTipe.Text;
            itmRow[4] = frmSuratMasuk.txtNomorSurat.Text;
            itmRow[5] = string.Format("{0:dd MMM yyyy}", frmSuratMasuk.dtTanggalSurat.Value);
            itmRow[6] = frmSuratMasuk.txtAsalSurat.Text;
            itmRow[7] = frmSuratMasuk.txtPerihalSurat.Text;
            itmRow[8] = frmSuratMasuk.dropDownTingkatKeamanan.Text;
            itmRow[9] = frmSuratMasuk.txtRingkasanIsi.Text;
            itmRow[10] = frmSuratMasuk.txtLampiran.Text;
            itmRow[11] = T8UserLoginInfo.Username;
            this.dt.Rows.Add(itmRow);
            this.count_no_limit++;
            lblRecordCount.Text = this.count_no_limit.ToString() + " data";
        }
Пример #28
0
        private void DetailView()
        {
            GridViewDataRowInfo dr = new GridViewDataRowInfo(this.gvSuratMasuk.MasterView);
            dr.Cells[0].Value = gvSuratMasuk.MasterView.Rows[gvSuratMasuk.SelectedRows[0].Index].Cells[0].Value;
            dr.Cells[1].Value = gvSuratMasuk.MasterView.Rows[gvSuratMasuk.SelectedRows[0].Index].Cells[1].Value;
            dr.Cells[2].Value = gvSuratMasuk.MasterView.Rows[gvSuratMasuk.SelectedRows[0].Index].Cells[2].Value;
            dr.Cells[3].Value = gvSuratMasuk.MasterView.Rows[gvSuratMasuk.SelectedRows[0].Index].Cells[3].Value;
            dr.Cells[4].Value = gvSuratMasuk.MasterView.Rows[gvSuratMasuk.SelectedRows[0].Index].Cells[4].Value;
            dr.Cells[5].Value = gvSuratMasuk.MasterView.Rows[gvSuratMasuk.SelectedRows[0].Index].Cells[5].Value;
            dr.Cells[6].Value = gvSuratMasuk.MasterView.Rows[gvSuratMasuk.SelectedRows[0].Index].Cells[6].Value;
            dr.Cells[7].Value = gvSuratMasuk.MasterView.Rows[gvSuratMasuk.SelectedRows[0].Index].Cells[7].Value;
            dr.Cells[8].Value = gvSuratMasuk.MasterView.Rows[gvSuratMasuk.SelectedRows[0].Index].Cells[8].Value;
            dr.Cells[9].Value = gvSuratMasuk.MasterView.Rows[gvSuratMasuk.SelectedRows[0].Index].Cells[9].Value;
            dr.Cells[10].Value = gvSuratMasuk.MasterView.Rows[gvSuratMasuk.SelectedRows[0].Index].Cells[10].Value;
            dr.Cells[11].Value = gvSuratMasuk.MasterView.Rows[gvSuratMasuk.SelectedRows[0].Index].Cells[11].Value;
            dr.Cells[12].Value = gvSuratMasuk.MasterView.Rows[gvSuratMasuk.SelectedRows[0].Index].Cells[12].Value;

            FrmDetailSurat frmDetailSurat = new FrmDetailSurat(dr);
            frmDetailSurat.ShowDialog();
        }
Пример #29
0
 private void addRow(GridViewDataRowInfo row)
 {
     this.gvUser.Rows.Insert(0, row);
 }
Пример #30
0
        public void insertSingleSuratKeluar(Surat.FrmSuratKeluar frmSuratKeluar)
        {
            GridViewDataRowInfo dataRowInfo = new GridViewDataRowInfo(this.gvSuratKeluar.MasterView);
            dataRowInfo.Cells[0].Value = frmSuratKeluar.nomor_surat;
            dataRowInfo.Cells[1].Value = string.Format("{0:dd MMM yyyy}", DateTime.Now);
            dataRowInfo.Cells[2].Value = string.Format("{0:HH:mm:ss}", DateTime.Now);
            dataRowInfo.Cells[3].Value = frmSuratKeluar.ddKategori.Text;
            dataRowInfo.Cells[4].Value = string.Format("{0:dd MMM yyyy}", frmSuratKeluar.dtTanggalKirim.Value);
            dataRowInfo.Cells[5].Value = frmSuratKeluar.txtTujuan.Text;
            dataRowInfo.Cells[6].Value = frmSuratKeluar.txtPerihalSurat.Text;
            dataRowInfo.Cells[7].Value = frmSuratKeluar.dropDownTingkatKeamanan.Text;
            dataRowInfo.Cells[8].Value = frmSuratKeluar.txtRingkasanIsi.Text;
            dataRowInfo.Cells[9].Value = frmSuratKeluar.txtLampiran.Text;
            dataRowInfo.Cells[10].Value = T8UserLoginInfo.Username;
            this.gvSuratKeluar.Rows.Insert(0, dataRowInfo);

            object[] itmRow = new object[10];
            itmRow[0] = frmSuratKeluar.nomor_surat;
            itmRow[1] = DateTime.Now;
            itmRow[2] = frmSuratKeluar.ddKategori.Text;
            itmRow[3] = string.Format("{0:dd MMM yyyy}", frmSuratKeluar.dtTanggalKirim.Value);
            itmRow[4] = frmSuratKeluar.txtTujuan.Text;
            itmRow[5] = frmSuratKeluar.txtPerihalSurat.Text;
            itmRow[6] = frmSuratKeluar.dropDownTingkatKeamanan.Text;
            itmRow[7] = frmSuratKeluar.txtRingkasanIsi.Text;
            itmRow[8] = frmSuratKeluar.txtLampiran.Text;
            itmRow[9] = T8UserLoginInfo.Username;
            this.dtSK.Rows.Add(itmRow);
            this.count_no_limitSK++;
            lblRecordCount.Text = this.count_no_limitSK.ToString() + " data";
        }
Пример #31
0
        private void addRow(GridViewDataRowInfo row)
        {
            if (tbTemplate.SelectedPage == radPageViewPage1)
            {
                this.gvTemplateKategori.Rows.Insert(0, row); 
            }

            if (tbTemplate.SelectedPage == radPageViewPage2)
            {
                this.gvAsalSurat.Rows.Insert(0, row); 
            }

            if (tbTemplate.SelectedPage == radPageViewPage3)
            {
                this.gvPenerima.Rows.Insert(0, row); 
            }

            if (tbTemplate.SelectedPage == radPageViewPage4)
            {
                this.gvTkKeamanan.Rows.Insert(0, row); 
            }

            if (tbTemplate.SelectedPage == radPageViewPage5)
            {
                this.gvLokasi.Rows.Insert(0, row); 
            }

            if (tbTemplate.SelectedPage == radPageViewPage6)
            {
                this.gvJenisPengiriman.Rows.Insert(0, row); 
            }
        }
Пример #32
0
 public FrmDetailSurat(GridViewDataRowInfo _dr)
 {
     InitializeComponent();
     dr = _dr;
 }
Пример #33
0
 private void addRowPenyelesaian(GridViewDataRowInfo row)
 {
     this.gvPenyelesaian.Rows.Insert(0, row);
 }
Пример #34
0
        private void GenerateDataSuratMasuk()
        {
            ClearItem();

            InitIndex();
            this.agenda_variable = new List<string>();

            nIDLen.Value = (int)AppDefaultSetting.surat_masuk_minimum_id_lenght;

            if (AppDefaultSetting.surat_masuk_index_start.ToLower() == "Message Box Confirmation Before Input".ToLower())
                rdoMessage.IsChecked = true;
            else
                rdoFlat.IsChecked = true;

            lblNomorAgenda.Text = AppDefaultSetting.surat_masuk_format_nomor_agenda;

            string[] format_nomor_agenda = AppDefaultSetting.surat_masuk_format_nomor_agenda.Split(AppDefaultSetting.surat_masuk_concat_nomor_agenda);

            this.radGridView1.Rows.Clear();
            for(int i=0;i<format_nomor_agenda.Length;i++)
            {
                if (format_nomor_agenda[i].ToLower() == "{id}".ToLower())
                {
                    ddIdxId.SelectedIndex = i;
                    this.agenda_variable.Insert(i, format_nomor_agenda[i]);
                }
                else if (format_nomor_agenda[i].ToLower() == "{kategori}".ToLower())
                {
                    chkKategori.Checked = AppDefaultSetting.surat_keluar_include_kategori_nomor_agenda;
                }
                else if (format_nomor_agenda[i].ToLower() == "{day}".ToLower())
                {
                    chkIncludeDay.Checked = AppDefaultSetting.surat_keluar_include_day_nomor_agenda;
                }
                else if (format_nomor_agenda[i].ToLower() == "{month}".ToLower())
                { 
                    chkIncludeMonth.Checked = AppDefaultSetting.surat_keluar_include_month_nomor_agenda;
                }
                else if (format_nomor_agenda[i].ToLower() == "{year}".ToLower())
                { 
                    chkIncludeYear.Checked = AppDefaultSetting.surat_keluar_include_year_nomor_agenda;
                }
                else if (format_nomor_agenda[i].ToLower() == "{tkkeamanan}".ToLower())
                {
                    chkTkKeamanan.Checked = AppDefaultSetting.surat_keluar_include_tingkat_keamanan_nomor_agenda;
                }
                else
                {
                    GridViewDataRowInfo dataRowInfo = new GridViewDataRowInfo(this.radGridView1.MasterView);
                    dataRowInfo.Cells[0].Value = format_nomor_agenda[i];
                    dataRowInfo.Cells[1].Value = "";
                    this.radGridView1.Rows.Insert(0, dataRowInfo);
                    this.agenda_variable.Insert(i, format_nomor_agenda[i]);
                    this.idxStaticValue.Add(this.agenda_variable.Count - 1);
                }
            }

            ddFormatDay.Text = AppDefaultSetting.surat_masuk_format_day;
            ddFormatMonth.Text = AppDefaultSetting.surat_masuk_format_month;
            ddFormatYear.Text = AppDefaultSetting.surat_masuk_format_year;

            if (AppDefaultSetting.surat_masuk_reset_role.ToLower() != "")
            {
                chkReset.Checked = true;

                if (AppDefaultSetting.surat_masuk_reset_role.ToString().ToLower() == "Kategori".ToLower())
                    ddReset.SelectedIndex = 0;
                else if (AppDefaultSetting.surat_masuk_reset_role.ToString().ToLower() == "TkKeamanan".ToLower())
                    ddReset.SelectedIndex = 1;
                else if (AppDefaultSetting.surat_masuk_reset_role.ToString().ToLower() == "Daily".ToLower())
                    ddReset.SelectedIndex = 2;
                else if (AppDefaultSetting.surat_masuk_reset_role.ToString().ToLower() == "Monthly".ToLower())
                    ddReset.SelectedIndex = 3;
                else if (AppDefaultSetting.surat_masuk_reset_role.ToString().ToLower() == "Yearly".ToLower())
                    ddReset.SelectedIndex = 4;
            }

            if (AppDefaultSetting.surat_masuk_concat_nomor_agenda.ToString().ToLower() == "/")
                ddConcat.SelectedIndex = 0;
            else if (AppDefaultSetting.surat_masuk_concat_nomor_agenda.ToString().ToLower() == "-")
                ddConcat.SelectedIndex = 1;
            else if (AppDefaultSetting.surat_masuk_concat_nomor_agenda.ToString().ToLower() == ".")
                ddConcat.SelectedIndex = 2;
            else if (AppDefaultSetting.surat_masuk_concat_nomor_agenda.ToString().ToLower() == " ")
                ddConcat.SelectedIndex = 3;
            GenerateIDX();
            ChangeIndex(); 
        }
Пример #35
0
 private void addRow(GridViewDataRowInfo _row)
 {
     this.gvHistoryLoginUser.Rows.Insert(0, _row);
 }
Пример #36
0
 private void addRow(GridViewDataRowInfo row)
 {
     this.gvUser.Rows.Insert(0, row);
 }
Пример #37
0
 private GridViewRowInfo GetDataRow(DataTable dt, int i)
 {//select SQL_NO_CACHE `id`, `nomor_surat`, `datetime_input`, `kolom`, `data_lama`, `data_baru`, `user` ");
     GridViewDataRowInfo dataRowInfo = new GridViewDataRowInfo(this.gvHistoryLoginUser.MasterView);
     dataRowInfo.Cells[0].Value = dt.Rows[i][0];
     dataRowInfo.Cells[1].Value = dt.Rows[i][1];
     dataRowInfo.Cells[2].Value = string.Format("{0:dd MMM yyyy}", dt.Rows[i][2]);
     dataRowInfo.Cells[3].Value = string.Format("{0:HH:mm:ss}", dt.Rows[i][2]);
     dataRowInfo.Cells[4].Value = dt.Rows[i][3];
     dataRowInfo.Cells[5].Value = dt.Rows[i][4];
     dataRowInfo.Cells[6].Value = dt.Rows[i][5];
     dataRowInfo.Cells[7].Value = dt.Rows[i][6];
     return dataRowInfo;
 }
Пример #38
0
 private GridViewDataRowInfo GetDataRow(System.Data.DataTable dt, int i)
 {
     GridViewDataRowInfo dataRowInfo = new GridViewDataRowInfo(this.gvSejarahDisposisi.MasterView);
     dataRowInfo.Cells[0].Value = dt.Rows[i][0];
     dataRowInfo.Cells[1].Value = dt.Rows[i][1];
     dataRowInfo.Cells[2].Value = string.Format("{0:dd MMM yyyy}", dt.Rows[i][2]);
     dataRowInfo.Cells[3].Value = string.Format("{0:HH:mm:ss}", dt.Rows[i][2]);
     dataRowInfo.Cells[4].Value = string.Format("{0:dd MMM yyyy}", dt.Rows[i][3]);
     dataRowInfo.Cells[5].Value = dt.Rows[i][4];
     dataRowInfo.Cells[6].Value = dt.Rows[i][5];
     dataRowInfo.Cells[7].Value = dt.Rows[i][6];
     return dataRowInfo;
 }
Пример #39
0
 private void addRow(GridViewDataRowInfo _row)
 {
     this.gvHistoryLoginUser.Rows.Insert(0, _row);
 }
Пример #40
0
 private void addRow(GridViewDataRowInfo row)
 {
     this.gvSejarahDisposisi.Rows.Insert(0, row);
 }
Пример #41
0
        private GridViewDataRowInfo GetDataRow(DataTable dt, int i)
        {
            GridViewDataRowInfo dataRowInfo = null;
            if (tbTemplate.SelectedPage == radPageViewPage1)
            {
                dataRowInfo = new GridViewDataRowInfo(this.gvTemplateKategori.MasterView);
            }

            if (tbTemplate.SelectedPage == radPageViewPage2)
            {
                dataRowInfo = new GridViewDataRowInfo(this.gvAsalSurat.MasterView);
            }

            if (tbTemplate.SelectedPage == radPageViewPage3)
            {
                dataRowInfo = new GridViewDataRowInfo(this.gvPenerima.MasterView);
            }

            if (tbTemplate.SelectedPage == radPageViewPage4)
            {
                dataRowInfo = new GridViewDataRowInfo(this.gvTkKeamanan.MasterView);
            }

            if (tbTemplate.SelectedPage == radPageViewPage5)
            {
                dataRowInfo = new GridViewDataRowInfo(this.gvLokasi.MasterView);
            }

            if (tbTemplate.SelectedPage == radPageViewPage6)
            {
                dataRowInfo = new GridViewDataRowInfo(this.gvJenisPengiriman.MasterView);
            }
            dataRowInfo.Cells[0].Value = dt.Rows[i][0];
            dataRowInfo.Cells[1].Value = dt.Rows[i][1];
            dataRowInfo.Cells[2].Value = dt.Rows[i][2];
            dataRowInfo.Cells[3].Value = dt.Rows[i][3];
            dataRowInfo.Cells[4].Value = dt.Rows[i][4];
            return dataRowInfo;
        }
Пример #42
0
 private GridViewRowInfo GetDataRow(DataTable dt, int i)
 {
     GridViewDataRowInfo dataRowInfo = new GridViewDataRowInfo(this.gvUser.MasterView);
     dataRowInfo.Cells[0].Value = dt.Rows[i][0];
     dataRowInfo.Cells[1].Value = dt.Rows[i][1];
     dataRowInfo.Cells[2].Value = dt.Rows[i][2];
     dataRowInfo.Cells[3].Value = string.Format("{0:dd MMM yyyy}", dt.Rows[i][3]);
     dataRowInfo.Cells[4].Value = string.Format("{0:HH:mm:ss}", dt.Rows[i][3]);
     dataRowInfo.Cells[5].Value = string.Format("{0:dd MMM yyyy}", dt.Rows[i][4]);
     dataRowInfo.Cells[6].Value = string.Format("{0:HH:mm:ss}", dt.Rows[i][4]);
     dataRowInfo.Cells[7].Value = dt.Rows[i][5];
     dataRowInfo.Cells[8].Value = string.Format("{0:dd MMM yyyy}", dt.Rows[i][6]);
     dataRowInfo.Cells[9].Value = string.Format("{0:HH:mm:ss}", dt.Rows[i][6]);
     dataRowInfo.Cells[10].Value = dt.Rows[i][7];
     return dataRowInfo;
 }
Пример #43
0
        void antminerStatusBackgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            var status = e.Result as AntminerStatus;
            if (status == null) return;

            var row = grdAntminers.Rows.SingleOrDefault(x => x.Tag.Equals(status.Id));
            if (row == null)
            {
                var rowInfo = new GridViewDataRowInfo(grdAntminers.MasterView) { Tag = status.Id };

                rowInfo.Cells[0].Value = status.Id;
                rowInfo.Cells[1].Value = _rowCount++;
                rowInfo.Cells[2].Value = DateTime.Now.ToString("h:mm:ss tt");
                rowInfo.Cells[3].Value = status.IpAddress;
                rowInfo.Cells[4].Value = status.Name;
                rowInfo.Cells[5].Value = status.Status;
                rowInfo.Cells[6].Value = status.Ghs5S;
                rowInfo.Cells[7].Value = status.GhsAv;
                rowInfo.Cells[8].Value = status.Blocks;
                rowInfo.Cells[9].Value = status.HardwareErrorPercentage;
                rowInfo.Cells[10].Value = status.RejectPercentage;
                rowInfo.Cells[11].Value = status.StalePercentage;
                rowInfo.Cells[12].Value = status.BestShare;
                rowInfo.Cells[13].Value = status.Fans;
                rowInfo.Cells[14].Value = status.Temps;
                rowInfo.Cells[15].Value = status.Freq;
                rowInfo.Cells[16].Value = status.AsicStatus;

                if (grdAntminers.InvokeRequired)
                    grdAntminers.Invoke(new MethodInvoker(() => grdAntminers.Rows.Add(rowInfo)));
                else
                    grdAntminers.Rows.Add(rowInfo);
            }
            else
            {
                grdAntminers.Invoke(new MethodInvoker(() =>
                {
                    row.Cells[0].Value = status.Id;
                    row.Cells[2].Value = DateTime.Now.ToString("h:mm:ss tt");
                    row.Cells[3].Value = status.IpAddress;
                    row.Cells[4].Value = status.Name;
                    row.Cells[5].Value = status.Status;
                    row.Cells[6].Value = status.Ghs5S;
                    row.Cells[7].Value = status.GhsAv;
                    row.Cells[8].Value = status.Blocks;
                    row.Cells[9].Value = status.HardwareErrorPercentage;
                    row.Cells[10].Value = status.RejectPercentage;
                    row.Cells[11].Value = status.StalePercentage;
                    row.Cells[12].Value = status.BestShare;
                    row.Cells[13].Value = status.Fans;
                    row.Cells[14].Value = status.Temps;
                    row.Cells[15].Value = status.Freq;
                    row.Cells[16].Value = status.AsicStatus;
                }));
            }
            
            _antminerStatuses.Add(status);

            _inProgressCount--;
        }
Пример #44
0
 public void InsertSingleData(FrmTambahUser _frmTambahUser)
 {
     GridViewDataRowInfo dataRowInfo = new GridViewDataRowInfo(this.gvUser.MasterView);
     dataRowInfo.Cells[0].Value = _frmTambahUser.txtUsername.Text;
     dataRowInfo.Cells[1].Value = T8GlobalFunc.MD5Encrypt(_frmTambahUser.txtPassword.Text);
     dataRowInfo.Cells[2].Value = _frmTambahUser.hakAksesUser;
     dataRowInfo.Cells[3].Value = null;
     dataRowInfo.Cells[4].Value = null;
     dataRowInfo.Cells[5].Value = _frmTambahUser.status;
     dataRowInfo.Cells[6].Value = string.Format("{0:dd MMM yyyy}", DateTime.Now);
     dataRowInfo.Cells[7].Value = string.Format("{0:HH:mm:ss}", DateTime.Now);
     dataRowInfo.Cells[8].Value = T8UserLoginInfo.Username;
     gvUser.Rows.Insert(0, dataRowInfo);
 }
Пример #45
0
        private void radGridViewCustmerReturn_ValueChanged(object sender, EventArgs e)
        {
            DataRowView         cRow       = this.radGridViewCutomerReturn.CurrentRow.DataBoundItem as DataRowView;
            DataRow             currentRow = cRow.Row;
            GridViewDataRowInfo rrow       = this.radGridViewCutomerReturn.CurrentRow as GridViewDataRowInfo;

            if (radGridViewCutomerReturn.CurrentCell != null)
            {
                if (radGridViewCutomerReturn.CurrentCell.Value.Equals(0))
                {
                    try
                    {
                        IQueryable <LOAN> loans = (from LOAN in VpretContext.Instance.vPretContext.LOAN
                                                   where LOAN.LOA_CP.Equals(currentRow["N° CP"].ToString())
                                                   select LOAN);
                        if (loans != null)
                        {
                            foreach (LOAN loan in loans)
                            {
                                VpretContext.Instance.vPretContext.LOAN.DeleteOnSubmit(loan);
                                VpretContext.Instance.vPretContext.SubmitChanges();
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Log.UCRP.Error("Exception SQl radGridViewRetourClient_ValueChanged : " + ex.ToString());
                    }
                    finally
                    {
                        Log.UCRP.Debug("radGridViewRetourClient_ValueChanged - Loans deleted");
                    }
                }

                else if (radGridViewCutomerReturn.CurrentCell.Value.Equals(1))
                {
                    CommentDialog dialog = new CommentDialog();
                    dialog.StartPosition = FormStartPosition.CenterScreen;
                    dialog.ShowDialog();

                    //   DateTime loaDate = Convert.ToDateTime(currentRow["Date LP"].ToString());
                    DateTime loaDateRetour = Convert.ToDateTime(currentRow["Date retour prévue"].ToString());

                    try
                    {
                        List <LOAN> loans = (from LOAN in VpretContext.Instance.vPretContext.LOAN
                                             where LOAN.LOA_CP == currentRow["N° CP"].ToString()
                                             select LOAN).ToList();
                        if (loans.Count() > 0)
                        {
                            foreach (LOAN loan in loans)
                            {
                                if (loan.LOA_STATE > 1)
                                {
                                    loan.LOA_STATE = 1;
                                }
                            }
                            VpretContext.Instance.vPretContext.SubmitChanges();
                        }
                        else
                        {
                            string commG = " ";
                            if (dialog.Comment != "")
                            {
                                commG = dialog.Comment;
                            }
                            LOAN newLoan = new LOAN
                            {
                                LOA_CLIENT = currentRow["Client"].ToString(),
                                LOA_CP     = currentRow["N° CP"].ToString(),
                                // LOA_DATE = loaDate,
                                LOA_DATE_RETOUR = loaDateRetour,
                                LOA_NUM_CLIENT  = Int32.Parse(currentRow["N° de Client"].ToString()),
                                LOA_STATE       = 1, // 0 en cours 1 à controler 2 terminé
                                LOA_COMM_G      = commG
                            };
                            VpretContext.Instance.vPretContext.LOAN.InsertOnSubmit(newLoan);
                            VpretContext.Instance.vPretContext.SubmitChanges();

                            int idLoan = newLoan.LOA_ID;
                            GridViewDataRowInfo      row          = this.radGridViewCutomerReturn.CurrentRow as GridViewDataRowInfo;
                            GridViewHierarchyRowInfo hierarchyRow = row as GridViewHierarchyRowInfo;
                            if (hierarchyRow != null)
                            {
                                IterateChildRowsAndAddProduct(hierarchyRow, idLoan);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Log.UCRP.Error("radGridViewRetourClient_ValueChanged() : " + ex.ToString());
                    }
                    finally
                    {
                        Log.UCRP.Debug("radGridViewRetourClient_ValueChanged() : STATUT : PASSED");
                    }
                }
            }
        }
Пример #46
0
 public FrmDetailSurat(GridViewDataRowInfo _dr)
 {
     InitializeComponent();
     dr = _dr;
 }
Пример #47
0
 public FrmInfoSuratKeluar(GridViewDataRowInfo _dr)
 {
     InitializeComponent();
     dr = _dr;
 }
Пример #48
0
        private void deleteButton_Click(object sender, EventArgs e)
        {
            GridViewDataRowInfo dataRowInfo = radGridView1.CurrentRow as GridViewDataRowInfo;

            BaseService.GetMessage("can not delete project", "error");
        }
Пример #49
0
 private void InsertSingleData(string _template, string _status)
 {
     GridViewDataRowInfo dataRowInfo = new GridViewDataRowInfo(this.gvTemplateKategori.MasterView);
     dataRowInfo.Cells[0].Value = txtNama.Text;
     dataRowInfo.Cells[1].Value = txtSimbol.Text;
     dataRowInfo.Cells[2].Value = txtKeterangan.Text;
     dataRowInfo.Cells[3].Value = _template;
     dataRowInfo.Cells[4].Value = _status;
     this.gvTemplateKategori.Rows.Insert(0, dataRowInfo);
 }