Esempio n. 1
0
        protected void dxgvSerial_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            if (e.RowType == DevExpress.Web.GridViewRowType.Data)
            {
                Label lbl = dxgvSerial.FindRowCellTemplateControl(e.VisibleIndex, null, "lblBranchName") as Label;
                string strCoCode = e.GetValue("CO_CODE").ToString();
                if (lbl != null && strCoCode != string.Empty)
                {
                    using (DataModel.COMPANY_BO objT24_COMPANY_BO = new DataModel.COMPANY_BO())
                    {
                        DataModel.COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(strCoCode);
                        if (objT24_COMPANY != null)
                        {
                            lbl.Text = objT24_COMPANY.COMPANY_NAME;
                        }
                    }
                }

                Label lbl2 = dxgvSerial.FindRowCellTemplateControl(e.VisibleIndex, null, "lblStatus") as Label;
                if (lbl2 != null)
                {
                    if (e.GetValue("IsUsed") != null)
                    {
                        bool strStatus = Convert.ToBoolean(e.GetValue("IsUsed"));

                        if (strStatus)
                        {
                            lbl2.Text = "Đã cấp mã";
                        }
                        else
                        {
                            lbl2.Text = "Đã xóa";
                        }
                    }
                    else
                    {
                        lbl2.Text = "Đã cấp mã";
                    }
                }

                Label lbl3 = dxgvSerial.FindRowCellTemplateControl(e.VisibleIndex, null, "lblMaDuThuong") as Label;
                if (lbl3 != null)
                {
                    if (e.GetValue("Serials") != null)
                    {
                        string strSerials = e.GetValue("Serials").ToString();
                        if (!string.IsNullOrEmpty(strSerials))
                        {
                            strSerials = Commons.Common.FormatSerial(strSerials.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList());
                        }

                        lbl3.Text = strSerials;
                    }
                    else
                    {
                        lbl3.Text = string.Empty;
                    }
                }
            }
        }
 protected void gdvCarteiras_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (Convert.ToDateTime(e.GetValue("DteDataPagamento")) <= DateTime.Now)
     {
         e.Row.ForeColor = Color.Red;
     }
 }
 protected void gvInvoiceSearch_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     string status = (string)e.GetValue("status");
     if (status == "DG")
     {
         e.Row.BackColor = System.Drawing.Color.Salmon;
     }
 }
 protected void ASPxGridView2_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     int ConLai = Convert.ToInt32(e.GetValue("ConLai"));
     if (ConLai > 0)
     {
         e.Row.ForeColor = System.Drawing.Color.Red;
     }
 }
Esempio n. 5
0
 //改变当前处理列的颜色
 protected void detailYgzmx_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableDataCellEventArgs e)
 {
     //根据工序ID 显示工序名称
         if (e.DataColumn.FieldName == "GXID")
         {
            string strgxid = e.GetValue("GXID").ToString();
           e.Cell.Text=helper.GetGxName(strgxid);
         }
 }
Esempio n. 6
0
 protected void gridLogRecords_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (this.LogType != LogTypesEnum.ChannelMonitoringHistory) return;
     if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data) return;
     ChannelLogEnum value = (ChannelLogEnum)e.GetValue("LogType");
     if (value == ChannelLogEnum.ChannelError)
         e.Row.BackColor = System.Drawing.Color.Red;
     else if (value == ChannelLogEnum.ProductError)
         e.Row.BackColor = System.Drawing.Color.Orange;
 }
