Example #1
0
 protected void grid_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "UrlText")
     {
         String url = e.GetListSourceFieldValue("NavigateUrl").ToString();
         e.Value = url;
     }
 }
Example #2
0
    protected void ASPxGridView1_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewColumnDataEventArgs e)
    {
        ASPxGridView grid         = (ASPxGridView)sender;
        int          visibleIndex = grid.FindVisibleIndexByKeyValue(e.GetListSourceFieldValue("ProductID"));

        e.Value = (visibleIndex != 0) ?
                  Convert.ToInt32(grid.GetRowValues(visibleIndex, "UnitsInStock")) + Convert.ToInt32(grid.GetRowValues(visibleIndex - 1, "Total")) :
                  Convert.ToInt32(grid.GetRowValues(visibleIndex, "UnitsInStock"));
    }
Example #3
0
 protected void grdProducts_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "Total")
     {
         decimal price    = (decimal)e.GetListSourceFieldValue("UnitPrice");
         int     quantity = Convert.ToInt32(e.GetListSourceFieldValue("UnitsInStock"));
         e.Value = price * quantity;
     }
 }
    protected void gvCategories_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewColumnDataEventArgs e)
    {
        object categoryID = e.GetListSourceFieldValue("CategoryID");

        if (e.Column.FieldName == "UnitsInStock")
        {
            e.Value = DataHelper.ExecuteCommand(String.Format("SELECT SUM([UnitsInStock]) FROM  [Products] WHERE ([CategoryID] = {0})", categoryID));
        }
        if (e.Column.FieldName == "AverageUnitPrice")
        {
            e.Value = DataHelper.ExecuteCommand(String.Format("SELECT AVG([UnitPrice]) FROM  [Products] WHERE ([CategoryID] = {0})", categoryID));
        }
    }
Example #5
0
 protected void gvxPaymentClinics_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "Total Required")
     {
         PaymentRepository paymentRepository = new PaymentRepository();
         e.Value = paymentRepository.GetAllCostTreatmentByClinicByPeriod(int.Parse(e.GetListSourceFieldValue("ClinicID").ToString()), txtDateFrom.Date, txtDateTo.Date);
     }
     else if (e.Column.FieldName == "Total Payed")
     {
         PaymentRepository paymentRepository = new PaymentRepository();
         e.Value = paymentRepository.GetAllPayedReceitsByClinicByPeriod(int.Parse(e.GetListSourceFieldValue("ClinicID").ToString()), txtDateFrom.Date, txtDateTo.Date);
     }
     else if (e.Column.FieldName == "Total Deserved")
     {
         e.Value = decimal.Parse(e.GetListSourceFieldValue("Total Required").ToString()) - decimal.Parse(e.GetListSourceFieldValue("Total Payed").ToString());
     }
 }
Example #6
0
        protected void gvxDoctor_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewColumnDataEventArgs e)
        {
            ASPxGridView gvDoctor = (ASPxGridView)sender;
            int          clinicID = int.Parse(gvDoctor.GetMasterRowKeyValue().ToString());

            if (e.Column.FieldName == "Total Required")
            {
                PaymentRepository paymentRepository = new PaymentRepository();
                e.Value = paymentRepository.GetAllTeratmentByDoctorByPeriod(int.Parse(e.GetListSourceFieldValue("DoctorID").ToString()), clinicID, txtDateFrom.Date, txtDateTo.Date);
            }
            else if (e.Column.FieldName == "Total Payed")
            {
                PaymentRepository paymentRepository = new PaymentRepository();
                e.Value = paymentRepository.GetAllPaymentReceitByDoctorByPeriod(int.Parse(e.GetListSourceFieldValue("DoctorID").ToString()), clinicID, txtDateFrom.Date, txtDateTo.Date);
            }
            else if (e.Column.FieldName == "Total Deserved")
            {
                e.Value = decimal.Parse(e.GetListSourceFieldValue("Total Required").ToString()) - decimal.Parse(e.GetListSourceFieldValue("Total Payed").ToString());
            }
        }
Example #7
0
 protected void ASPxGridView1_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "LowerBound")
     {
         Dictionary <object, int> lowerBoundStorage = Session["lowerBoundStorage"] as Dictionary <object, int>;
         if (lowerBoundStorage == null)
         {
             lowerBoundStorage            = new Dictionary <object, int>();
             Session["lowerBoundStorage"] = lowerBoundStorage;
         }
         object key = e.GetListSourceFieldValue(e.ListSourceRowIndex, "CategoryID");
         if (lowerBoundStorage.ContainsKey(key))
         {
             e.Value = lowerBoundStorage[key];
         }
         else
         {
             e.Value = 0;
         }
     }
 }
Example #8
0
 protected void ASPxGridView1_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewColumnDataEventArgs e)
 {
 }
Example #9
0
 protected void gvJenisBinaLingkungan_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewColumnDataEventArgs e)
 {
 }