Ejemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (rddProduct.SelectedValue == null)
            {
                helper.ErrorMessage("Silahkan pilih produk");
                txtQuantity.Focus();
            }
            else
            if (decimal.Parse(txtQuantity.Text) <= 0)
            {
                helper.ErrorMessage("Jumlah produk harus lebih dari 0");
                txtQuantity.Focus();
            }
            else
            {
                GridViewRowInfo row = radGridView1.Rows.AddNew();
                row.Cells["productid"].Value    = rddProduct.SelectedValue;
                row.Cells["status"].Value       = 1;
                row.Cells["quantity"].Value     = txtQuantity.Text;
                row.Cells["custtypeid"].Value   = rddProduct.Tag.ToString();
                row.Cells["custtypetoid"].Value = rddTipe.SelectedValue.ToString();
                row.Cells["keterangan"].Value   = txtKeteranganDetail.Text;

                rddProduct.ResetText();
                txtQuantity.ResetText();
                txtKeteranganDetail.ResetText();
                rddProduct.Focus();
            }
        }
Ejemplo n.º 2
0
        public HCSCM_storage_set(SortedList sltmp)
        {
            InitializeComponent();
            sltep = sltmp;
            this.but_addall.Image = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "allRight", EnumImageType.PNG);
            this.but_addone.Image = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "rightShift", EnumImageType.PNG);
            this.but_reall.Image  = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "allLeft", EnumImageType.PNG);
            this.but_reone.Image  = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "leftShift", EnumImageType.PNG);
            this.but_save.Image   = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "savePicture", EnumImageType.PNG);
            //设置窗体图标
            this.Icon = new Icon(ResourcesImageHelper.Instance.GetResourcesStream("Common.icon", "MainIco", EnumImageType.ICO));
            //this.Font = new Font(this.Font.FontFamily, 11);
            tb_storage.Text = sltmp["s_name"].ToString();
            storageid       = sltmp["id"].ToString();
            this.Text       = ConfigurationManager.AppSettings["SystemName"] + "--配置实体包";
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    slttp           = new SortedList();

            slttp.Add(1, CnasBaseData.SystemID);
            slttp.Add(2, sltmp["s_customer"].ToString());
            Dataset = reCnasRemotCall.RemotInterface.SelectData("HCS-set-sec025", slttp);
            if (Dataset != null)
            {
                for (int i = 0; i < Dataset.Rows.Count; i++)
                {
                    string s_id = "", s_name = "";
                    if (Dataset.Columns.Contains("id") && Dataset.Rows[i]["id"] != null)
                    {
                        s_id = Dataset.Rows[i]["id"].ToString();
                    }
                    if (Dataset.Columns.Contains("ca_name") && Dataset.Rows[i]["ca_name"] != null)
                    {
                        s_name = Dataset.Rows[i]["ca_name"].ToString();
                    }
                    GridViewRowInfo drtemp01 = null;

                    //drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
                    //drtemp01.Cells.Add(new DataGridViewTextBoxCell());//ID
                    //drtemp01.Cells.Add(new DataGridViewTextBoxCell());//名字
                    //drtemp01.SetValues(false, s_id, s_name);
                    if (Dataset.Rows[i]["storage_id"] != null && Dataset.Rows[i]["storage_id"].ToString() == storageid.ToString())
                    {
                        drtemp01 = dgv_02.Rows.AddNew();
                        sl_02data.Add(s_id, s_name);
                    }
                    else
                    {
                        drtemp01 = dgv_01.Rows.AddNew();
                        sl_data01.Add(s_id, s_name);
                    }
                    if (drtemp01 != null)
                    {
                        drtemp01.Cells[0].Value = s_id;
                        drtemp01.Cells[1].Value = s_name;
                    }
                    _allRow.Add(drtemp01);
                    drtemp01.Tag = Dataset.Rows[i];
                }
            }
        }
Ejemplo n.º 3
0
        private void MoveRows(RadGridView dragGrid,
                              GridViewRowInfo dragRow, int index)
        {
            dragGrid.BeginUpdate();

            GridViewRowInfo row = dragRow;

            if (row is GridViewSummaryRowInfo)
            {
                return;
            }
            if (dragGrid.DataSource != null && typeof(System.Collections.IList).IsAssignableFrom(dragGrid.DataSource.GetType()))
            {
                //bound to a list of objects scenario
                var sourceCollection = (System.Collections.IList)dragGrid.DataSource;
                if (row.Index < index)
                {
                    index--;
                }
                sourceCollection.Remove(row.DataBoundItem);
                sourceCollection.Insert(index, row.DataBoundItem);
            }
            else
            {
                throw new ApplicationException("Unhandled Scenario");
            }

            dragGrid.EndUpdate(true);
        }
