Example #1
0
    protected void GridViewAlbaransver_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
    {
        var Cliente = (Clientes)Session["User"];

        if (Cliente == null)
        {
            ASPxWebControl.RedirectOnCallback("/Account/login.aspx");
        }

        string CodigoCliente = Cliente.Código;
        int    AutoCliente   = Cliente.AutoCliente;
        int    AutoArticulo  = Convert.ToInt32(e.GetListSourceFieldValue("AutoArtículo"));
        string resp          = (string)CommonFunction.Calculoalbaran(Convert.ToString(GridViewAlbaransver.GetRowValues(e.ListSourceRowIndex, "SerieAlbaran")), 5);

        if (e.Column.FieldName == "Importe")
        {
            var val = CommonFunction.Field(resp, 1, "&");
            if (!string.IsNullOrEmpty(val))
            {
                e.Value = Convert.ToDouble(CommonFunction.Field(resp, 1, "&"));
            }
        }
        else if (e.Column.FieldName == "ImporteIgic")
        {
            var val = CommonFunction.Field(resp, 2, "&");
            if (!string.IsNullOrEmpty(val))
            {
                e.Value = Convert.ToDouble(CommonFunction.Field(resp, 2, "&"));
            }
        }
    }
Example #2
0
 /// <summary>
 /// Нумерация поля в гриде порядковым номером в группе. Поле должно называться Number - FieldName="Number" для колонки с номером
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public static void CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "Number")
     {
         e.Value = e.ListSourceRowIndex + 1;
     }
 }
 protected void ASPxgvPayments_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "SNo")
     {
         e.Value = e.ListSourceRowIndex + 1;
     }
 }
Example #4
0
 protected void ASPxGridView1_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "Number")
     {
         e.Value = string.Format("{0}", e.ListSourceRowIndex + 1);
     }
 }
 protected void grid_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "__Key")
     {
         e.Value = e.GetListSourceFieldValue("FirstName").ToString() + e.GetListSourceFieldValue("LastName").ToString();
     }
 }
 protected void ASPxGridView1_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "CompositeKey")
     {
         e.Value = e.GetListSourceFieldValue("matricula").ToString() + e.GetListSourceFieldValue("curso").ToString();
     }
 }
Example #7
0
    private bool IsFirstRow(ASPxGridViewColumnDataEventArgs e)
    {
        ASPxGridView grid     = e.Column.Grid;
        object       keyValue = e.GetListSourceFieldValue(grid.KeyFieldName);

        return(grid.FindVisibleIndexByKeyValue(keyValue) == 0);
    }
Example #8
0
 protected void gvPermohonan_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "Nomor")
     {
         e.Value = string.Format("Item #{0}", e.ListSourceRowIndex + 1);
     }
     GetData();
 }
Example #9
0
 protected void gvMain_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "Files")
     {
         int pat = Convert.ToInt32(e.GetListSourceFieldValue("ID"));
         e.Value = pat;
     }
 }
Example #10
0
 protected void gvPartSelections_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "QtyRemain")
     {
         int remain = e.GetListSourceFieldValue("Qty").ToInt32(0) - e.GetListSourceFieldValue("QtyUsed").ToInt32(0);
         e.Value = remain;
     }
 }
Example #11
0
 protected void grid_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "Total")
     {
         decimal price    = (decimal)e.GetListSourceFieldValue("totQty");
         decimal quantity = (decimal)e.GetListSourceFieldValue("Price");
         e.Value = price * quantity;
     }
 }
Example #12
0
 protected void grdVouchersAmount_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "ConvertedAmount")
     {
         decimal debit        = Convert.ToDecimal(e.GetListSourceFieldValue("Debit"));
         decimal exchangeRate = Convert.ToDecimal(e.GetListSourceFieldValue("ExchangeRate"));
         e.Value = debit * exchangeRate;
     }
 }
Example #13
0
 protected void detailGrid_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "Total")
     {
         decimal price    = (decimal)e.GetListSourceFieldValue("UnitPrice");
         int     quantity = Convert.ToInt32(e.GetListSourceFieldValue("Quantity"));
         e.Value = price * quantity;
     }
 }
Example #14
0
 protected void grid_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "Total")
     {
         //int price = (int)e.GetListSourceFieldValue("FLT_BILL_AMOUNT");
         //int quantity = Convert.ToInt32(e.GetListSourceFieldValue("Quantity"));
         e.Value = e.GetListSourceFieldValue("FLT_BILL_AMOUNT");
     }
 }
 protected void ASPxGridView1_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "CompositeKey")
     {
         e.Value = String.Format("{0}{1}{2}{3}",
             e.GetListSourceFieldValue("periodo").ToString() , "&",
             e.GetListSourceFieldValue("idColaborador").ToString(), "&" );
     }
 }