Esempio n. 7
0
        protected void dxgvLiXi_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            if (e.RowType == DevExpress.Web.GridViewRowType.Data)
            {
                Label lbl = dxgvLiXi.FindRowCellTemplateControl(e.VisibleIndex, null, "lblBranchName") as Label;
                string strCoCode = e.GetValue("CoCode").ToString();
                if (lbl != null && strCoCode != string.Empty)
                {
                    using (COMPANY_BO objT24_COMPANY_BO = new COMPANY_BO())
                    {
                        COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(strCoCode);
                        if (objT24_COMPANY != null)
                        {
                            lbl.Text = objT24_COMPANY.COMPANY_NAME;
                        }
                    }
                }

                Label lbl2 = dxgvLiXi.FindRowCellTemplateControl(e.VisibleIndex, null, "lblStatus") as Label;
                if (lbl2 != null)
                {
                    if (e.GetValue("IsUsed") != null)
                    {
                        bool strStatus = Convert.ToBoolean(e.GetValue("IsUsed"));

                        if (strStatus)
                        {
                            lbl2.Text = "Đã cấp";
                        }
                        else
                        {
                            lbl2.Text = "Đã xóa";
                        }
                    }
                    else
                    {
                        lbl2.Text = "Đã cấp";
                    }
                }
            }
        }
    protected void ASPxGridView1_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
    {
        if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Data)
        {
            string n_IdPedido = e.GetValue("n_IdPedido").ToString();
            int i_IdMenu = int.Parse(Request.QueryString["IdMenu"]);

            LinkButton LinkButton1 = new LinkButton();
            LinkButton1 = (LinkButton)ASPxGridView1.FindRowCellTemplateControl(e.VisibleIndex, (GridViewDataColumn)(ASPxGridView1.Columns[0]), "LinkButton1");

            LinkButton1.PostBackUrl = "CrearPedido.aspx?n_IdPedido=" + n_IdPedido + "&td=1&IdMenu=" + i_IdMenu;

        }
    }
    protected void ASPxGridView1_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
    {
        if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Data)
        {
            string n_IdProducto = e.GetValue("n_IdProducto").ToString();
            int i_IdMenu = int.Parse(Request.QueryString["IdMenu"]);

            LinkButton lbProducto = new LinkButton();
            lbProducto = (LinkButton)ASPxGridView1.FindRowCellTemplateControl(e.VisibleIndex, (GridViewDataColumn)(ASPxGridView1.Columns[2]), "lbProducto");

            lbProducto.PostBackUrl = "CrearProducto.aspx?n_IdProducto=" + n_IdProducto + "&IdMenu=" + i_IdMenu;
            lbProducto.Enabled = chkEditar.Checked;
        }
    }
Esempio n. 10
0
    //改变当前处理列的颜色
    protected void gridRGZ_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableDataCellEventArgs e)
    {
        //if (e.DataColumn.FieldName == "JE" || e.DataColumn.FieldName == "DJ")
        //{
        //        e.Cell.ForeColor = System.Drawing.Color.Red;
        //}
        //string jjyxz = e.GetValue("JJYXZ").ToString();

        //for (int n = 0; n < gridRGZ.Columns.Count; n++)
        //{

        //    if (e.DataColumn.FieldName == jjyxz)
        //    {
        //        e.Cell.ForeColor = System.Drawing.Color.Blue;
        //    }

        //}
        if (e.DataColumn.FieldName == "SJLY" )
        {

            int intsjly = int.Parse(e.GetValue("SJLY").ToString());
            switch (intsjly)
            {
                case 0:
                    e.Cell.Text= "系统";
                    break;
                case 1:
                    e.Cell.Text = "导入";
                    break;
            }
        }
        if (e.DataColumn.FieldName == "SPZT")
        {

            int intspzt = int.Parse(e.GetValue("SPZT").ToString());
            switch (intspzt)
            {
                case 0:
                    e.Cell.Text = "未审批";
                    break;
                case 1:
                    e.Cell.Text = "已审批";
                    break;
            }
        }
    }
 protected void gvPolicyCustomer_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableDataCellEventArgs e)
 {
     double target = 0,payment = -1;
     ListEditItem selectedItem = cmbPolicy.SelectedItem;
     Double.TryParse(selectedItem.GetValue("target").ToString(),out target);
     if (e.DataColumn.FieldName == "payment" && int.Parse(cmbPolicy.Value.ToString())!= -1)
     {
         Double.TryParse(e.GetValue("payment").ToString(), out payment);
         if (payment >= target)
         {
             e.Cell.BackColor = System.Drawing.Color.Blue;
             e.Cell.ForeColor = System.Drawing.Color.White;
         }
         else
         {
             e.Cell.ForeColor = System.Drawing.Color.Blue;
         }
     }
 }