Ejemplo n.º 4
0
        void grdServiceCharges_CommandCellClick(object sender, EventArgs e)
        {
            try
            {
                GridCommandCellElement gridCell = (GridCommandCellElement)sender;
                string name = gridCell.ColumnInfo.Name.ToLower();

                GridViewRowInfo row = gridCell.RowElement.RowInfo;

                if (name == "btndelete")
                {
                    int Id = row.Cells[COLS.Id].Value.ToInt();
                    if (Id > 0)
                    {
                        using (TaxiDataContext db = new TaxiDataContext())
                        {
                            db.stp_RunProcedure("delete from gen_servicecharges where id=" + Id);
                        }

                        grdServiceCharges.CurrentRow.Delete();
                    }
                }
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
Ejemplo n.º 5
0
        private void UpdateGridInfo(GridViewRowInfo currentRow)
        {
            if (currentRow == null)
            {
                return;
            }

            this.radGridView1.CloseEditor();

            currentRow.Cells["ProductName"].Value  = this.radTextBoxProductName.Text;
            currentRow.Cells["Manufacturer"].Value = this.radTextBoxManufacturer.Text;
            currentRow.Cells["Lining"].Value       = this.radTextBoxMaterial.Text;
            currentRow.Cells["Dimensions"].Value   = this.radTextBoxDimension.Text;

            if (this.radComboBox1.SelectedIndex != -1)
            {
                currentRow.Cells["SalesRepresentative"].Value = this.radComboBox1.SelectedItem.Text;
            }

            GridViewNewRowInfo newRowInfo = currentRow as GridViewNewRowInfo;

            if (newRowInfo != null)
            {
                currentRow.InvalidateRow();
            }
            else
            {
                ((IEditableObject)this.radGridView1.CurrentRow.DataBoundItem).EndEdit();
            }
        }
Ejemplo n.º 6
0
 private void SetCurrentSelectionIndex()
 {
     if (this.radGridViewTileConfig.CurrentRow is GridViewDataRowInfo)
     {
         _currentSelectedRow = radGridViewTileConfig.CurrentRow;
     }
 }
Ejemplo n.º 7
0
        private void MoveRows(RadGridView targetGrid, RadGridView dragGrid, List <GridViewRowInfo> dragRows, int index)
        {
            dragGrid.BeginUpdate();
            targetGrid.BeginUpdate();
            for (int i = dragRows.Count - 1; i >= 0; i--)
            {
                GridViewRowInfo row = dragRows[i];
                if (row is GridViewSummaryRowInfo)
                {
                    continue;
                }
                if (targetGrid.DataSource == null)
                {
                    //unbound scenario
                    GridViewRowInfo newRow = targetGrid.Rows.NewRow();
                    foreach (GridViewCellInfo cell in row.Cells)
                    {
                        if (newRow.Cells[cell.ColumnInfo.Name] != null)
                        {
                            newRow.Cells[cell.ColumnInfo.Name].Value = cell.Value;
                        }
                    }

                    targetGrid.Rows.Insert(index, newRow);

                    row.IsSelected = false;
                    dragGrid.Rows.Remove(row);
                }
                else if (typeof(DataSet).IsAssignableFrom(targetGrid.DataSource.GetType()))
                {
                    //bound to a dataset scenario
                    var sourceTable = ((DataSet)dragGrid.DataSource).Tables[0];
                    var targetTable = ((DataSet)targetGrid.DataSource).Tables[0];

                    var newRow = targetTable.NewRow();
                    foreach (GridViewCellInfo cell in row.Cells)
                    {
                        newRow[cell.ColumnInfo.Name] = cell.Value;
                    }

                    sourceTable.Rows.Remove(((DataRowView)row.DataBoundItem).Row);
                    targetTable.Rows.InsertAt(newRow, index);
                }
                else if (typeof(IList).IsAssignableFrom(targetGrid.DataSource.GetType()))
                {
                    //bound to a list of objects scenario
                    var targetCollection = (IList)targetGrid.DataSource;
                    var sourceCollection = (IList)dragGrid.DataSource;
                    sourceCollection.Remove(row.DataBoundItem);
                    targetCollection.Add(row.DataBoundItem);
                }
                else
                {
                    throw new ApplicationException("Unhandled Scenario");
                }
                index++;
            }
            dragGrid.EndUpdate(true);
            targetGrid.EndUpdate(true);
        }
Ejemplo n.º 8
0
        public override void Collapse(GridViewRowInfo rowInfo, float maxOffset, int rowIndex)
        {
            this.IsAnimating = true;
            this.OnUpdateViewNeeded(EventArgs.Empty);
            IList <GridRowElement> visualRows = this.TableElement.VisualRows;

            for (int index = rowIndex; index < visualRows.Count; ++index)
            {
                GridRowElement gridRowElement = visualRows[index];
                if (gridRowElement.Visibility != ElementVisibility.Hidden)
                {
                    new AnimatedPropertySetting(VisualElement.OpacityProperty, (object)0.0, (object)1.0, 9, 30)
                    {
                        ApplyEasingType  = RadEasingType.OutQuint,
                        RemoveAfterApply = true,
                        ApplyDelay       = ((index - rowIndex) * 25)
                    }.ApplyValue((RadObject)gridRowElement);
                    AnimatedPropertySetting animatedPropertySetting = new AnimatedPropertySetting(RadElement.PositionOffsetProperty, (object)new SizeF(0.0f, maxOffset), (object)new SizeF(0.0f, 0.0f), 9, 30);
                    animatedPropertySetting.ApplyEasingType  = RadEasingType.OutQuad;
                    animatedPropertySetting.RemoveAfterApply = true;
                    animatedPropertySetting.ApplyDelay       = (index - rowIndex) * 25;
                    animatedPropertySetting.ApplyValue((RadObject)gridRowElement);
                    if (index == visualRows.Count - 1)
                    {
                        animatedPropertySetting.AnimationFinished += new AnimationFinishedEventHandler(this.CollapseSetting_AnimationFinished);
                    }
                }
            }
        }
Ejemplo n.º 9
0
 private void InitializeHeaderRow(GridViewRowInfo row)
 {
     row.Cells[clientColumnIndex].Value    = "Client";
     row.Cells[feeColumnIndex].Value       = "Fee";
     row.Cells[comissionColumnIndex].Value = "Comission";
     row.Cells[totalColumnIndex].Value     = "Total";
 }
Ejemplo n.º 10
0
 private void InitializeRow(GridViewRowInfo row, string client, decimal fee, decimal comission)
 {
     row.Cells[clientColumnIndex].Value    = client;
     row.Cells[feeColumnIndex].Value       = String.Format("{0:C}", fee);
     row.Cells[comissionColumnIndex].Value = String.Format("{0:C}", comission);
     row.Cells[totalColumnIndex].Value     = String.Format("{0:C}", fee + comission);
 }
        private void RemotePrintQueueSelectionForm_Load(object sender, EventArgs e)
        {
            if (_selectedPrintQueueIds.Count > 0 && printQueue_GridView.RowCount > 0)
            {
                printQueue_GridView.Rows[0].IsCurrent = false;

                bool scrollToFirst = true;
                foreach (string queueId in _selectedPrintQueueIds)
                {
                    GridViewRowInfo row = printQueue_GridView.Rows.Where(r => (string)r.Cells[0].Value == queueId).FirstOrDefault();
                    if (row != null)
                    {
                        row.IsSelected = true;
                        if (scrollToFirst)
                        {
                            printQueue_GridView.TableElement.ScrollTo(row.Index, 0);
                            scrollToFirst = false;
                        }
                    }
                }
            }
            else if (printQueue_GridView.RowCount > 0)
            {
                printQueue_GridView.Rows.First().IsSelected = true;
            }
        }
Ejemplo n.º 12
0
        private void remove_ToolStripButton_Click(object sender, EventArgs e)
        {
            GridViewRowInfo row = GetFirstSelectedRow();

            if (row != null)
            {
                ServerSetting setting = row.DataBoundItem as ServerSetting;

                DialogResult dialogResult = MessageBox.Show
                                            (
                    $"Removing setting '{setting.Name}'.  Do you want to continue?",
                    "Delete Setting",
                    MessageBoxButtons.YesNo,
                    MessageBoxIcon.Question

                                            );

                if (dialogResult == DialogResult.Yes)
                {
                    using (AssetInventoryContext context = DbConnect.AssetInventoryContext())
                    {
                        FrameworkServer server = context.FrameworkServers.First(n => n.FrameworkServerId == setting.FrameworkServerId);
                        server.ServerSettings.Remove(server.ServerSettings.First(n => n.Name == setting.Name));
                        context.SaveChanges();

                        BindSettingsToGrid(context);
                    }
                }
            }
        }
Ejemplo n.º 13
0
        //initiate the move of selected row
        private void svc_PreviewDragDrop(object sender, RadDropEventArgs e)
        {
            GridDataRowElement rowElement = e.DragInstance as GridDataRowElement;

            if (rowElement == null)
            {
                return;
            }
            e.Handled = true;

            RadItem     dropTarget = e.HitTarget as RadItem;
            RadGridView targetGrid = dropTarget.ElementTree.Control as RadGridView;

            if (targetGrid == null)
            {
                return;
            }

            var dragGrid = rowElement.ElementTree.Control as RadGridView;

            if (targetGrid == dragGrid)
            {
                e.Handled = true;

                GridDataRowElement dropTargetRow = dropTarget as GridDataRowElement;
                int index = dropTargetRow != null?this.GetTargetRowIndex(dropTargetRow, e.DropLocation) : targetGrid.RowCount;

                GridViewRowInfo rowToDrag = dragGrid.SelectedRows[0];
                this.MoveRows(dragGrid, rowToDrag, index);
            }
        }
Ejemplo n.º 14
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (decimal.Parse(txtQuantity.Text) <= 0)
            {
                MessageBox.Show("Jumlah barang harus lebih dari 0", "SMS - Error Notification");
                txtQuantity.Focus();
            }
            else if (dtpExpire.Value == null)
            {
                MessageBox.Show("Tanggal belum di input.", "SMS - Error Notification");
                dtpExpire.Focus();
            }
            else
            {
                GridViewRowInfo row = radGridView1.Rows.AddNew();
                row.Cells["productid"].Value    = rddProduct.SelectedValue;
                row.Cells["custtypeid"].Value   = transtypeid_;
                row.Cells["custtypetoid"].Value = rddProduct.Tag;
                row.Cells["keterangan"].Value   = txtKeterangan.Text;
                row.Cells["quantity"].Value     = txtQuantity.Text;
                row.Cells["expireddate"].Value  = dtpExpire.Value;
                row.Cells["status"].Value       = statusbarang_;

                //reset fields
                rddProduct.ResetText();
                txtQuantity.ResetText();
                rddProduct.Focus();
                dtpExpire.ResetText();
                rbtnBaik.IsChecked = true;

                txtKeterangan.ResetText();
            }
        }
        void grdLister_CommandCellClick(object sender, EventArgs e)
        {
            GridCommandCellElement gridCell = (GridCommandCellElement)sender;
            RadGridView            grid     = gridCell.GridControl;

            if (gridCell.ColumnInfo.Name == "btnCreateBooking")
            {
                GridViewRowInfo row = grid.CurrentRow;
                if (row != null && row is GridViewRowInfo)
                {
                    if (gridCell.ColumnInfo.Name == "btnCreateBooking")
                    {
                        string phone    = row.Cells["TelephoneNo"].Value.ToStr().Trim();
                        string mobileNo = row.Cells["MobileNo"].Value.ToStr().Trim();
                        string email    = row.Cells["Email"].Value.ToStr().Trim();

                        General.ShowBookingForm(0, false, row.Cells["Name"].Value.ToStr(), phone, mobileNo,
                                                row.Cells["DoorNo"].Value.ToStr(), row.Cells["Address"].Value.ToStr(), email);
                    }
                }
            }
            else if (gridCell.ColumnInfo.Name == "ColEdit")
            {
                ViewDetailForm();
            }
        }
Ejemplo n.º 16
0
        private void ShowPaymentHistory(List <DriverCommission_PaymentHistory> list)
        {
            try
            {
                grdPaymentHistory.Rows.Clear();

                GridViewRowInfo row = null;
                foreach (var item in list)
                {
                    row = grdPaymentHistory.Rows.AddNew();

                    row.Cells["PaymentDate"].Value = string.Format("{0:dd/MM/yyyy HH:mm}", item.PaymentDate.ToDateTime());

                    row.Cells["Balance"].Value       = item.OldBalance.ToDecimal();
                    row.Cells["CommissionPay"].Value = item.CommissionPay.ToDecimal();
                    row.Cells["BalanceDue"].Value    = item.BalanceDue.ToDecimal();
                    row.Cells["Reason"].Value        = item.DriverCommissionPayReason.DefaultIfEmpty().CommissionReason.ToStr();

                    row.Cells["Id"].Value = item.Id;
                }


                //txtRentPaid.Visible = true;
                //txtRentPaidSign.Visible = true;
                //txtIsPaid.Visible = true;
                //txtRentPaid.Text = list.Sum(c => c.CommissionPay.ToDecimal().ToDecimal()).ToStr();
            }
            catch (Exception ex)
            {
                //
            }
        }
        void grdPostCodes_CellEndEdit(object sender, GridViewCellEventArgs e)
        {
            //SelectedPostCodes();
            // PopulateSelectedPostCodes();

            var row = e.Row;

            if (row != null && row is GridViewDataRowInfo)
            {
                bool ischecked = e.Value.ToBool();


                if (ischecked)
                {
                    if (grdSelectedPostCodes.Rows.Count(c => c.Cells[COLS.PostCode].Value.ToStr().Trim() == row.Cells[COLS.PostCode].Value.ToStr().Trim()) == 0)
                    {
                        GridViewRowInfo rowInfo = grdSelectedPostCodes.Rows.AddNew();


                        rowInfo.Cells[COLS.Id].Value       = row.Cells[COLS.Id].Value;
                        rowInfo.Cells[COLS.PostCode].Value = row.Cells[COLS.PostCode].Value.ToStr();
                        rowInfo.Cells[COLS.AreaName].Value = row.Cells[COLS.AreaName].Value.ToStr();
                    }
                }
                else
                {
                    if (grdSelectedPostCodes.Rows.Count(c => c.Cells[COLS.PostCode].Value.ToStr().Trim() == row.Cells[COLS.PostCode].Value.ToStr().Trim()) > 0)
                    {
                        grdSelectedPostCodes.Rows.Remove(grdSelectedPostCodes.Rows.FirstOrDefault(c => c.Cells[COLS.PostCode].Value.ToStr().Trim() == row.Cells[COLS.PostCode].Value.ToStr().Trim()));
                    }
                }

                lblSelectedPostCodes.Text = "Selected PostCodes " + (grdSelectedPostCodes.Rows.Count);
            }
        }
Ejemplo n.º 18
0
        private void RefreshItems()
        {
            int index = (radGridViewCameras.CurrentRow != null ? radGridViewCameras.CurrentRow.Index : 0);

            using (new BusyCursor())
            {
                SortableBindingList <Camera> cameras = new SortableBindingList <Camera>();
                foreach (Camera camera in GetCameras())
                {
                    cameras.Add(camera);
                }

                BindingSource bindingSource = new BindingSource();
                bindingSource.DataSource      = cameras;
                radGridViewCameras.DataSource = bindingSource;

                GridViewRowInfo foundRow = null;
                while (radGridViewCameras.RowCount > 0)
                {
                    foundRow = radGridViewCameras.Rows.FirstOrDefault(x => x.Index == index);
                    if (foundRow != null)
                    {
                        radGridViewCameras.CurrentRow = foundRow;
                        break;
                    }
                    index--;
                }
            }
        }
Ejemplo n.º 19
0
        private void RefreshItems()
        {
            int index = (radGridViewPrinters.CurrentRow != null ? radGridViewPrinters.CurrentRow.Index : 0);

            using (new BusyCursor())
            {
                var printers = GetPrinters();

                _printers.Clear();
                foreach (var item in printers)
                {
                    _printers.Add(item);
                }

                _bindingSource                 = new BindingSource();
                _bindingSource.DataSource      = _printers;
                radGridViewPrinters.DataSource = _bindingSource;

                GridViewRowInfo foundRow = null;
                while (radGridViewPrinters.RowCount > 0)
                {
                    foundRow = radGridViewPrinters.Rows.FirstOrDefault(x => x.Index == index);
                    if (foundRow != null)
                    {
                        radGridViewPrinters.CurrentRow = foundRow;
                        break;
                    }
                    index--;
                }
            }
        }
Ejemplo n.º 20
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (decimal.Parse(txtQuantity.Text) <= 0)
            {
                MessageBox.Show("Jumlah barang harus lebih dari 0", "SMS - Error Notification");
                txtQuantity.Focus();
            }
            else
            {
                GridViewRowInfo row = radGridView1.Rows.AddNew();
                row.Cells["productid"].Value    = rddProduct.SelectedValue;
                row.Cells["custtypeid"].Value   = rddSup.Tag;
                row.Cells["keterangan"].Value   = txtKeterangan.Text;
                row.Cells["quantity"].Value     = txtQuantity.Text;
                row.Cells["custtypetoid"].Value = rddProduct.Tag;
                row.Cells["status"].Value       = statusbarang_;
                row.Cells["harga"].Value        = 0;

                //reset fields
                rddProduct.ResetText();
                txtQuantity.ResetText();
                rddProduct.Focus();

                txtKeterangan.ResetText();
            }
        }
        void grdLister_CommandCellClick(object sender, EventArgs e)
        {
            GridCommandCellElement gridCell = (GridCommandCellElement)sender;

            if (gridCell.ColumnInfo.Name == "btnDelete")
            {
                GridViewRowInfo row = gridCell.RowInfo;

                if (row is GridViewDataRowInfo)
                {
                    long TranId = row.Cells[COLS.TranId].Value.ToLong();


                    if (TranId > 0)
                    {
                        try
                        {
                            int Id      = row.Cells[COLS.Id].Value.ToInt();
                            int TransId = row.Cells[COLS.TranId].Value.ToInt();

                            using (TaxiDataContext db = new TaxiDataContext())
                            {
                                if (db.GetTable <Fleet_DriverCommissionCollectionHistory_Detail>().Count(c => c.TransId == TransId) == 1)
                                {
                                    Fleet_DriverCommissionCollectionHistory objHistory = db.GetTable <Fleet_DriverCommissionCollectionHistory>().FirstOrDefault(c =>
                                                                                                                                                                (c.Id == TranId));


                                    if (objHistory != null)
                                    {
                                        db.Fleet_DriverCommissionCollectionHistories.DeleteOnSubmit(objHistory);
                                        db.SubmitChanges();
                                    }
                                }
                                else

                                {
                                    Fleet_DriverCommissionCollectionHistory_Detail objDetail = db.Fleet_DriverCommissionCollectionHistory_Details.FirstOrDefault(c => c.Id == Id);


                                    if (objDetail != null)
                                    {
                                        db.Fleet_DriverCommissionCollectionHistory_Details.DeleteOnSubmit(objDetail);
                                        db.SubmitChanges();
                                    }
                                }
                            }


                            PopulateData();
                        }
                        catch (Exception ex)
                        {
                            ENUtils.ShowMessage(ex.Message);
                        }
                    }
                }
            }
        }