Example #16
0
    protected void ASPxGridView1_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
    {
        if (e.Column.FieldName != "Month")
        {
            return;
        }
        DateTime tempDate = (DateTime)e.GetListSourceFieldValue("OrderDate");

        e.Value = tempDate.Month;
    }
 protected void ASPxGridView1_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "CompositeKey")
     {
         e.Value = String.Format("{0}{1}{2}{3}{4}",
             e.GetListSourceFieldValue("sucursal").ToString() , "-",
             e.GetListSourceFieldValue("puesto").ToString() , "-",
              e.GetListSourceFieldValue("tipoCalculoPago").ToString());
     }
 }
 protected void gvData_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     try
     {
         if (e.Column.Name == "colLine")
         {
             e.Value = e.ListSourceRowIndex + 1;
         }
     }
     catch { }
 }
 protected void gvPreViewData_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     try
     {
         if (e.Column.Name == "colLine")
         {
             e.Value = e.ListSourceRowIndex + 1;
         }
     }
     catch { }
 }
Example #20
0
 protected void gridDetails_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "CurrentPrice")
     {
         int    id            = e.ListSourceRowIndex;
         int    channelId     = Convert.ToInt32(e.GetListSourceFieldValue("ChannelId"));
         string monitoredName = e.GetListSourceFieldValue("MonitoredName").ToString();
         string monitoredUrl  = e.GetListSourceFieldValue("MonitoredUrl").ToString();
         e.Value = CanonMapping.GetCurrentMapPrice(channelId, monitoredName, monitoredUrl);
     }
 }
Example #21
0
 protected void grid_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "UnitPrice")
     {
         e.Value = CalcUnitPrice(e.GetListSourceFieldValue("ProductID"));
     }
     if (e.Column.FieldName == "Sum")
     {
         e.Value = CalcSum(e.GetListSourceFieldValue("UnitPrice"), e.GetListSourceFieldValue("UnitQty"));
     }
 }
Example #22
0
    protected void ASPxGridView1_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
    {
        DateTimeOffset dto        = (DateTimeOffset)e.GetListSourceFieldValue("Date");
        string         timeZoneId = (string)e.GetListSourceFieldValue("TimeZoneId");

        switch (e.Column.FieldName)
        {
        case "DateTimeOffset":
            e.Value = dto.DateTime + " " + timeZoneId;
            break;
        }
    }
Example #23
0
 protected void gvOrders_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "CustomDescription")
     {
         string   description = Convert.ToString(e.GetListSourceFieldValue("Description"));
         string[] items       = description.Split(';');
         for (int i = 0; i < items.Length; i++)
         {
             items[i] = String.Format("#{0}#", items[i]); //Wrap items with '#'
         }
         e.Value = String.Join(";", items);
     }
 }
Example #24
0
 protected void ASPxGridView1_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "QRCodeValueUnbound")
     {
         string  barCodeText = e.GetListSourceFieldValue("QRCodeValue").ToString();
         BarCode barCode     = new BarCode()
         {
             Symbology = Symbology.QRCode, CodeBinaryData = Encoding.Default.GetBytes(barCodeText)
         };
         ImageConverter converter = new ImageConverter();
         e.Value = (byte[])converter.ConvertTo(barCode.BarCodeImage, typeof(byte[]));
     }
 }
Example #25
0
 protected void grvIA_OnCustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     try
     {
         if (e.Column.FieldName == "No")
         {
             e.Value = string.Format("{0}", e.ListSourceRowIndex + 1);
         }
     }
     catch (Exception ex)
     {
         LoggerHelper.LogError(ex);
     }
 }
Example #26
0
    protected void ASPxGridView1_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
    {
        if (e.Column.FieldName == "Total")
        {
            if (IsFirstRow(e))
            {
                previousValue = 0;
            }

            int quantity = (int)e.GetListSourceFieldValue("Quantity");
            int price    = (int)e.GetListSourceFieldValue("Price");
            previousValue = quantity * price - previousValue;
            e.Value       = previousValue;
        }
    }
Example #27
0
 protected void NetworkLatencyTestgrd_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "LatencyYellowThreshold")
     {
         Dictionary <object, int> lowerBoundStorage = Session["NetworkLatency"] as Dictionary <object, int>;
         if (lowerBoundStorage == null)
         {
             lowerBoundStorage         = new Dictionary <object, int>();
             Session["NetworkLatency"] = lowerBoundStorage;
         }
         object key = e.GetListSourceFieldValue(e.ListSourceRowIndex, "ID");
         if (lowerBoundStorage.ContainsKey(key))
         {
             e.Value = lowerBoundStorage[key];
         }
         else
         {
             e.Value = 0;
         }
     }
 }