Esempio n. 12
0
    //改变当前处理列的颜色
    protected void gridRGZ_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableDataCellEventArgs e)
    {
        if (e.DataColumn.FieldName == "CQBZCL" )
        {
            e.Cell.ForeColor = System.Drawing.Color.Red;
        }

        if (e.DataColumn.FieldName == "SPZT")
        {

            int intspzt = int.Parse(e.GetValue("SPZT").ToString());
            switch (intspzt)
            {
                case 0:
                    e.Cell.Text = "未审批";
                    break;
                case 1:
                    e.Cell.Text = "已审批";
                    break;
            }
        }
    }
    protected void dxgridDeliveries_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
    {
        try
        {
            string _s = "";
            int _id = 0;

            if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Data)
            {

                _id = wwi_func.vint(e.GetValue("DeliveryID").ToString());

                if (_id > 0)
                {
                    _s = wwi_func.lookup_multi_values("CompanyName,Address1,Address2,Address3,CountryName,TelNo,PalletDims,MaxPalletWeight,MaxPalletHeight,SpecialDeliveryInstructions", "view_delivery_instruction", "DeliveryID", _id, "|");
                    if (!string.IsNullOrEmpty(_s))
                    {
                        string[] _labels = { "DeliveryName", "DeliveryAddress", "DeliveryAddress", "DeliveryAddress", "DeliveryAddress", "DeliveryAddress", "PalletSpec", "PalletWeight", "PalletHeight", "Instructions" };
                        string[] _elements = _s.Split("|".ToCharArray());

                        for (int _ix = 0; _ix < _labels.Length; _ix++)
                        {
                            ASPxLabel _lbl = (ASPxLabel)this.dxgridDeliveries.FindRowTemplateControl(e.VisibleIndex, "dxlbl" + _labels[_ix]);
                            if (_lbl != null)
                            {
                                _lbl.Text += _elements[_ix] + Environment.NewLine;
                            }
                        }//end loop
                    }//end if
                }

                //current status
                _id = e.GetValue("CurrentStatusID") != null ? wwi_func.vint(e.GetValue("CurrentStatusID").ToString()) : 0;
                string _f = "";
                if (_id > 0)
                {
                    _f = wwi_func.lookup_value("Field1", "CurrentStatus", "ID", _id);
                    ASPxLabel _lbl = (ASPxLabel)this.dxgridDeliveries.FindRowTemplateControl(e.VisibleIndex, "dxlblCurrentStatusID");
                    if (_lbl != null) { _lbl.Text = _f; }
                }

                //modify javascript on button click so we can drop dll sub decks into hidden field to pass onto edit form
                //will save making a callback to the server 
                ASPxButton _btn = (ASPxButton)this.dxgridDeliveries.FindRowTemplateControl(e.VisibleIndex, "dxbtnEdit");
                if (_btn != null)
                {
                    _s += "|" + _f;
                    _btn.ClientSideEvents.Click = "function(s, e) { hfOrder.Set(\"subdecks\",\"" + _s + "\"); gridDeliveries.StartEditRow(" + e.VisibleIndex.ToString() + "); }"; //gridDeliveries.StartEditRow(' + Container.VisibleIndex + ')

                }

            }//end data template
        }
        catch (Exception ex)
        {
            this.dxlblErr.Text = ex.Message.ToString();
            this.dxpnlErr.ClientVisible = true;
        }
    }//end html row prepared
 protected void gvSenaraiStok_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridViewTableDataCellEventArgs e)
 {
     switch (e.DataColumn.FieldName)
     {
         //case "LPD_EmpId": FormDeleteLink(e.DataColumn.FieldName, e.VisibleIndex, e.CellValue); break;
         case "PhysicalBalance": FormPerananCombo(e.DataColumn.FieldName, e.VisibleIndex, e.CellValue, e.GetValue("StockId").ToString()); break;
     }
 }
Esempio n. 15
0
 private string getFullNodePathHyphen(DevExpress.XtraTreeList.Nodes.TreeListNode theNode)
 {
     string theName = "";
     if (theNode.Level != 0)
     {
         theName = getFullNodePathHyphen(theNode.ParentNode) + "-";
     }
     theName = theName + (string)theNode.GetValue(0);
     return theName;
 }
 private void ASPxTreeList_ViTri_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxTreeList.TreeListHtmlDataCellEventArgs e)
 {
     if (Object.Equals(e.GetValue("loai"), typeof(PTB.Entities.Phong).Name))
         e.Cell.Font.Bold = true;
 }