Ejemplo n.º 22
0
        private void SetRowInfo(GridViewRowInfo row)
        {
            TriageDataInfo tdi = new TriageDataInfo();

            DbAccess db = new DbAccess(GlobalSettings.Database);

            using (DataLogContext dlc = new DataLogContext(db.getConStrSQL()))
            {
                Guid aeId = (Guid)row.Cells["ActivityExecutionId"].Value;
                tdi.DeviceId = ActivityExecutionAssetUsage.GetByActivityExecutionId(dlc, aeId).AssetId;
                ActivityExecution ae = ActivityExecution.GetById(dlc, aeId);
                SessionDevice     sd = SessionDevice.GetBySessionDeviceId(dlc, cboSessionIds.Text, tdi.DeviceId);

                tdi.ActivityType = ae.ActivityType;
                tdi.ActivityName = ae.ActivityName;
                tdi.UserName     = ae.UserName;

                if (sd != null)
                {
                    tdi.Firmware         = sd.FirmwareRevision;
                    tdi.FirmwareDatecode = sd.FirmwareDatecode;
                    tdi.Model            = sd.DeviceName;
                    tdi.IPAddress        = sd.IpAddress;
                    tdi.Product          = sd.ProductName;
                }

                var aepList = ActivityExecutionPerformance.GetByActivityExecutionId(dlc, aeId);
                tdi.AddPerformanceMarkers(aepList);
                SetPerformanceMarkers(tdi.PerformanceMarkers);

                lblDeviceId.Text         = tdi.DeviceId;
                lblIPAddress.Text        = tdi.IPAddress;
                lblModelInfo.Text        = tdi.Model;
                lblProduct.Text          = tdi.Product;
                lblFirmwareDatecode.Text = tdi.FirmwareDatecode;
                lblFirmwareRevision.Text = tdi.Firmware;
                lblUserId.Text           = tdi.UserName;
                lbActivityType.Text      = tdi.ActivityType;
                lblActivityName.Text     = tdi.ActivityName;
            }

            byte[] thumbnail = (byte[])row.Cells["Thumbnail"].Value;
            if (row.Cells["ControlIds"].Value != null)
            {
                string   regExp = @"[\n\r]+";
                string[] temp   = Regex.Split(row.Cells["ControlIds"].Value.ToString(), regExp);
                for (int ctr = 0; ctr < temp.Length; ctr++)
                {
                    errMessageAndroid.Text += temp[ctr];
                }
            }
            if (row.Cells["Reason"].Value != null)
            {
                rtbErrorMessage.Text = row.Cells["Reason"].Value.ToString();
            }
            tabControlInfo.SelectedIndex = 0;
            SetImage(pbThumbnail, thumbnail);
            pbControlPanel.Image = null;
        }