Example #28
0
        protected void gvxPatients_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
        {
            ASPxGridView gvpatients = (ASPxGridView)sender;
            int          DoctorID   = int.Parse(gvpatients.GetMasterRowKeyValue().ToString());
            int          ClinicID   = int.Parse(((sender as ASPxGridView).NamingContainer as GridViewDetailRowTemplateContainer).Grid.GetMasterRowKeyValue().ToString());

            if (e.Column.FieldName == "Total Required")
            {
                PaymentRepository paymentRepository = new PaymentRepository();
                e.Value = paymentRepository.GetAllTeratmentByPatient(DoctorID, ClinicID, int.Parse(e.GetListSourceFieldValue("PatientID").ToString()));
            }
            else if (e.Column.FieldName == "Total Payed")
            {
                PaymentRepository paymentRepository = new PaymentRepository();
                e.Value = paymentRepository.GetAllPaymentReceitByPatient(DoctorID, ClinicID, int.Parse(e.GetListSourceFieldValue("PatientID").ToString()));
            }
            else if (e.Column.FieldName == "Total Deserved")
            {
                e.Value = decimal.Parse(e.GetListSourceFieldValue("Total Required").ToString()) - decimal.Parse(e.GetListSourceFieldValue("Total Payed").ToString());
            }
        }
Example #29
0
        protected void grdBalanceLine_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
        {
            Guid key = Guid.Parse(e.GetListSourceFieldValue(e.ListSourceRowIndex, grdBalanceLine.KeyFieldName).ToString());

            if (e.Column.FieldName == "TransactionId.Code")
            {
                GeneralJournal generalJournal = session.GetObjectByKey <GeneralJournal>(key);

                if (generalJournal != null)
                {
                    e.Value = generalJournal.TransactionId.Code;
                }
            }
            else if (e.Column.FieldName == "TransactionId.Description")
            {
                GeneralJournal generalJournal = session.GetObjectByKey <GeneralJournal>(key);

                if (generalJournal != null)
                {
                    e.Value = generalJournal.TransactionId.Description;
                }
            }
        }
    /// <summary>
    /// populate unbound fields e.g. est. time to warehouse (ETW) = ETA + 7 days
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void gridOrder_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
    {
        if (e.Column.FieldName == "ETW")
        {
            if (e.GetListSourceFieldValue("ETA") != null)
            {
                string _eta = Convert.ToDateTime(e.GetListSourceFieldValue("ETA")).ToString("yyyy/MM/dd");
                e.Value = Convert.ToDateTime(_eta).AddDays(7);
            }
        }

    }
Example #31
0
 protected void ASPxgvTaxDetails_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     e.Value = e.ListSourceRowIndex + 1;
 }
Example #32
0
 protected void ASPxGridView1_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
 }
Example #33
0
 protected void dxgrid_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     UtilsHelper.CustomUnboundColumnData(sender, e);
 }
