private void RefreshGrid(ASPxGridView gv)
        {
            GridViewDataComboBoxColumn c = (GridViewDataComboBoxColumn)gv.Columns["IdentifTecno"];

            c.PropertiesComboBox.TextField = "Name";
            c.PropertiesComboBox.ValueField = "IdentifTecno";
            c.PropertiesComboBox.DataSource = Business.TecnologiaSoporte.ReadAll("");

            gv.DataSource = Business.MediosPublicitarios.ReadAllTipo("");
            gv.DataBind();
        }
Esempio n. 2
0
    protected void grid_Event_HtmlEditFormCreated(object sender, ASPxGridViewEditFormEventArgs e)
    {
        //string Port = System.Configuration.ConfigurationManager.AppSettings["LocalPort"];
        //string where = string.Format("(isnull(EventCode,'')='' or EventCode='gateout') AND EventPort='{0}' AND EventDateTime in(select MAX(EventDateTime) from Cont_AssetEvent where isnull(EventCode,'')='' or EventCode='gateout' group by ContainerNo)",Port);
        string Port = btn_Port.Text;
        //string where = string.Format(" Id in(select id from Cont_AssetEvent as aEvent left outer join (select containerno,MAX(EventDateTime) as EventDateTime from Cont_AssetEvent group by containerno) as ass on ass.ContainerNo=aEvent.ContainerNo and ass.EventDateTime=aEvent.EventDateTime where (isnull(EventCode,'')='' or EventCode='gateout') and aEvent.EventPort='{0}' and ass.EventDateTime is not null and len(replace(isnull(aEvent.DocNo,''),' ',''))=0 and len(isnull(DocType,''))=0 )", Port);
        //dsRefCont.FilterExpression = where;
        string           sql    = string.Format(@"select aEvent.ContainerType,aEvent.ContainerNo from Cont_AssetEvent as aEvent left outer join (select containerno,MAX(EventDateTime) as EventDateTime from Cont_AssetEvent group by containerno) as ass on ass.ContainerNo=aEvent.ContainerNo and ass.EventDateTime=aEvent.EventDateTime left outer join Ref_Container as Cont on aEvent.ContainerNo=Cont.ContainerNo where (isnull(EventCode,'')='' or EventCode='gateout') and aEvent.EventPort='{0}' and ass.EventDateTime is not null and len(replace(isnull(aEvent.DocNo,''),' ',''))=0 and isnull(DocType,'')<>'SO' and Cont.StatusCode='Use' union all select ContainerType,ContainerNo  from Ref_Container where ContainerNo not in( select distinct isnull(ContainerNo,'') from Cont_AssetEvent) and StatusCode='Use' ", Port);
        ASPxGridView     grid   = sender as ASPxGridView;
        ASPxDropDownEdit d      = grid.FindEditFormTemplateControl("DropDownEdit") as ASPxDropDownEdit;
        ASPxGridView     gvlist = d.FindControl("gridPopCont") as ASPxGridView;

        gvlist.DataSource = C2.Manager.ORManager.GetDataSet(sql);
        gvlist.DataBind();
    }
        private void CreateDetailGrid()
        {
            detailGrid    = new ASPxGridView();
            detailGrid.ID = "detailGrid";
            detailGrid.AutoGenerateColumns = false;
            parent.Controls.Add(detailGrid);

            CreateDetailColumns(detailGrid);
            detailGrid.KeyFieldName = "ProductID";
            detailGrid.DataSource   = GetDetailDataSource();
            detailGrid.DataBind();
            detailGrid.RowInserting += new DevExpress.Web.Data.ASPxDataInsertingEventHandler(detailGrid_RowInserting);
            detailGrid.RowUpdating  += new DevExpress.Web.Data.ASPxDataUpdatingEventHandler(detailGrid_RowUpdating);
            detailGrid.RowDeleting  += new DevExpress.Web.Data.ASPxDataDeletingEventHandler(detailGrid_RowDeleting);
        }
Esempio n. 4
0
        private object[] FindGroupValues(ASPxGridView grid)
        {
            grid.DataBind();
            string    column = grid.GetGroupedColumns()[0].FieldName;
            ArrayList list   = new ArrayList();

            for (int i = 0; i < grid.VisibleRowCount; i++)
            {
                if (grid.GetRowLevel(i) == 0)
                {
                    list.Add(grid.GetRowValues(i, column));
                }
            }
            return(list.ToArray());
        }
Esempio n. 5
0
    /// </summary>
    /// <param name="companyID"></param>
    protected void bind_contacts(int companyid)
    {
        ASPxGridView _grid = (ASPxGridView)this.fmvAddressBook.FindControl("dxgridCompanyContacts");

        //ASPxGridView _grid = (ASPxGridView)this.dxpnlContacts.FindControl("dxgridCompanyContacts");
        if (_grid != null)
        {
            SubSonic.Query _q  = new SubSonic.Query(Tables.ContactTable, "WWIProv").WHERE("CompanyID", Comparison.Equals, companyid);
            DataSet        _ds = _q.ExecuteDataSet();
            //IDataReader _dr = _q.ExecuteReader(); can't use datareder it's a read only structure!
            _grid.KeyFieldName = "ContactID";
            _grid.DataSource   = _ds;
            _grid.DataBind();
        }
    }
    protected void grid_Init(object sender, EventArgs e)
    {
        ASPxGridView grid = sender as ASPxGridView;

        if (Session["GridCurrentPageSize"] != null)
        {
            grid.SettingsPager.PageSize = (int)Session["GridCurrentPageSize"];
        }
        else
        {
            Session["GridCurrentPageSize"] = grid.SettingsPager.PageSize;
        }

        grid.DataBind();
    }
    protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
    {
        nwndDataSet ds = new nwndDataSet();

        nwndDataSetTableAdapters.ProductsTableAdapter pta = new nwndDataSetTableAdapters.ProductsTableAdapter();
        ASPxGridView gridView = sender as ASPxGridView;

        pta.FillBy(ds.Products, Convert.ToInt32(e.Parameters));
        gridView.DataSource       = ds.Products;
        Session["gridDataSource"] = gridView.DataSource;

        gridView.DataBind();

        gridView.PageIndex = 0;
    }
Esempio n. 8
0
        protected void gridBarCode_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            data = new dataHangHoa();
            ASPxGridView gridBarCode = sender as ASPxGridView;
            int          ID          = Int32.Parse(e.Keys["ID"].ToString());
            object       IDHangHoa   = gridBarCode.GetMasterRowKeyValue();
            string       BarCode     = e.NewValues["Barcode"] != null ? e.NewValues["Barcode"].ToString() : "";

            data.CapNhatBarCode(ID, IDHangHoa, BarCode);

            e.Cancel = true;
            gridBarCode.CancelEdit();
            gridBarCode.DataSource = data.GetListBarCode(IDHangHoa);
            gridBarCode.DataBind();
        }
Esempio n. 9
0
        private void RefreshGrid(ASPxGridView gridView)
        {
            if (gridView.ID == "gv")
            {
                gridView.DataSource = Business.Costos.ReadAll("");
            }
            else
            if (pnlVersiones.Attributes["RecId"] != null)
            {
                gvVersiones.DataSource = Business.Costos.ReadAllVersiones(Business.Costos.Read(Convert.ToInt32(pnlVersiones.Attributes["RecId"])));
            }


            gridView.DataBind();
        }