Esempio n. 17
0
 protected void grdDailyJobs_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.RowType != GridViewRowType.Data) return;
     var jobType = (JobType)Convert.ToInt32(e.GetValue("Job.JobType"));
     if (jobType == JobType.Manual && e.Row.Cells.Count> 1)
     {
         var scheduledStartExecutionDate = Convert.ToDateTime(e.GetValue("ScheduledStartExecutionDate"));
         e.Row.Cells[6].Text = scheduledStartExecutionDate.ToString("dd/MM/yyyy");
     }
 }
Esempio n. 18
0
        protected void grvExport_RenderBrick(object sender, DevExpress.Web.ASPxGridViewExportRenderingEventArgs e)
        {
            GridViewDataColumn dataColumn = e.Column as GridViewDataColumn;
            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 7)
            {
                if (e.GetValue("Serials") != null)
                {
                    string strSerials = e.GetValue("Serials").ToString();
                    if (!string.IsNullOrEmpty(strSerials))
                    {
                        strSerials = Commons.Common.FormatSerial(strSerials.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList());
                    }

                    e.TextValue = strSerials;
                }
                else
                {
                    e.TextValue = string.Empty;
                }
            }

            dataColumn = e.Column as GridViewDataColumn;
            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 9)
            {
                string strCoCode = e.GetValue("CO_CODE").ToString();
                if (strCoCode != string.Empty)
                {
                    using (DataModel.COMPANY_BO objT24_COMPANY_BO = new DataModel.COMPANY_BO())
                    {
                        DataModel.COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(strCoCode);
                        if (objT24_COMPANY != null)
                        {
                            e.TextValue = objT24_COMPANY.COMPANY_NAME;
                        }
                    }
                }
            }

            dataColumn = e.Column as GridViewDataColumn;
            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 10)
            {
                if (e.GetValue("IsUsed") != null)
                {
                    bool strStatus = Convert.ToBoolean(e.GetValue("IsUsed"));

                    if (strStatus)
                    {
                        e.TextValue = "Đã cấp mã";
                    }
                    else
                    {
                        e.TextValue = "Đã xóa";
                    }
                }
                else
                {
                    e.TextValue = "Đã cấp mã";
                }
            }
        }
Esempio n. 19
0
 protected void gridViewReports_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data) return;
     switch (Convert.ToInt32(e.GetValue("significance")))
             {
                 case 1:
                     {
                         e.Row.BackColor = Color.SandyBrown;
                         break;
                     }
                 case 2:
                     {
                         e.Row.BackColor = Color.Salmon;
                         break;
                     }
             }
 }
        protected void gdvAgenda_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data)
                return;

            if (e.GetValue("Nome").Equals("Horário Bloqueado"))
            {
                e.Row.ForeColor =  Color.LightBlue;
            }
        }
    protected void tree_ORG_HtmlRowPrepared(object sender, DevExpress.Web.ASPxTreeList.TreeListHtmlRowEventArgs e)
    {
        ASPxTreeList tree = sender as ASPxTreeList;
        ImageButton imgAdd = tree.FindDataCellTemplateControl(e.NodeKey, tree.Columns["Insertable"] as TreeListDataColumn, "imgAdd") as ImageButton;
        ImageButton imgEdit = tree.FindDataCellTemplateControl(e.NodeKey, tree.Columns["Insertable"] as TreeListDataColumn, "imgEdit") as ImageButton;

        if (update_flag == "false" && insert_flag == "false") { }
        else
        {

            if (update_flag == "false") // กรณีไม่มีสิทธิ์ แก้ไข   ซ่อนปุ่มปากกา
            {
                if (Object.Equals(e.GetValue("Insertable"), false))
                    imgEdit.Visible = false;
            }

            if (insert_flag == "false") // กรณีไม่มีสิทธิ์ เพิ่ม   ซ่อนปุ่มบวก
            {
                if (Object.Equals(e.GetValue("Insertable"), true))
                    imgAdd.Visible = false;
            }
        }
    }