Example #34
0
 protected void gridDetails_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "CurrentPrice")
     {
         int id = e.ListSourceRowIndex;
         int channelId = Convert.ToInt32(e.GetListSourceFieldValue("ChannelId"));
         string monitoredName = e.GetListSourceFieldValue("MonitoredName").ToString();
         string monitoredUrl = e.GetListSourceFieldValue("MonitoredUrl").ToString();
         e.Value = CanonMapping.GetCurrentMapPrice(channelId, monitoredName, monitoredUrl);
     }
 }
        protected void ASPxGridView1_CustomUnboundColumnData(object sender, ASPxGridViewColumnDataEventArgs e)
        {
            int cccMeses  = (int)e.GetListSourceFieldValue("CCCMESES");
            decimal despJan = (decimal)e.GetListSourceFieldValue("DESPJAN");
            decimal despFev = (decimal)e.GetListSourceFieldValue("DESPFEV");
            decimal despMar = (decimal)e.GetListSourceFieldValue("DESPMAR");
            decimal despAbr = (decimal)e.GetListSourceFieldValue("DESPABR");
            decimal despMai = (decimal)e.GetListSourceFieldValue("DESPMAI");
            decimal despJun = (decimal)e.GetListSourceFieldValue("DESPJUN");
            decimal despJul = (decimal)e.GetListSourceFieldValue("DESPJUL");
            decimal despAgo = (decimal)e.GetListSourceFieldValue("DESPAGO");
            decimal despSet = (decimal)e.GetListSourceFieldValue("DESPSET");
            decimal despOut = (decimal)e.GetListSourceFieldValue("DESPOUT");
            decimal despNov = (decimal)e.GetListSourceFieldValue("DESPNOV");
            decimal despDez = (decimal)e.GetListSourceFieldValue("DESPDEZ");
            decimal didJan = (decimal)e.GetListSourceFieldValue("DIDJAN");
            decimal didFev = (decimal)e.GetListSourceFieldValue("DIDFEV");
            decimal didMar = (decimal)e.GetListSourceFieldValue("DIDMAR");
            decimal didAbr = (decimal)e.GetListSourceFieldValue("DIDABR");
            decimal didMai = (decimal)e.GetListSourceFieldValue("DIDMAI");
            decimal didJun = (decimal)e.GetListSourceFieldValue("DIDJUN");
            decimal didJul = (decimal)e.GetListSourceFieldValue("DIDJUL");
            decimal didAgo = (decimal)e.GetListSourceFieldValue("DIDAGO");
            decimal didSet = (decimal)e.GetListSourceFieldValue("DIDSET");
            decimal didOut = (decimal)e.GetListSourceFieldValue("DIDOUT");
            decimal didNov = (decimal)e.GetListSourceFieldValue("DIDNOV");
            decimal didDez = (decimal)e.GetListSourceFieldValue("DIDDEZ");
            decimal saldoJan = (decimal)e.GetListSourceFieldValue("SALDOJAN");
            decimal saldoFev = (decimal)e.GetListSourceFieldValue("SALDOFEV");
            decimal saldoMar = (decimal)e.GetListSourceFieldValue("SALDOMAR");
            decimal saldoAbr = (decimal)e.GetListSourceFieldValue("SALDOABR");
            decimal saldoMai = (decimal)e.GetListSourceFieldValue("SALDOMAI");
            decimal saldoJun = (decimal)e.GetListSourceFieldValue("SALDOJUN");
            decimal saldoJul = (decimal)e.GetListSourceFieldValue("SALDOJUL");
            decimal saldoAgo = (decimal)e.GetListSourceFieldValue("SALDOAGO");
            decimal saldoSet = (decimal)e.GetListSourceFieldValue("SALDOSET");
            decimal saldoOut = (decimal)e.GetListSourceFieldValue("SALDOOUT");
            decimal saldoNov = (decimal)e.GetListSourceFieldValue("SALDONOV");
            decimal saldoDez = (decimal)e.GetListSourceFieldValue("SALDODEZ");

            DateTime _date;

            if (dtCadastroIni.Value != null)
                _date = DateTime.Parse(dtCadastroIni.Value.ToString());
            else
                _date = DateTime.Now;

            string mes = _date.Month.ToString();
            List<string> meses = Control.CentroDeCustoCtrl.getPeriodoCentroCusto(int.Parse(mes), cccMeses);

            decimal saldoPeriodo = 0;
            decimal despesasPeriodo = 0;
            decimal programacaoPeriodo = 0;

            foreach (string s in meses)
            {
                switch (s)
                {
                    case "1": saldoPeriodo += saldoJan;
                        despesasPeriodo += didJan;
                        programacaoPeriodo += despJan;
                        break;
                    case "2": saldoPeriodo += saldoFev;
                        despesasPeriodo += didFev;
                        programacaoPeriodo += despFev;
                        break;
                    case "3": saldoPeriodo += saldoMar;
                        despesasPeriodo += didMar;
                        programacaoPeriodo += despMar;
                        break;
                    case "4": saldoPeriodo += saldoAbr;
                        despesasPeriodo += didAbr;
                        programacaoPeriodo += despAbr;
                        break;
                    case "5": saldoPeriodo += saldoMai;
                        despesasPeriodo += didMai;
                        programacaoPeriodo += despMai;
                        break;
                    case "6": saldoPeriodo += saldoJun;
                        despesasPeriodo += didJun;
                        programacaoPeriodo += despJun;
                        break;
                    case "7": saldoPeriodo += saldoJul;
                        despesasPeriodo += didJul;
                        programacaoPeriodo += despJul;
                        break;
                    case "8": saldoPeriodo += saldoAgo;
                        despesasPeriodo += didAgo;
                        programacaoPeriodo += despAgo;
                        break;
                    case "9": saldoPeriodo += saldoSet;
                        despesasPeriodo += didSet;
                        programacaoPeriodo += despSet;
                        break;
                    case "10": saldoPeriodo += saldoOut;
                        despesasPeriodo += didOut;
                        programacaoPeriodo += despOut;
                        break;
                    case "11": saldoPeriodo += saldoNov;
                        despesasPeriodo += didNov;
                        programacaoPeriodo += despNov;
                        break;
                    case "12": saldoPeriodo += saldoDez;
                        despesasPeriodo += didDez;
                        programacaoPeriodo += despDez;
                        break;
                }
            }

            if (e.Column.FieldName == "SALDO") {
                e.Value = saldoPeriodo;
            }

            if (e.Column.FieldName == "Programação")
            {
                e.Value = programacaoPeriodo;
            }

            if (e.Column.FieldName == "Despesas")
            {
                e.Value = despesasPeriodo;
            }
        }