Esempio n. 10
0
        protected void grid_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            ASPxGridView grid  = sender as ASPxGridView;
            DataTable    table = new DataTable();

            table = GetTable();
            DataRow found = table.Rows.Find(e.Keys[0]);

            table.Rows.Remove(found);

            Session["Table"] = table;
            grid.DataSource  = table;
            grid.DataBind();
            e.Cancel = true;
        }
    protected void grid_Event_HtmlEditFormCreated(object sender, ASPxGridViewEditFormEventArgs e)
    {
        //string Port = System.Configuration.ConfigurationManager.AppSettings["LocalPort"];
        //ASPxButtonEdit btnPort = this.grid_Transport.FindEditFormTemplateControl("btn_Port") as ASPxButtonEdit;
        string Port = btn_Port.Text;
        //string where = string.Format("EventCode='depotin' AND EventPort='{0}' AND EventDateTime in(select MAX(EventDateTime) from Cont_AssetEvent where EventCode='depotin' group by ContainerNo)", Port);
        //dsRefCont.FilterExpression = where;
        string           sql    = "select aEvent.id,aEvent.ContainerNo,aEvent.ContainerType from Cont_AssetEvent as aEvent left outer join (select ContainerNo,MAX(eventDateTime) as maxEventDateTime from Cont_AssetEvent group by ContainerNo) as ass on aEvent.ContainerNo=ass.ContainerNo and aEvent.EventDateTime=ass.maxEventDateTime left outer join Ref_Container as Cont on aEvent.ContainerNo=Cont.ContainerNo where aEvent.EventCode='depotin' and ass.maxEventDateTime is not null  and Cont.StatusCode='Use' and aEvent.EventPort='" + Port + "'";
        ASPxGridView     grid   = sender as ASPxGridView;
        ASPxDropDownEdit d      = grid.FindEditFormTemplateControl("DropDownEdit") as ASPxDropDownEdit;
        ASPxGridView     gvlist = d.FindControl("gridPopCont") as ASPxGridView;

        gvlist.DataSource = C2.Manager.ORManager.GetDataSet(sql);
        gvlist.DataBind();
    }
    private void CreateDetailGrid()
    {
        detailGrid    = new ASPxGridView();
        detailGrid.ID = "detailGrid";
        detailGrid.AutoGenerateColumns          = false;
        detailGrid.SettingsDetail.ShowDetailRow = true;
        parent.Controls.Add(detailGrid);

        CreateDetailColumns(detailGrid);
        detailGrid.KeyFieldName = "ProductID";
        detailGrid.DataSource   = GetDetailDataSource();
        detailGrid.DataBind();

        detailGrid.Templates.DetailRow = new OrderDetailsDetailGridTemplate();
    }
Esempio n. 13
0
    protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridViewCustomCallbackEventArgs e)
    {
        AccessDataSource1.UpdateParameters["EmployeeID"].DefaultValue = ASPxTextBoxEmployeeID.Value.ToString();
        AccessDataSource1.UpdateParameters["LastName"].DefaultValue   = ASPxTextBoxLastName.Value.ToString();
        AccessDataSource1.UpdateParameters["FirstName"].DefaultValue  = ASPxTextBoxFirstName.Value.ToString();
        AccessDataSource1.UpdateParameters["BirthDate"].DefaultValue  = Convert.ToDateTime(ASPxDateEditBirthDate.Value).ToShortDateString();

        //for example purpose only, because online editing is not supported
        throw new Exception("Editing in online example is not supported"); //remove this line when testing the project

        AccessDataSource1.Update();                                        //Uncomment this line

        ASPxGridView gridView = (ASPxGridView)sender;

        gridView.DataBind();
    }
Esempio n. 14
0
    //end session reset all

    /// <summary>
    /// call back panel to force update of datagridview on login /timer?
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void callBack1_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
    {
        //if (!sessionTimedOut())
        //{
        ASPxGridView _grid = (ASPxGridView)this.ContentPlaceHolderM1.FindControl("gridOrder");

        if (_grid != null)
        {
            _grid.DataBind();
        }
        //}
        //else
        //{
        //    Page.Response.Redirect("Session_Sys_Login.aspx", true);
        //}
    }
Esempio n. 15
0
    //初始化流水号列表
    protected void ASPxGridView1_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
    {
        string[] param     = e.Parameters.Split(',');
        string   plineCode = param[0]; //生产线
        string   planCode  = param[1]; //计划代码

        string sql = "select a.SN from DATA_PRODUCT a where a.PLINE_CODE='" + plineCode + "' and a.PLAN_CODE='" + planCode + "' "
                     + " and NOT EXISTS(SELECT * FROM data_sn_temp C WHERE C.sn=A.sn  )  order by a.SN";
        //select ghtm from sjsxb where gzdd='" + gSite + "' and jhdm='" + thisJh + "' order by ghtm-------------VB
        DataTable dt = dc.GetTable(sql);

        ASPxGridView gridview1 = sender as ASPxGridView;

        gridview1.DataSource = dt;
        gridview1.DataBind();
        gridview1.Selection.UnselectAll();
    }
Esempio n. 16
0
        protected void grid_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxGridView grid = sender as ASPxGridView;

            DataTable table = new DataTable();

            table = GetTable();

            table.Rows.Add(new Object[] { e.NewValues["ID"], e.NewValues["ItemName"], e.NewValues["ItemOrder"] });
            // sumAmount +=Convert.ToDouble(e.NewValues["Amount"].ToString());
            Session["Table"] = table;

            e.Cancel        = true;
            grid.DataSource = table;
            grid.DataBind();
            grid.CancelEdit();
        }
Esempio n. 17
0
    protected void grid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
    {
        ASPxGridView gv = (ASPxGridView)sender;

        //Get and Process the list of selected records in order to populate the list of pkvals
        #region process selected records
        var selected_keys = gv.GetSelectedFieldValues("valdocID");



        List <int> pkvals = new List <int>();

        foreach (object key in e.Keys.Values)
        {
            int  ikey;
            bool isint = int.TryParse(key.ToString(), out ikey);
            if (isint)
            {
                pkvals.Add(ikey);
            }
        }

        //Add the other selected rows to the update if the user has selected the "Update All" checkbox
        if (selected_keys.Count > 0)
        {
            foreach (object k in selected_keys)
            {
                int  ikey;
                bool isint = int.TryParse(k.ToString(), out ikey);
                if (!pkvals.Contains(ikey))
                {
                    pkvals.Add(ikey);
                }
            }
        }
        #endregion



        string result = dataops.dxGrid_UpdateData("valdocID", pkvals, e.NewValues, "ValantTJ", "dbo", "valantdocdump");

        gv.CancelEdit();
        e.Cancel = true;
        //ViewState["needBind"] = "true";
        gv.DataBind();
    }