Ejemplo n.º 23
0
 public override Type GetCellType(GridViewRowInfo row)
 {
     if (row is GridViewDataRowInfo)
     {
         return(typeof(IndicatedDateTimeCellElement));
     }
     return(base.GetCellType(row));
 }
Ejemplo n.º 24
0
 private void UpdateGridInfo(GridViewRowInfo currentRow)
 {
     if (currentRow == null)
     {
         return;
     }
     UpdateWorkerInDB(currentRow);
 }
Ejemplo n.º 25
0
 private void rddNama_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Return)
     {
         GridViewRowInfo row = radGridView2.Rows.AddNew();
         row.Cells["MemberID"].Value = rddNama.SelectedValue;
     }
 }
Ejemplo n.º 26
0
 public override Type GetCellType(GridViewRowInfo row)
 {
     if (row is GridViewDataRowInfo)
     {
         return(typeof(RadioButtonCellElement));
     }
     return(base.GetCellType(row));
 }
Ejemplo n.º 27
0
 private void CategoryRadGridView_CellClick(object sender, GridViewCellEventArgs e)
 {
     if (e.RowIndex == -1)
     {
         return;
     }
     this._currentRowSeleted = this.CategoryRadGridView.CurrentRow;
 }
Ejemplo n.º 28
0
 private void UnitsRadGridView_CellClick(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
 {
     if (e.RowIndex == -1)
     {
         return;
     }
     this._currentRowSelected = this.UnitsRadGridView.CurrentRow;
 }
Ejemplo n.º 29
0
 public override Type GetCellType(GridViewRowInfo row)
 {
     if (row is GridViewDataRowInfo || row is GridViewNewRowInfo)
     {
         return(typeof(CustomCellElement));
     }
     return(base.GetCellType(row));
 }
        private void ClearColor(GridViewRowInfo txt)
        {
            //  if (txt.Cells[1].Style == null)
            //       txt.Cells[1].Style = new GridViewCellStyle();


            txt.Cells["BackgroundColorValue"].Value = null;
        }
        public override Type GetCellType(GridViewRowInfo row)
        {
            if (row is GridViewTableHeaderRowInfo)
            {
                return typeof(FastGridViewCheckBoxHeaderCell);
            }

            return base.GetCellType(row);
        }
Ejemplo n.º 32
0
        public static ProductNameRow ConvertRowInfoToProductNameRow(GridViewRowInfo row)
        {
            ProductNameRow res = new ProductNameRow();

            res.Code = (long)row.Cells[0].Value;
            res.Name = row.Cells[1].Value.ToString();
            res.Designation = row.Cells[2].Value.ToString();
            res.ProductCode = Convert.ToInt32(row.Cells[3].Value);
            res.TypeCode = Convert.ToInt32(row.Cells[4].Value);
            res.SignCode = Convert.ToInt32(row.Cells[5].Value);

            return res;
        }
Ejemplo n.º 33
0
        public static UnitRow ConvertRowInfoToUnitRow(GridViewRowInfo row)
        {
            UnitRow res = new UnitRow();

            res.FullName = row.Cells[1].Value.ToString();
            res.SmallName = row.Cells[2].Value.ToString();

            return res;
        }
Ejemplo n.º 34
0
        public static TypeRow ConvertRowInfoToTypeRow(GridViewRowInfo row)
        {
            TypeRow res = new TypeRow();

            res.Name = row.Cells[1].Value.ToString();

            return res;
        }
Ejemplo n.º 35
0
        public void PopulateGrid(Antminers ants)
        {
            var rows = new List<GridViewRowInfo>();
            foreach (var ant in ants.Antminer)
            {
                var rowInfo = new GridViewRowInfo(grdAntminers.MasterView) { Tag = ant.Id };

                rowInfo.Cells[0].Value = ant.Id;
                rowInfo.Cells[1].Value = _rowCount++;
                rowInfo.Cells[2].Value = DateTime.Now.ToString("h:mm:ss tt");
                rowInfo.Cells[3].Value = ant.IpAddress;
                rowInfo.Cells[4].Value = ant.Name;
                rowInfo.Cells[5].Value = "-------------";
                rowInfo.Cells[6].Value = 0;
                rowInfo.Cells[7].Value = 0;
                rowInfo.Cells[8].Value = 0;
                rowInfo.Cells[9].Value = "-";
                rowInfo.Cells[10].Value = 0;
                rowInfo.Cells[11].Value = 0;
                rowInfo.Cells[12].Value = 0;
                rowInfo.Cells[13].Value = "-";
                rowInfo.Cells[14].Value = "-";
                rowInfo.Cells[15].Value = "-";
                rowInfo.Cells[16].Value = "-";
                
                rows.Add(rowInfo);
            }

            if (grdAntminers.InvokeRequired)
                grdAntminers.Invoke(new MethodInvoker(() => grdAntminers.Rows.AddRange(rows.ToArray())));
            else
                grdAntminers.Rows.AddRange(rows.ToArray());
        }
Ejemplo n.º 36
0
        public static MaterialsRow ConvertRowInfoToMaterialRow(GridViewRowInfo row)
        {
            MaterialsRow res = new MaterialsRow();

            res.Code = (long)row.Cells[0].Value;
            res.Designation = row.Cells[1].Value.ToString();
            res.UnitCode = Convert.ToInt32(row.Cells[2].Value);

            return res;
        }
Ejemplo n.º 37
0
        public static FullApplicationRow ConvertRowInfoToFullApplicationRow(GridViewRowInfo row)
        {
            FullApplicationRow res = new FullApplicationRow();

            res.ProductCode = (long)row.Cells[0].Value;
            res.PackageDetails = (long)row.Cells[1].Value;
            res.Count = Convert.ToInt32(row.Cells[2].Value);

            return res;
        }
Ejemplo n.º 38
0
        public static CompositionRow ConvertRowInfoToCompositionRow(GridViewRowInfo row)
        {
            CompositionRow res = new CompositionRow();

            res.RootCode = (long)row.Cells[0].Value;
            res.WhereCode = (long)row.Cells[1].Value;
            res.WhatCode = (long)row.Cells[2].Value;
            res.Count = Convert.ToInt32(row.Cells[3].Value);

            return res;
        }
Ejemplo n.º 39
0
 private string generatedocLocation(GridViewRowInfo nowrow)
 {
     string loc = @"datas\" + nowrow.Cells["projectnumber"].Value+"\\";
     string docname = Convert.ToString(nowrow.Cells["docname"].Value)+".docx";
     return loc+docname;
 }
 private void UpdateIsValidColumnImage(bool isValid, GridViewRowInfo row)
 {
     try
     {
         if (isValid)
         {
             row.Cells[2].Value = ImageResources.CheckCircle;
         }
         else
         {
             row.Cells[2].Value = ImageResources.ExclamationCircle;
         }
     }
     catch (Exception ex)
     {
         row.Cells[2].Value = ImageResources.ExclamationCircle;
     }
 }
Ejemplo n.º 41
0
        public static ProductRow ConvertRowInfoToProductRow(GridViewRowInfo row)
        {
            ProductRow res = new ProductRow();

            res.Name = row.Cells[1].Value.ToString();

            return res;
        }
Ejemplo n.º 42
0
        public static StandartRow ConvertRowInfoToStandartRow(GridViewRowInfo row)
        {
            StandartRow res = new StandartRow();

            res.ProductCode = (long)row.Cells[0].Value;
            res.MaterialCode = (long)row.Cells[1].Value;
            res.ConsumptionRate = (float)row.Cells[2].Value;
            res.RateOfWaste = (float)row.Cells[3].Value;

            return res;
        }
Ejemplo n.º 43
0
 private void addRow(GridViewRowInfo row)
 {
     this.gvSuratMasuk.Rows.Insert(0, row);
 }
Ejemplo n.º 44
0
 private void addRowSK(GridViewRowInfo row)
 {
     this.gvSuratKeluar.Rows.Insert(0, row);
 }