Esempio n. 22
0
        /// <summary>
        /// 遍历选择拖动的菜单ID
        /// </summary>
        /// <param name="node">选择的菜单节点</param>
        /// <returns></returns>
        private string GetNodesID(DevExpress.XtraTreeList.Nodes.TreeListNode node)
        {
            //如果本节点有父节点,那么也一起选择进来,先找父节点,再找本节点,再找下面的子节点
            GetNodesParentID(node);
            if (!MenuSelectResult.Contains(node.GetValue("ID").ToString()))
            {
                MenuSelectResult += node.GetValue("ID").ToString() + ",";
                LMenuID.Add(node.GetValue("ID").ToString());
                LMenuName.Add(node.GetValue("sMenuName").ToString());
                LMenuParentID.Add(node.GetValue("iParentID").ToString());
            }

            //遍历当前节点下面所有的菜单,也一起选择
            foreach (DevExpress.XtraTreeList.Nodes.TreeListNode n in node.Nodes)
            {
                MenuSelectResult += n.GetValue("ID").ToString() + ",";
                LMenuID.Add(n.GetValue("ID").ToString());
                LMenuName.Add(n.GetValue("sMenuName").ToString());
                LMenuParentID.Add(n.GetValue("iParentID").ToString());
                if (n.HasChildren)
                {
                    GetNodesID(n);
                }
            }
            return MenuSelectResult.Substring(0, MenuSelectResult.Length - 1);
        }
Esempio n. 23
0
        protected void grvExport_RenderBrick(object sender, DevExpress.Web.ASPxGridViewExportRenderingEventArgs e)
        {
            GridViewDataColumn dataColumn = e.Column as GridViewDataColumn;
            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 8)
            {
                string strCoCode = e.GetValue("CoCode").ToString();
                if (strCoCode != string.Empty)
                {
                    using (COMPANY_BO objT24_COMPANY_BO = new COMPANY_BO())
                    {
                        COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(strCoCode);
                        if (objT24_COMPANY != null)
                        {
                            e.TextValue = objT24_COMPANY.COMPANY_NAME;
                        }
                    }
                }
            }

            dataColumn = e.Column as GridViewDataColumn;
            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 9)
            {
                if (e.GetValue("IsUsed") != null)
                {
                    bool strStatus = Convert.ToBoolean(e.GetValue("IsUsed"));

                    if (strStatus)
                    {
                        e.TextValue = "Đã cấp";
                    }
                    else
                    {
                        e.TextValue = "Đã xóa";
                    }
                }
                else
                {
                    e.TextValue = "Đã cấp";
                }
            }
        }
 protected void gridClaimRequests_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridViewTableDataCellEventArgs e)
 {
     string value = e.GetValue("status").ToString();
     if (value == "Pending")
         e.Cell.ForeColor = System.Drawing.Color.Red;
 }
    //end grid call back
    /// <summary>
    /// javascript added to rows on the fly so we can track what has been ticked
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void dxgdvOrder_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
    {
        if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Data)
        {
            DevExpress.Web.ASPxGridView.ASPxGridView _grid = (DevExpress.Web.ASPxGridView.ASPxGridView)sender;
            //string _hfKey = "key" + e.KeyValue.ToString(); //this seems to be problematic (string too big for key??)
            //string _hfKey = "key" + e.GetValue("OrderID").ToString();
            string _hfKey = "orderidkey";

            //find order id
            //string _test = e.GetValue("OrderID").ToString();

            //find template controls
            DevExpress.Web.ASPxGridView.GridViewDataColumn _col1 = (DevExpress.Web.ASPxGridView.GridViewDataColumn)_grid.Columns["chkcustom"];
            DevExpress.Web.ASPxEditors.ASPxCheckBox _chk = (DevExpress.Web.ASPxEditors.ASPxCheckBox)_grid.FindRowCellTemplateControl(e.VisibleIndex, _col1, "dxchktick");
            //var _chk = (DevExpress.Web.ASPxGridView.Rendering.GridViewTableCommandCell)e.Row.Cells[0]; 
            //and pass data from hidden field if it's stored - make sure text box is ticked
            if (_chk != null)
            {
                _chk.ClientSideEvents.CheckedChanged = "function(s,e){rowTicked(" + e.GetValue("OrderID") + "," + e.GetValue("OrderNumber") + ");}";

                if (this.dxhfsource.Contains(_hfKey))
                {
                    if (this.dxhfsource.Get("orderidkey").ToString() == e.GetValue("OrderID").ToString()) { _chk.Checked = true; }

                }

            }
        }
    }