Esempio n. 18
0
    protected void gvProducts_CustomCallback(object sender, DevExpress.Web.ASPxGridViewCustomCallbackEventArgs e)
    {
        ASPxGridView gridView = sender as ASPxGridView;

        string[] parameters = e.Parameters.Split('|');
        string   command    = parameters[0];

        if (command == "MOVEUP" || command == "MOVEDOWN")
        {
            int focusedRowKey = GetGridViewKeyByVisibleIndex(gridView, gridView.FocusedRowIndex);
            int index         = (int)gridView.GetRowValues(gridView.FocusedRowIndex, "DisplayOrder");
            int newIndex      = index;
            if (command == "MOVEUP")
            {
                newIndex = (index == 0) ? index : index - 1;
            }
            if (command == "MOVEDOWN")
            {
                newIndex = (index == gridView.VisibleRowCount) ? index : index + 1;
            }
            int rowKey = GetKeyIDBySortIndex(gridView, newIndex);
            UpdateSortIndex(focusedRowKey, newIndex);
            UpdateSortIndex(rowKey, index);
            gridView.FocusedRowIndex = gridView.FindVisibleIndexByKeyValue(rowKey);
        }
        if (command == "DRAGROW")
        {
            int draggingIndex     = int.Parse(parameters[1]);
            int targetIndex       = int.Parse(parameters[2]);
            int draggingRowKey    = GetKeyIDBySortIndex(gridView, draggingIndex);
            int targetRowKey      = GetKeyIDBySortIndex(gridView, targetIndex);
            int draggingDirection = (targetIndex < draggingIndex) ? 1 : -1;
            for (int rowIndex = 0; rowIndex < gridView.VisibleRowCount; rowIndex++)
            {
                int rowKey = GetGridViewKeyByVisibleIndex(gridView, rowIndex);
                int index  = (int)gridView.GetRowValuesByKeyValue(rowKey, "DisplayOrder");
                if ((index > Math.Min(targetIndex, draggingIndex)) && (index < Math.Max(targetIndex, draggingIndex)))
                {
                    UpdateSortIndex(rowKey, index + draggingDirection);
                }
            }
            UpdateSortIndex(draggingRowKey, targetIndex);
            UpdateSortIndex(targetRowKey, targetIndex + draggingDirection);
        }
        gridView.DataBind();
    }
Esempio n. 19
0
        protected void ASPxGridView1_CustomCallback1(object sender, ASPxGridViewCustomCallbackEventArgs e)
        {
            string alineCode = e.Parameters;
            //初始化GRIDVIEW
            string sql = "select a.RMES_ID,a.LOCATION_CODE,a.PROCESS_CODE,a.process_id, "
                         + " a.process_name,a.location_name  "
                         + " from ATPU_ACROSS_DATA a "
                         + " where a.ALINE_CODE='" + alineCode + "' and a.pline_id_new is null "
                         + " and a.process_id not in (select process_id from ATPU_ACROSS_DATA_TEMP)  order by a.input_time desc nulls last, a.PROCESS_CODE";
            DataTable dt = dc.GetTable(sql);

            ASPxGridView gridview1 = sender as ASPxGridView;

            gridview1.DataSource = dt;
            gridview1.DataBind();
            gridview1.Selection.UnselectAll();
        }
Esempio n. 20
0
    protected void g_relatedProducts_BeforePerformDataSelect(object sender, System.EventArgs e)
    {
        ASPxGridView gridView = (ASPxGridView)sender;

        if (gridView.DataSource != null)
        {
            return;
        }
        if (Session[gridView.GetMasterRowKeyValue().ToString()] != null)
        {
            string selectCommand = (string)Session[gridView.GetMasterRowKeyValue().ToString()];
            AccessDataSource2.SelectCommand = selectCommand;
            DataView view = (DataView)AccessDataSource2.Select(DataSourceSelectArguments.Empty);
            gridView.DataSource = view;
            gridView.DataBind();
        }
    }
Esempio n. 21
0
        protected void tabela(int nrTabeli, ASPxGridView kontrolka)
        {
            string idDzialu = (string)Session["id_dzialu"];

            if (cl.debug(int.Parse(idDzialu)))
            {
                cm.log.Info(tenPlik + ": rozpoczęcie tworzenia tabeli 1");
            }
            DataTable tabelka01 = DevExpressXXL.zLicznikiemKolumn(dr.konwertujNaPrzecinek(dr.generuj_dane_do_tabeli_sedziowskiej_2019(int.Parse(idDzialu), nrTabeli, Date1.Date, Date2.Date, 240, tenPlik)));
            DataTable naglowki  = dr.generuj_naglowki_do_tabeli_sedziowskiej_2019(int.Parse(idDzialu), nrTabeli, Date1.Date, Date2.Date, 240, tenPlik);

            if (tabelka01 == null)
            {
                cm.log.Error(tenPlik + ": brak danych do tabeli " + nrTabeli.ToString());
            }
            Session["tabelka001"] = tabelka01;

            kontrolka.DataSource          = null;
            kontrolka.DataSourceID        = null;
            kontrolka.AutoGenerateColumns = true;
            kontrolka.DataSource          = tabelka01;
            kontrolka.DataBind();
            kontrolka.KeyFieldName = "id_sedziego";
            kontrolka.Columns.Clear();
            int szerokoscKolumny = 80;

            kontrolka.Width = Panel1.Width;

            kontrolka.Columns.Add(DevExpressXXL.kolumnaDoTabeli("L.p.", "id", nrTabeli.ToString(), "", true, 36));
            kontrolka.Columns.Add(DevExpressXXL.kolumnaDoTabeli("Imie i nazwisko", "Imienazwisko", nrTabeli.ToString(), "", true, 250));
            int iloscKolumn = dr.iloscKolumn(nrTabeli, int.Parse(idDzialu), tenPlik);



            for (int i = 1; i < iloscKolumn; i++)
            {
                kontrolka.Columns.Add(DevExpressXXL.kolumnaDoTabeli(tekstNaglowka(naglowki, i), "d_" + i.ToString("D2"), nrTabeli.ToString(), "", false, szerokoscKolumny));
            }

            kontrolka.TotalSummary.Clear();
            kontrolka.TotalSummary.Add(DevExpressXXL.komorkaSumujaca("Ogółem"));
            for (int i = 1; i < iloscKolumn; i++)
            {
                kontrolka.TotalSummary.Add(DevExpressXXL.komorkaSumujaca(i));
            }
        }
Esempio n. 22
0
        protected void grvEmpleados_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
        {
            try
            {
                ASPxGridView grid = (sender as ASPxGridView);
                //Switch the grid to edit mode for the last selected row
                if (e.Parameters == "StartEditing")
                {
                    object lastSelectedRowKeyValue     = grid.GetSelectedFieldValues(Constantes.ColumnaInfoAdicUserId)[grid.Selection.Count - 1];
                    int    lastSelectedRowVisibleIndex = grid.FindVisibleIndexByKeyValue(lastSelectedRowKeyValue);
                    grid.StartEdit(lastSelectedRowVisibleIndex);
                }
                else
                {
                    string strKey = "";
                    List <TreeListNode> lstSelectedNodes = trlDepartamentos.GetSelectedNodes();
                    if (lstSelectedNodes.Count > 0)
                    {
                        foreach (TreeListNode Node in lstSelectedNodes)
                        {
                            strKey += Node.Key + ",";
                        }
                        strKey = strKey.Substring(0, strKey.Length - 1);
                        Session["DepartamentoSelected"] = strKey;
                        DataTable dtbEmpleados = (DataTable)Session[Constantes.SessionTblInfoAdicional];
                        String    strFilter    = Constantes.ColumnaInfoAdicUserId + " in (" + strKey + ")";
                        DataRow[] dtrFilter    = dtbEmpleados.Select(strFilter);
                        DataTable dtbFilter    = dtbEmpleados.Clone();

                        foreach (DataRow row in dtrFilter)
                        {
                            dtbFilter.ImportRow(row);
                        }
                        Session[Constantes.SessionTblInfoAdicional1] = dtbFilter;

                        grid.DataSource = dtbFilter;
                        grid.DataBind();
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 23
0
        protected void grid_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxGridView grid = sender as ASPxGridView;

            DataTable table = new DataTable();

            table = GetTable();


            // sumAmount +=Convert.ToDouble(e.NewValues["Amount"].ToString());

            ///Check the account balance
            GLAccount acc = new GLAccount();

            acc.get(int.Parse(e.NewValues["GLAccountID"].ToString()));
            if (acc.AcctType == 1 || acc.AcctType == 5)//depit acount (asset and expenses)
            {
                if (e.NewValues["Credit"] != null && e.NewValues["Credit"].ToString() != "")
                {
                    if (acc.Balance < decimal.Parse(e.NewValues["Credit"].ToString()))
                    {
                        throw new Exception("Account Balance(" + acc.Balance.ToString() + ") not enough");
                    }
                }
            }
            else
            {
                if (e.NewValues["Depit"] != null && e.NewValues["Depit"].ToString() != "")
                {
                    if (acc.Balance < decimal.Parse(e.NewValues["Depit"].ToString()))
                    {
                        throw new Exception("Account Balance(" + acc.Balance.ToString() + ") not enough");
                    }
                }
            }

            /////////////////////////////
            table.Rows.Add(new Object[] { e.NewValues["ID"], e.NewValues["GLAccountID"], e.NewValues["Depit"], e.NewValues["Credit"], e.NewValues["Memo"], int.Parse(e.NewValues["GLAccountID"].ToString()) < 0 ? 1 : 0 });
            Session["Table"] = table;

            e.Cancel        = true;
            grid.DataSource = table;
            grid.DataBind();
            grid.CancelEdit();
        }
Esempio n. 24
0
        protected void grid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            ASPxGridView grid = sender as ASPxGridView;

            DataTable table = new DataTable();

            table = GetTable();

            DataRow found = table.Rows.Find(e.Keys[0]);

            found["KPI"]        = e.NewValues["KPI"];
            found["Rate"]       = e.NewValues["Rate"];
            Session["Table101"] = table;
            grid.DataSource     = table;
            grid.DataBind();
            e.Cancel = true;
            grid.CancelEdit();
        }
Esempio n. 25
0
        private void RefreshGrid(ASPxGridView gv)
        {
            GridViewDataComboBoxColumn c;

            c = (GridViewDataComboBoxColumn)gv.Columns["IdentifTipo"];
            c.PropertiesComboBox.TextField  = "Name";
            c.PropertiesComboBox.ValueField = "IdentifTipo";
            c.PropertiesComboBox.DataSource = Business.MediosPublicitarios.ReadAllTipo("");

            c = (GridViewDataComboBoxColumn)gv.Columns["IdentifGrupo"];

            c.PropertiesComboBox.TextField  = "Name";
            c.PropertiesComboBox.ValueField = "IdentifGrupo";
            c.PropertiesComboBox.DataSource = Business.MediosPublicitarios.ReadAllGrupo("");

            gv.DataSource = Business.MediosPublicitarios.ReadAll("");
            gv.DataBind();
        }
Esempio n. 26
0
    protected void relatedProducts_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
    {
        ASPxGridView    g_relatedProducts = (ASPxGridView)sender;
        int             visibleIndex      = int.Parse(e.Parameters);
        ASPxPageControl pc     = (ASPxPageControl)grid.FindDetailRowTemplateControl(visibleIndex, "ASPxPageControl1");
        HtmlInputText   editor = (HtmlInputText)pc.TabPages[0].FindControl("SearchString");

        string searchString = editor.Value;

        string selectCommand = "select * from [Products] where (([CategoryID]=" + g_relatedProducts.GetMasterRowKeyValue().ToString() + ") and ([ProductName] Like '%" + searchString + "%'))";

        Session[g_relatedProducts.GetMasterRowKeyValue().ToString()] = selectCommand;
        AccessDataSource2.SelectCommand = selectCommand;
        DataView view = (DataView)AccessDataSource2.Select(DataSourceSelectArguments.Empty);

        g_relatedProducts.DataSource = view;
        g_relatedProducts.DataBind();
    }
Esempio n. 27
0
        protected void grid_dmorder_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e)
        {
            if (e.RowType == GridViewRowType.Detail)
            {
                ASPxGridView master            = sender as ASPxGridView;
                ASPxGridView grd_selectproduct = master.FindDetailRowTemplateControl(e.VisibleIndex, "grd_selectproduct") as ASPxGridView;

                grd_selectproduct.HtmlRowPrepared += new ASPxGridViewTableRowEventHandler(grd_addproduct_HtmlDataCellPrepared);

                grd_selectproduct.DataSource = new[] {
                    new{ stt = 1, productid = "SP00001", productname = "Hàng hóa 1", unit = "Hộp", number = 500, priceunit = "5.000", total = "2.500.000", lotid = "SL0001", duedate = "01/07/2015", note = "Hàng mới" },
                    new{ stt = 2, productid = "SP00002", productname = "Hàng hóa 2", unit = "Hộp", number = 50, priceunit = "5.000", total = "2.500.000", lotid = "SL0002", duedate = "01/08/2014", note = "Note" },
                    new{ stt = 3, productid = "SP00003", productname = "Hàng hóa 3", unit = "Thùng", number = 70, priceunit = "5.000", total = "2.500.000", lotid = "SL0002", duedate = "01/09/2016", note = "Ví dụ" }
                };

                grd_selectproduct.DataBind();
            }
        }
Esempio n. 28
0
        protected void GridPlanningJournal_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            e.Cancel = true;
            ASPxGridView gridview = sender as ASPxGridView;

            gridview.CancelEdit();
            Guid   transactionId = Guid.Parse(gridview.JSProperties["cpInventoryTransactionId"].ToString());
            Guid   itemUnitId    = Guid.Parse(e.NewValues["ItemUnitId!Key"].ToString());
            double amount        = (double)e.NewValues["Credit"];
            Guid   lotId         = Guid.Parse(e.NewValues["LotId!Key"].ToString());
            Guid   inventoryId   = Guid.Parse(e.NewValues["InventoryId!Key"].ToString());

            InventoryJournalBO inventoryJournalBO = new InventoryJournalBO();

            inventoryJournalBO.CreateInventoryPlanningJournal(session, transactionId, itemUnitId, amount, lotId, inventoryId, (string)e.NewValues["Description"]);
            gridview.DataSource = inventoryJournalBO.GetDeliveryPlanningJournalForTransaction(session, Guid.Parse(gridview.GetMasterRowKeyValue().ToString()));
            gridview.DataBind();
        }
Esempio n. 29
0
        protected void ASPxGridView1_RowUpdating1(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            ASPxGridView grid   = sender as ASPxGridView;
            string       userid = Convert.ToString(e.Keys["UserID"]).Trim();

            try
            {
                using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["IOSWeb_TestConnectionString"].ConnectionString))
                {
                    conn.Open();
                    SqlCommand cmdInsertUser = new SqlCommand("TestGrid_UpdateUser", conn)
                    {
                        CommandType = System.Data.CommandType.StoredProcedure
                    };
                    cmdInsertUser.Parameters.Clear();
                    SqlParameter paramUserID = new SqlParameter("@UserID", userid);

                    SqlParameter User_Name  = new SqlParameter("@UserName", e.NewValues["UserName"]);
                    SqlParameter User_Desc  = new SqlParameter("@UserDesc", e.NewValues["UserDesc"]);
                    SqlParameter Password   = new SqlParameter("@Password", e.NewValues["Password"]);
                    SqlParameter ModifiedBy = new SqlParameter("@ModifiedBy", e.NewValues["ModifiedBy"]);

                    cmdInsertUser.Parameters.Add(paramUserID);
                    cmdInsertUser.Parameters.Add(User_Name);
                    cmdInsertUser.Parameters.Add(User_Desc);
                    cmdInsertUser.Parameters.Add(Password);
                    cmdInsertUser.Parameters.Add(ModifiedBy);

                    cmdInsertUser.ExecuteNonQuery();
                    cmdInsertUser.Parameters.Clear();
                    cmdInsertUser.Dispose();

                    e.Cancel = true;
                    ASPxGridView1.CancelEdit();
                    ASPxGridView1.DataBind();
                }
            }
            catch (Exception ex)
            {
            }
            e.Cancel = true;
            grid.CancelEdit();
            grid.DataBind();
        }
Esempio n. 30
0
    /// <summary>
    /// Xử lý khi Save Callback kết thúc
    /// </summary>
    /// <param name="result">kết quả trả về khi callback xong</param>
    /// <param name="param">tham số e.Parameter của Callback Event</param>
    /// <param name="tblTemp">Tên bảng cần xóa dữ liệu tạm sau khi callback xong. Chỉ dành cho trường hợp lưu thành công</param>
    /// <param name="sessionname">Tên session lưu giữ sessionkey của bảng temp</param>
    /// 
    public static void gridProductDetailsAddInCallback(string parameter, ASPxGridView gv)
    {
        object tempID = -1;
        if (parameter.StartsWith("reorderlevel"))
        {

            object typeReorder = parameter.Split(';')[1];
            tempID = parameter.Split(';')[2];

            if (tempID != null)
            {
                EU.SALE_temp_reorderLevel(tempID, typeReorder);
                //LogAction(4, tempID + ";ReorderLevel :" + parameter);
                //throw new Exception("gridProductDetailsAddInCallback;" + tempID + ";param:" + parameter);
            }

        }
        gv.DataBind();
    }
Esempio n. 31
0
        protected void grid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            ASPxGridView grid = sender as ASPxGridView;

            DataTable table = new DataTable();

            table = GetTable();

            DataRow found = table.Rows.Find(e.Keys[0]);
            //found["Day"] = e.NewValues["Day"];
            decimal tot = 0;

            for (int i = 0; i < table.Columns.Count; i++)
            {
                if (!table.Columns[i].ReadOnly && e.NewValues[table.Columns[i].ToString()] != null)
                {
                    found[table.Columns[i].ToString()] = e.NewValues[table.Columns[i].ToString()];
                    if (table.Columns[i].ToString() != "ID" && table.Columns[i].ToString() != "StudentName" && table.Columns[i].ToString() != "Total" && table.Columns[i].ToString() != "ExamCourseID")
                    {
                        tot += decimal.Parse(e.NewValues[table.Columns[i].ToString()].ToString());
                    }
                }
            }
            found["Total"] = tot.ToString();

            /*  found["Lecture1"] = e.NewValues["Lecture1"];
             * found["Lecture2"] = e.NewValues["Lecture2"];
             * found["Lecture3"] = e.NewValues["Lecture3"];
             * found["Lecture4"] = e.NewValues["Lecture4"];
             * found["Lecture5"] = e.NewValues["Lecture5"];
             * found["Lecture6"] = e.NewValues["Lecture6"];
             * found["Lecture7"] = e.NewValues["Lecture7"];
             * found["Lecture8"] = e.NewValues["Lecture8"];
             * found["Lecture9"] = e.NewValues["Lecture9"];
             * found["Lecture10"] = e.NewValues["Lecture10"];
             */

            Session["TableDegree"] = table;
            grid.DataSource        = table;
            grid.DataBind();
            e.Cancel = true;
            grid.CancelEdit();
        }
Esempio n. 32
0
        protected void grid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            ASPxGridView grid  = sender as ASPxGridView;
            DataTable    table = new DataTable();

            if (Convert.ToInt32(Request.QueryString["id"].ToString()) > 0)
            {
                ProductPriceItems PPI = new ProductPriceItems();
                table = PPI.getByProductID(Convert.ToInt32(Request.QueryString["id"].ToString()));
                if (table.Rows.Count > 0)
                {
                    if (Session["Table"] == null)
                    {
                        DataColumn colid = table.Columns[0];
                        table.PrimaryKey = new DataColumn[] { colid };
                    }
                    else
                    {
                        table = GetTable();
                    }
                }
                else
                {
                    table = GetTable();
                }
            }
            else
            {
                table = GetTable();
            }
            DataRow found = table.Rows.Find(e.Keys[0]);

            found["Description"] = e.NewValues["Description"];
            found["Amount"]      = e.NewValues["Amount"];
            found["Seq"]         = e.NewValues["Seq"];
            found["GLAccountID"] = e.NewValues["GLAccountID"];

            Session["Table"] = table;
            grid.DataSource  = table;
            grid.DataBind();
            e.Cancel = true;
            grid.CancelEdit();
        }
Esempio n. 33
0
 private void RefreshGrid(ASPxGridView gv)
 {
     gv.DataSource = CRUDHelper.ReadAll("", DAO);
     gv.DataBind();
 }
Esempio n. 34
0
    public void gridCallBackOption(ASPxGridView grid, string param, string KeyFieldName, SqlDataSource ds)
    {
        try
        {

            HttpCookie myCookie = Request.Cookies[CU.getuserid().ToString()];

            switch (param)
            {
                case "isShowFiltertrue":
                    grid.Settings.ShowFilterBar = GridViewStatusBarMode.Visible;
                    if (myCookie != null) myCookie["GroupFilter"] = "true";
                    break;
                case "isShowFilterfalse":
                    grid.Settings.ShowFilterBar = GridViewStatusBarMode.Hidden;
                    if (myCookie != null) myCookie["GroupFilter"] = "false";
                    break;
                case "isShowHScrolltrue":
                    grid.Settings.HorizontalScrollBarMode = DevExpress.Web.ASPxClasses.ScrollBarMode.Visible;
                    if (myCookie != null) myCookie["HScroll"] = "true";
                    break;
                case "isShowHScrollfalse":
                    grid.Settings.HorizontalScrollBarMode = DevExpress.Web.ASPxClasses.ScrollBarMode.Hidden;
                    if (myCookie != null) myCookie["HScroll"] = "false";
                    break;
                case "isShowHypColtrue":
                    grid.AccessibilityCompliant = true;
                    if (myCookie != null) myCookie["HypCol"] = "true";
                    break;
                case "isShowHypColfalse":
                    grid.AccessibilityCompliant = false;
                    if (myCookie != null) myCookie["HypCol"] = "false";
                    break;
                case "isShowGrouptrue":
                    grid.Settings.ShowGroupPanel = true;
                    if (myCookie != null) myCookie["Grouptrue"] = "true";
                    break;
                case "isShowGroupfalse":
                    grid.Settings.ShowGroupPanel = false;
                    if (myCookie != null) myCookie["Grouptrue"] = "false";
                    break;
            }

            List<object> listKeyValueOK = new List<object>();

            if (param.IndexOf("focus") >= 0)
            {
                int id = 0;
                Int32.TryParse(param.Replace("focus", ""), out id);
                if (id > 0)
                    grid.FocusedRowIndex = grid.FindVisibleIndexByKeyValue(param.Replace("focus", ""));
            }
            else if (param.IndexOf("action") >= 0)
            {
                int action = int.Parse(param.Replace("action", ""));

                List<object> listkeyvalue = grid.GetSelectedFieldValues(grid.KeyFieldName);
                SiAuto.Main.LogColored(System.Drawing.Color.Purple, grid.KeyFieldName + "Số dòng :" + listkeyvalue.Count);
                if (listkeyvalue.Count > 0)
                {
                    for (int i = 0; i < listkeyvalue.Count; i++)
                    {
                        SiAuto.Main.LogColored(System.Drawing.Color.Purple, "key so :" + i.ToString() + "----" + listkeyvalue[i]);
                        string currentCode = "isApproved=" + action + " AND " + grid.KeyFieldName + "=" + listkeyvalue[i];
                        bool check = EU.CheckByModuleD(globalModuleID, currentCode);
                        if (check == true)
                        {
                            var values = new Dictionary<string, object>
                        {
                            {"isApproved",action},
                            {grid.KeyFieldName,listkeyvalue[i]}
                        };

                            EU.updateTblScript(globalModuleID, values);
                            listKeyValueOK.Add(listkeyvalue[i]);
                        }
                    }

                    if (listKeyValueOK.Count > 0)
                    {
                        if (action == 1)
                        {
                            WorkFlowManager.BuildTaskByWhenExecute(globalModuleID, "APPROVED", string.Join(";", listKeyValueOK));
                            UserUtils.Log(CU.getLoginID(), globalModuleID, -1, string.Join(";", listKeyValueOK), "", "Duyệt thành công !", "APPROVED");
                        }
                        else
                        {
                            WorkFlowManager.BuildTaskByWhenExecute(globalModuleID, "NOTAPPROVED", string.Join(";", listKeyValueOK));
                            UserUtils.Log(CU.getLoginID(), globalModuleID, -1, string.Join(";", listKeyValueOK), "", "Bỏ duyệt thành công !", "NOTAPPROVED");
                        }
                        listKeyValueOK.Clear();
                    }
                }
                else
                {
                    object currentFocused = grid.GetRowValues(grid.FocusedRowIndex, grid.KeyFieldName);
                    string currentCode = "isApproved=" + action + " AND " + grid.KeyFieldName + "=" + currentFocused.ToString();
                    bool check = EU.CheckByModuleD(globalModuleID, currentCode);
                    if (check == true)
                    {
                        if (currentFocused != null)
                        {
                            var values = new Dictionary<string, object>{
                            {"isApproved",action},
                            {grid.KeyFieldName,currentFocused}
                        };
                            EU.updateTblScript(globalModuleID, values);

                            if (action == 1)
                            {
                                SiAuto.Main.LogColored(Color.Green, "Chuan bi workflow APPROVED");
                                WorkFlowManager.BuildTaskByWhenExecute(globalModuleID, "APPROVED", currentFocused.ToString());
                                SiAuto.Main.LogColored(Color.Green, "End workflow APPROVED");

                                SiAuto.Main.LogColored(Color.Green, "ghi vao tray - bảng SY_audit_trail APPROVED");
                                //UserUtils.Log(CU.getLoginID(), globalModuleID, -1, currentFocused.ToString(), "", "Duyệt thành công !", "APPROVED");
                                SiAuto.Main.LogColored(Color.Green, "end tray ");
                            }
                            else
                            {
                                SiAuto.Main.LogColored(Color.Green, "Chuan bi workflow NOTAPPROVED");
                                WorkFlowManager.BuildTaskByWhenExecute(globalModuleID, "NOTAPPROVED", currentFocused.ToString());
                                SiAuto.Main.LogColored(Color.Green, "End workflow NOTAPPROVED");

                                SiAuto.Main.LogColored(Color.Green, "ghi vao tray - bảng SY_audit_trail NOTAPPROVED");
                                //UserUtils.Log(CU.getLoginID(), globalModuleID, -1, currentFocused.ToString(), "", "Bỏ duyệt thành công !", "NOTAPPROVED");
                                SiAuto.Main.LogColored(Color.Green, "end tray NOTAPPROVED");
                            }
                        }
                    }
                }
                UserUtils.Log(CU.getLoginID(), globalModuleID, -1, -1, listkeyvalue.ToString(), "", "APPROVED :" + action);
            }

            else if (param.IndexOf("delselect") >= 0)
            {
                List<object> listid = grid.GetSelectedFieldValues(new string[] { grid.KeyFieldName });

                if (listid.Count > 0)
                {
                    for (int i = 0; i < listid.Count; i++)
                    {
                        SiAuto.Main.LogColored(System.Drawing.Color.Purple, "key so :" + i.ToString() + "----" + listid[i]);
                        string currentCode = "isDeleted=1 AND " + grid.KeyFieldName + "=" + listid[i];
                        bool check = EU.CheckByModuleD(globalModuleID, currentCode);
                        if (check == true)
                        {
                            string rowDeleted = EU.deleteMultiTblScript(globalModuleID, grid.KeyFieldName, string.Join(",", listid));
                            listKeyValueOK.Add(listid[i]);
                        }
                    }
                    if (listKeyValueOK.Count > 0)
                    {
                        WorkFlowManager.BuildTaskByWhenExecute(globalModuleID, "DELETED", string.Join(";", listKeyValueOK));
                        listKeyValueOK.Clear();
                    }
                }
                else
                {
                    object currentFocused = grid.GetRowValues(grid.FocusedRowIndex, grid.KeyFieldName);
                    if (currentFocused != null)
                    {
                        string currentCode = "isDeleted=1 AND " + grid.KeyFieldName + "=" + currentFocused.ToString();
                        bool check = EU.CheckByModuleD(globalModuleID, currentCode);
                        if (check == true)
                        {
                            string rowDeleted = EU.deleteMultiTblScript(globalModuleID, grid.KeyFieldName, string.Join(",", currentFocused.ToString()));
                            if (int.Parse(rowDeleted) > 0)
                            {
                                SiAuto.Main.LogColored(Color.Green, "Chuan bi workflow DELETED");
                                WorkFlowManager.BuildTaskByWhenExecute(globalModuleID, "DELETED", currentFocused.ToString());
                                SiAuto.Main.LogColored(Color.Green, "End workflow DELETED");

                                SiAuto.Main.LogColored(Color.Green, "ghi vao tray - bảng SY_audit_trail DELETED");
                                UserUtils.Log(CU.getLoginID(), globalModuleID, -1, int.Parse(currentFocused.ToString()), "", "Xóa thành công !", "DELETED");
                                SiAuto.Main.LogColored(Color.Green, "end tray DELETED");
                            }

                        }
                    }
                }

            }
            else if (param.IndexOf("RestoreSelect") >= 0)
            {

                List<object> listid = grid.GetSelectedFieldValues(new string[] { grid.KeyFieldName });
                if (listid.Count > 0)
                {
                    for (int i = 0; i < listid.Count; i++)
                    {
                        SiAuto.Main.LogColored(System.Drawing.Color.Purple, "key so :" + i.ToString() + "----" + listid[i]);
                        string currentCode = "isDeleted=0 AND " + grid.KeyFieldName + "=" + listid[i];
                        bool check = EU.CheckByModuleD(globalModuleID, currentCode);
                        if (check == true)
                        {
                            string rowDeleted = EU.restoreMultiTblScript(globalModuleID, grid.KeyFieldName, string.Join(",", listid));
                            listKeyValueOK.Add(listid[i]);
                        }
                    }
                    if (listKeyValueOK.Count > 0)
                    {
                        WorkFlowManager.BuildTaskByWhenExecute(globalModuleID, "RESTORED", string.Join(";", listKeyValueOK));
                        listKeyValueOK.Clear();
                    }
                }
                else
                {
                    object currentFocused = grid.GetRowValues(grid.FocusedRowIndex, grid.KeyFieldName);
                    if (currentFocused != null)
                    {
                        string currentCode = "isDeleted=0 AND " + grid.KeyFieldName + "=" + currentFocused.ToString();
                        bool check = EU.CheckByModuleD(globalModuleID, currentCode);
                        if (check == true)
                        {
                            string rowDeleted = EU.restoreMultiTblScript(globalModuleID, grid.KeyFieldName, string.Join(",", currentFocused.ToString()));
                            if (int.Parse(rowDeleted) > 0)
                            {
                                SiAuto.Main.LogColored(Color.Green, "Chuan bi workflow RESTORED");
                                WorkFlowManager.BuildTaskByWhenExecute(globalModuleID, "RESTORED", currentFocused.ToString());
                                SiAuto.Main.LogColored(Color.Green, "End workflow RESTORED");

                                SiAuto.Main.LogColored(Color.Green, "ghi vao tray - bảng SY_audit_trail RESTORED");
                                UserUtils.Log(CU.getLoginID(), globalModuleID, -1, int.Parse(currentFocused.ToString()), "", "Phục hồi thành công !", "RESTORED");
                                SiAuto.Main.LogColored(Color.Green, "end tray RESTORED");
                            }
                        }
                    }
                }
            }
            grid.DataBind();
            if (myCookie != null) Response.Cookies.Set(myCookie);
        }
        catch (Exception ex)
        {

            throw new Exception(ex.Message);
        }
    }
 private void RefreshAbmGrid(ASPxGridView gvABM)
 {
     gvABM.DataSource = Productos;
     gvABM.DataBind();
 }
Esempio n. 36
0
    public void Setup(ASPxGridView gridView, DataTable table)
    {
        if (table == null) return;

        gridView.DataSource = table;
        gridView.DataBind();
    }
 private void RefreshGrid(ASPxGridView gv)
 {
     gv.DataSource = CRUDHelper.ReadAll("", BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.IdentAtencion));
     gv.DataBind();
 }
Esempio n. 38
0
        private void RefreshGrid(ASPxGridView gridView)
        {
            if (gridView.ID == "gv")
                gridView.DataSource = Business.Costos.ReadAll("");
            else
                if (pnlVersiones.Attributes["RecId"] != null)
                    gvVersiones.DataSource = Business.Costos.ReadAllVersiones(Business.Costos.Read(Convert.ToInt32(pnlVersiones.Attributes["RecId"])));

            gridView.DataBind();
        }
 protected void CancelEditingFromEditing(ASPxGridView gridView, CancelEventArgs e)
 {
     e.Cancel = true;
     gridView.CancelEdit();
     gridView.DataBind(gridView.DataSource as XPCollection);
 }
        private void RefreshAbmGrid(ASPxGridView gvABM)
        {
            List<MiEstimadoDetDTO> miLista = new List<MiEstimadoDetDTO>();

             AgregarCodigoAviso(miLista);

            //reordena la lista
            gvABM.DataSource = miLista;

            gvABM.SortBy(gv.Columns["Fecha"] , DevExpress.Data.ColumnSortOrder.Ascending);
            gvABM.SortBy(gv.Columns["Dia"]   , DevExpress.Data.ColumnSortOrder.Ascending);
            gvABM.SortBy(gv.Columns["Hora"]  , DevExpress.Data.ColumnSortOrder.Ascending);
            gvABM.SortBy(gv.Columns["Salida"], DevExpress.Data.ColumnSortOrder.Ascending);

            gvABM.DataBind();
        }
Esempio n. 41
0
 /// <summary>
 /// Refresh grid moi khi delete item
 /// Phai thuc hien nhieu buoc la vi khi thuc hien ham bind o 1 trang > 0 thi bi loi
 /// </summary>
 /// <param name="grid"></param>
 public static void RefreshGrid(ASPxGridView grid)
 {
     int page = grid.PageIndex;
     grid.PageIndex = 0;
     grid.DataBind();
     grid.PageIndex = page;
 }
Esempio n. 42
0
 private void FillGridView(ASPxGridView gv, int taskClassType)
 {
     try
     {
         IQueryable<TaskStruct> test = GetTableLookFromSession(taskClassType).AsQueryable();
         gv.DataSource = from t in test
                         select new { f1 = t.Description, f2 = t.Value };
         gv.DataBind();
     }
     catch { }
 }
        protected void AgregarTotales()
        {
            try {

                int suma = 0;
                decimal suma2 = 0;
                decimal suma3 = 0;

                ASPxGridView aux = new ASPxGridView();

                string Titulo = string.Empty;

                Tabla.Rows[Tabla.Rows.Count - 1][0] = "TOTALES";

                aux.DataSource = Tabla;

                aux.DataBind();

                gv.DataSource = Tabla;

                gv.DataBind();

                for (int x = 5; x <= Tabla.Columns.Count - 1; x++)
                {

                    Titulo = aux.Columns[x].ToString();

                    if (Titulo.Substring(Titulo.Length - 1) == "1")
                    {
                        Titulo = Titulo.Substring(0, Titulo.Length - 1);

                        aux.Columns[Titulo + "1"].Caption = Titulo + " - Costo";

                    }

                    if (aux.Columns[x].Index > 6 && aux.Columns[x].ToString().Substring(aux.Columns[x].ToString().Length - 1) != "1" && aux.Columns[x].ToString().Substring(aux.Columns[x].ToString().Length - 7) != "Salidas")
                    {
                        Titulo = aux.Columns[x].ToString() + " - Salidas";

                        aux.Columns[aux.Columns[x].Index].Caption = Titulo;

                    }

                    aux.Columns[x].HeaderStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;

                    gv = aux;

                    suma = 0;
                    suma2 = 0;
                    suma3 = 0;

                    for (int y = 0; y <= Tabla.Rows.Count - 2; y++)
                    {
                        if (Tabla.Rows[y][x] != System.DBNull.Value)
                        {

                            if (Titulo.Substring(Titulo.Length - 7) == "Salidas")
                            {
                                suma += Convert.ToInt32(Tabla.Rows[y][x]);
                            }
                            else
                            {
                                if (Titulo.Substring(Titulo.Length - 5) == "Costo")
                                {
                                    suma2 += Convert.ToDecimal(Tabla.Rows[y][x]);
                                }
                                else
                                {
                                    suma3 += Convert.ToDecimal(Tabla.Rows[y][x]);
                                }
                            }
                        }
                    }

                    if (Titulo.Substring(Titulo.Length - 7) == "Salidas")
                    {
                        Tabla.Rows[Tabla.Rows.Count - 1][x] = suma;
                    }
                    else
                    {
                        if (Titulo.Substring(Titulo.Length - 5) == "Costo")
                        {
                            Tabla.Rows[Tabla.Rows.Count - 1][x] = suma2;
                        }
                        else
                        {
                            if (Titulo.Substring(Titulo.Length - 9) == "INVERSION")
                            {
                                Tabla.Rows[Tabla.Rows.Count - 1][x] = suma3;
                            }
                            else
                            {
                                Tabla.Rows[Tabla.Rows.Count - 1][x] = Convert.ToInt32(suma3);
                            }
                        }
                    }
                }

            }
            catch(Exception ex)
            {
            }
        }
Esempio n. 44
0
 private void RefreshAbmGrid(ASPxGridView gvABM)
 {
     gvABM.DataSource = TipoCambio;
     gvABM.DataBind();
 }
 private void RefreshAbmGrid(ASPxGridView gvABM)
 {
     gvABM.DataSource = Detalles;
     gvABM.DataBind();
 }
 protected override void EndEditing(ASPxGridView gridView, System.ComponentModel.CancelEventArgs e)
 {
     e.Cancel = true;
     gridView.CancelEdit();
     gridView.DataBind(gridView.DataSource as XPCollection);
 }
        private void LoadSearch(int _type, int _status, ASPxGridView grv)
        {
            try
            {

                if (idGroup != 1 && idGroup != 2 && idGroup != 4 && idGroup != 10 && idGroup != 14)
                {
                    var listPlus = (from a in db.PROFILE_NEWs where a.USER_ID == idUser select a)
                                .Union(from a in db.PROFILE_NEWs
                                       join b in db.WORKFLOW_USERs on a.ID equals b.PROF_ID
                                       where b.USER_ID == idUser
                                       select a).OrderByDescending(n => n.PROF_DATE);
                    if (listPlus.Count() > 0)
                    {
                        if (_status == 0)
                        {
                            var listNew = listPlus.Where(n => n.PROF_TYPE == _type && n.PROF_STATUS != 12 );
                            grv.DataSource = listNew;
                            grv.DataBind();
                            Session["DangTienHanh"] = Utils.CIntDef(Session["DangTienHanh"]) + listNew.Count(n => n.PROF_STATUS != 12);
                            Session["DaHoanThanh"] = Utils.CIntDef(Session["DaHoanThanh"]) + listNew.Count(n => n.PROF_STATUS == 12);
                        }
                        else
                        {
                            var listNew = listPlus.Where(n => n.PROF_TYPE == _type && n.PROF_STATUS == 12 );
                            grv.DataSource = listNew;
                            grv.DataBind();
                            Session["DangTienHanh"] = Utils.CIntDef(Session["DangTienHanh"]) + listNew.Count(n => n.PROF_STATUS != 12);
                            Session["DaHoanThanh"] = Utils.CIntDef(Session["DaHoanThanh"]) + listNew.Count(n => n.PROF_STATUS == 12);
                        }
                    }
                    else
                    {
                        if (_status == 0)
                        {
                            var listDom = db.PROFILE_NEWs.Where(n => n.USER_ID == idUser && n.PROF_TYPE == _type && n.PROF_STATUS != 12).OrderByDescending(n => n.PROF_DATE);
                            grv.DataSource = listDom;
                            grv.DataBind();
                            Session["DangTienHanh"] = Utils.CIntDef(Session["DangTienHanh"]) + listDom.Count(n => n.PROF_STATUS != 12);
                            Session["DaHoanThanh"] = Utils.CIntDef(Session["DaHoanThanh"]) + listDom.Count(n => n.PROF_STATUS == 12);
                        }
                        else
                        {
                            var listDom = db.PROFILE_NEWs.Where(n => n.USER_ID == idUser && n.PROF_TYPE == _type && n.PROF_STATUS == 12).OrderByDescending(n => n.PROF_DATE);
                            grv.DataSource = listDom;
                            grv.DataBind();
                            Session["DangTienHanh"] = Utils.CIntDef(Session["DangTienHanh"]) + listDom.Count(n => n.PROF_STATUS != 12);
                            Session["DaHoanThanh"] = Utils.CIntDef(Session["DaHoanThanh"]) + listDom.Count(n => n.PROF_STATUS == 12);
                        }
                    }
                }
                else
                {
                    if (_status == 0)
                    {
                        var list = db.PROFILE_NEWs.Where(n => n.PROF_TYPE == _type && n.PROF_STATUS != 12).OrderByDescending(n => n.PROF_DATE);
                        grv.DataSource = list;
                        grv.DataBind();
                        Session["DangTienHanh"] = Utils.CIntDef(Session["DangTienHanh"]) + list.Count(n => n.PROF_STATUS != 12);
                        Session["DaHoanThanh"] = Utils.CIntDef(Session["DaHoanThanh"]) + list.Count(n => n.PROF_STATUS == 12);
                    }
                    else
                    {
                        var list = db.PROFILE_NEWs.Where(n => n.PROF_TYPE == _type && n.PROF_STATUS == 12).OrderByDescending(n => n.PROF_DATE);
                        grv.DataSource = list;
                        grv.DataBind();
                        Session["DangTienHanh"] = Utils.CIntDef(Session["DangTienHanh"]) + list.Count(n => n.PROF_STATUS != 12);
                        Session["DaHoanThanh"] = Utils.CIntDef(Session["DaHoanThanh"]) + list.Count(n => n.PROF_STATUS == 12);
                    }
                }
            }
            catch //(Exception)
            {

                //throw;
            }
        }
Esempio n. 48
0
 private void RefreshAbmGrid(ASPxGridView gvABM)
 {
     gvABM.DataSource = Atencion;
     gvABM.DataBind();
 }
        private void RefreshAbmGrid(ASPxGridView gv)
        {
            var lineas = new List<CertificadoDetDTO>();

            if (mycert != null)
            {
                mycert = mycert.OrderBy(t => t.Dia).ThenBy(u => u.Hora).ThenBy(v => v.Salida).ToList();
            }

            lineas = mycert;

            lineas = lineas.OrderBy(t => t.Dia).ThenBy(u => u.Hora).ThenBy(v => v.Salida).ToList();

            gv.DataSource = lineas;
            gv.DataBind();
        }
 private void RefreshGrid(ASPxGridView gv)
 {
     gv.DataSource = CRUDHelper.ReadAll("", BusinessMapper.GetDaoByEntity(Entity));
     gv.DataBind();
 }
 private void RefreshAbmGridUnsorted(ASPxGridView gv)
 {
     gv.DataSource = mycert;
     gv.DataBind();
 }
Esempio n. 52
0
        private void RefreshAbmGrid(ASPxGridView gvABM)
        {
            if (gvABM.ID == "gvABMFrecuencia")
                gvABM.DataSource = CostosFrecuencia;
            else
                gvABM.DataSource = CostosProveedor;

            gvABM.DataBind();
        }
 private void RefreshHomeGrid(ASPxGridView gvHome)
 {
     //cargar con pautas
     gvHome.DataSource = mycert;
     gvHome.DataBind();
 }
 private void RefreshGrid(ASPxGridView gv)
 {
     gv.DataSource = Business.TecnologiaSoporte.ReadAll("");
     gv.DataBind();
 }
        private void RefreshSKUGrid(ASPxGridView gvSKU)
        {
            decimal total = 0;
            var dt = Certificados.BuildAllSKU(mycert);

            gvSKU.DataSource = dt;
            gvSKU.DataBind();

            foreach (System.Data.DataRow dr in dt.Rows)
                total += Convert.ToDecimal(dr["CantSalidas"]);

            lblSKUTotalSalidas.Text = "Total de Salidas: " + total.ToString();
        }
Esempio n. 56
0
 private void RefreshGrid(ASPxGridView gv)
 {
     gv.DataSource = Business.Monedas.ReadAll("");
     gv.DataBind();
 }
Esempio n. 57
0
        private void RefreshAbmGrid(ASPxGridView gv)
        {
            var lineas = Lineas;
            lineas = lineas.OrderBy(p => p.Dia).ThenBy(r => r.Hora).ThenBy(s => s.Salida).ToList();

            gv.DataSource = lineas;
            gv.DataBind();
        }