Exemple #1
0
    //protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
    //{
    //    if (e.Row.RowType == GridRowType.DataRow)
    //    {
    //    }
    //}

    protected void Grid2_RowDataBound(object sender, GridRowEventArgs e)
    {
        if (e.Row.RowType == GridRowType.DataRow)
        {
            int numcols = Grid2.Columns.Count;

            for (int m = num_cols_before_FTE; m < numcols; m++)
            {
                double fte;

                if (Double.TryParse(e.Row.Cells[m].Text, out fte))
                {
                    string rowlabel = e.Row.Cells[1].Text;
                    if (fte > 1.0 & rowlabel != "**TOTALS**")
                    {
                        e.Row.Cells[m].BackColor = System.Drawing.Color.Red;
                        //e.Row.Cells[m].CssClass = "excel-textbox-toobig";
                    }
                    if (rowlabel == "**TOTALS**")
                    {
                        e.Row.Cells[m].Font.Bold = true;
                    }
                }
            }
        }
    }
Exemple #2
0
        /// <summary>
        /// 绑定下拉菜单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            System.Web.UI.WebControls.Label news_state = (System.Web.UI.WebControls.Label)Grid1.Rows[e.RowIndex].FindControl("news_state");

            DataRowView row   = e.DataItem as DataRowView;
            int         state = Convert.ToInt32(row["C_ArticleCategory"]);

            switch (state)
            {
            case 1:
                news_state.Text = "中心概况";
                break;

            case 2:
                news_state.Text = "中心动态";
                break;

            case 3:
                news_state.Text = "心协动态";
                break;

            case 4:
                news_state.Text = "咨询师简介";
                break;

            case 5:
                news_state.Text = "心灵驿站";
                break;

            default:
                break;
            }
        }
        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            System.Web.UI.WebControls.DropDownList ddlGender = (System.Web.UI.WebControls.DropDownList)Grid1.Rows[e.RowIndex].FindControl("ddlGender");

            List <string> genderList = new List <string>();

            genderList.Add("男");
            genderList.Add("女");
            ddlGender.DataSource = genderList;
            ddlGender.DataBind();


            DataRowView row = e.DataItem as DataRowView;

            int gender = Convert.ToInt32(row["Gender"]);

            if (gender == 1)
            {
                ddlGender.SelectedValue = "男";
            }
            else
            {
                ddlGender.SelectedValue = "女";
            }
        }
Exemple #4
0
        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            DataRowView row = e.DataItem as DataRowView;

            // 入学年份
            string     yen  = row["完成情况"].ToString();
            BoundField cyen = Grid1.FindColumn("完成情况") as BoundField;

            if (yen == "正在进行")
            {
                e.CellAttributes[cyen.ColumnIndex]["data-color"] = "color3";
            }
            else if (yen == "完成")
            {
                e.CellAttributes[cyen.ColumnIndex]["data-color"] = "color2";
            }


            // 性别
            //int gender = Convert.ToInt32(row["Gender"]);
            //TemplateField cGender = Grid1.FindColumn("cGender") as TemplateField;
            //if (gender == 1)
            //{
            //    e.CellAttributes[cGender.ColumnIndex]["data-color"] = "color1";
            //}
        }
        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            Infobasis.Data.DataEntity.Client client = e.DataItem as Infobasis.Data.DataEntity.Client;
            DateTime?lastTraceDate = Convert.ToDateTime(client.LastTraceDate);

            FineUIPro.BoundField bfTraceNum = Grid1.FindColumn("bfTraceNum") as FineUIPro.BoundField;
            int columnIndexTraceNum         = bfTraceNum.ColumnIndex;
            int lastTraceDays = Infobasis.Web.Util.DateHelper.GetClientTraceDays(lastTraceDate, DateTime.Now);

            e.Values[columnIndexTraceNum] = String.Format("<span class=\"{0}\" data-qtip=\"{4}\">{1}-{2}-{3}</span>",
                                                          lastTraceDays >= 10 || lastTraceDays == 0 ? "traceWarning" : "traceNormal",
                                                          Change.ToInt(lastTraceDays), 0, 0,
                                                          string.Format("最后跟进已过:{0} 天", lastTraceDays));

            FineUIPro.WindowField wfdisableClientField = Grid1.FindColumn("disableClientField") as FineUIPro.WindowField;
            if (client.Disabled.HasValue && client.Disabled.Value)
            {
                int columnIndexDisabled = wfdisableClientField.ColumnIndex;
                e.Values[columnIndexDisabled] = "<a class=\"ui-state-disabled\" disabled=\"disabled\" data-qtip=\"废单\">已废单</a>";

                FineUIPro.WindowField changeToNextField = Grid1.FindColumn("changeToNextField") as FineUIPro.WindowField;
                int columnIndexToNext = changeToNextField.ColumnIndex;
                e.Values[columnIndexToNext] = "";
            }
        }
 protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
 {
     if (!string.IsNullOrEmpty(Grid1.Rows[e.RowIndex].Values[22].ToString()))
     {
         e.RowCssClass = "color1";
     }
 }
Exemple #7
0
    public void grid2_RowDataBound(object sender, GridRowEventArgs e)
    {
        Grid detail = sender as Grid;

        if (!details.ContainsKey(detail.ID))
        {
            details.Add(detail.ID, detail);
        }

        if (e.Row.RowType == GridRowType.DataRow && detail.RowsInViewState.Count > 0)
        {
            if (detail.RowsInViewState.Count > e.Row.RowIndex)
            {
                for (int i = 1; i < e.Row.Cells.Count; i++)
                {
                    GridDataControlFieldCell cell = e.Row.Cells[i] as GridDataControlFieldCell;
                    TextBox textBox = cell.FindControl("TextBox1") as TextBox;

                    GridDataControlFieldCell cellInViewState = detail.RowsInViewState[e.Row.RowIndex].Cells[i] as GridDataControlFieldCell;
                    TextBox textBoxInViewState = cellInViewState.FindControl("TextBox1") as TextBox;

                    textBox.Text = textBoxInViewState.Text;
                }
            }
        }
    }
Exemple #8
0
 protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
 {
     //System.Web.UI.WebControls.Label lblZtmc = Grid1.Rows[e.RowIndex].FindControl("lblZtmc") as System.Web.UI.WebControls.Label;
     //string zt = lblZtmc.Text;
     //switch (zt)
     //{
     //    //case "未提交":
     //    //case "重写中":
     //    //case "修改中":
     //    //    lblZtmc.ForeColor = Color.Black;
     //    //    break;
     //    case "未评阅":
     //        lblZtmc.ForeColor = Color.Blue;
     //        break;
     //    case "退回重写":
     //    case "退回修改":
     //        lblZtmc.ForeColor = Color.Red;
     //        break;
     //    case "评阅通过":
     //    case "已归档":
     //    default:
     //        lblZtmc.ForeColor = Color.Green;
     //        break;
     //}
 }
Exemple #9
0
        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            var item = e.DataItem as LHPassCard;

            if (item != null)
            {
                if (item.FAuditFlag == 0)
                {
                    for (int i = 0; i < e.Values.Length; i++)
                    {
                        if (!e.Values[i].ToString().Contains("#@TPL@"))
                        {
                            e.Values[i] = String.Format("<span class=\"{0}\">{1}</span>", "colorcoral", e.Values[i].ToString().Contains("#@TPL@") ? "已作废" : e.Values[i]);
                        }
                    }
                }

                if (item.FAuditFlag == 1)
                {
                    for (int i = 0; i < e.Values.Length; i++)
                    {
                        if (!e.Values[i].ToString().Contains("#@TPL@"))
                        {
                            e.Values[i] = String.Format("<span class=\"{0}\">{1}</span>", "colorgreen", e.Values[i].ToString().Contains("#@TPL@") ? "已作废" : e.Values[i]);
                        }
                    }
                }
            }
        }
Exemple #10
0
        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            //Label lblZtmc = Grid1.Rows[e.RowIndex].FindControl("lblZtmc") as Label;
            //string zt = lblZtmc.Text;
            //switch (zt)
            //{
            //    case "未提交":
            //        lblZtmc.ForeColor = Color.Black;
            //        break;
            //    case "已提交":
            //        lblZtmc.ForeColor = Color.Blue;
            //        break;
            //    case "审核通过":
            //    case "公示中":
            //    case "已归档":
            //        lblZtmc.ForeColor = Color.Green;
            //        break;
            //    case "已删除":
            //    case "审核拒绝":
            //    case "退回修改":
            //    default:
            //        lblZtmc.ForeColor = Color.Red;
            //        break;
            //}

            //HyperLink lblXmmc = Grid1.Rows[e.RowIndex].FindControl("lblXmmc") as HyperLink;
            //lblXmmc.Attributes["onclick"] = wndYjView.GetShowReference(String.Format("ShowGryj.aspx?id={0}", Grid1.DataKeys[e.RowIndex][0].ToString()), "弹出窗-历年业绩浏览");
        }
Exemple #11
0
        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            System.Web.UI.WebControls.Label lblZtmc = Grid1.Rows[e.RowIndex].FindControl("lblZtmc") as System.Web.UI.WebControls.Label;
            string zt = lblZtmc.Text;

            switch (zt)
            {
            case "未提交":
            case "重写中":
            case "修改中":
                lblZtmc.ForeColor = Color.Black;
                break;

            case "已提交":
                lblZtmc.ForeColor = Color.Blue;
                break;

            case "退回重写":
            case "退回修改":
            case "已删除":
            case "已重写":
            case "已修改":
                lblZtmc.ForeColor = Color.Red;
                break;

            case "评阅通过":
            case "已归档":
            default:
                lblZtmc.ForeColor = Color.Green;
                break;
            }
        }
Exemple #12
0
        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            System.Web.UI.WebControls.Label lblZtmc = Grid1.Rows[e.RowIndex].FindControl("lblZtmc") as System.Web.UI.WebControls.Label;
            string zt = lblZtmc.Text;

            switch (zt)
            {
            case "未提交":
                lblZtmc.ForeColor = Color.Black;
                break;

            case "已提交":
                lblZtmc.ForeColor = Color.Blue;
                break;

            case "已删除":
            case "审核拒绝":
            case "退回修改":
                lblZtmc.ForeColor = Color.Red;
                break;

            case "审核通过":
            case "已归档":
            default:
                lblZtmc.ForeColor = Color.Green;
                break;
            }

            System.Web.UI.WebControls.HyperLink lblXmmc = Grid1.Rows[e.RowIndex].FindControl("lblXmmc") as System.Web.UI.WebControls.HyperLink;
            lblXmmc.Attributes["onclick"] = wndView.GetShowReference(String.Format("XmsbEdit.aspx?pkid={0}", Grid1.DataKeys[e.RowIndex][0].ToString()), "弹出窗-浏览");
        }
Exemple #13
0
        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            LHStockIn item = e.DataItem as LHStockIn;

            if (item != null)
            {
                if (item.FFlag == 0)
                {
                    for (int i = 0; i < e.Values.Length; i++)
                    {
                        if (!e.Values[i].ToString().Contains("#@TPL@"))
                        {
                            e.Values[i] = string.Format("<span class=\"{0}\">{1}</span>", "colorred", e.Values[i].ToString().Contains("#@TPL@") ? "已作废" : e.Values[i]);
                        }
                    }
                }

                IQueryable <LHStockInDetails> stockInDetails = new StockInDetailsService().Where(p => p.KeyId == item.KeyId && p.FMemo != "");
                IQueryable <string>           fmeno          = from x in stockInDetails
                                                               select x.FMemo;
                if (!string.IsNullOrWhiteSpace(item.FMemo))
                {
                    e.Values[15] = item.FMemo + "," + string.Join(",", fmeno.ToList());
                }
                else
                {
                    e.Values[15] = string.Join(",", fmeno.ToList());
                }
            }
        }
Exemple #14
0
 protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
 {
     if (Grid1.Rows[e.RowIndex].Values[18].ToString().Equals("1"))
     {
         e.RowCssClass = "color1";
     }
 }
        //-------------- для высвечивания анализа при подводе курсора ----------------------------------------------------------
        protected void OnRowDataBound_Handle(Object o, GridRowEventArgs e)
        {
            e.Row.Cells[0].Attributes["onmouseover"] = "this.style.fontSize = '16px'; this.style.fontWeight = 'bold';";
            e.Row.Cells[0].Attributes["onmouseout"]  = "this.style.fontSize = '12px';this.style.fontWeight = 'normal';";
            e.Row.Cells[0].Attributes.Add("onclick", "onClick(" + e.Row.RowIndex + ",0)");

            e.Row.Cells[7].Attributes["onmouseover"] = "this.style.fontSize = '16px'; this.style.fontWeight = 'bold';";
            e.Row.Cells[7].Attributes["onmouseout"]  = "this.style.fontSize = '12px'; this.style.fontWeight = 'normal';";
            e.Row.Cells[7].Attributes.Add("onclick", "onClick(" + e.Row.RowIndex + ",7)");

            e.Row.Cells[8].Attributes["onmouseover"] = "this.style.fontSize = '16px'; this.style.fontWeight = 'bold';";
            e.Row.Cells[8].Attributes["onmouseout"]  = "this.style.fontSize = '12px'; this.style.fontWeight = 'normal';";
            e.Row.Cells[8].Attributes.Add("onclick", "onClick(" + e.Row.RowIndex + ",8)");


            /*
             * if (args.Row.Cells[4].Text == "USA" || args.Row.Cells[4].Text == "Denmark" || args.Row.Cells[4].Text == "Germany")
             * {
             *  for (int i = 1; i < args.Row.Cells.Count; i++)
             *  {
             *      args.Row.Cells[i].BackColor = System.Drawing.Color.DarkGray;
             *  }
             * }
             */
        }
Exemple #16
0
        protected void gvList_RowDataBound(object sender, GridRowEventArgs e)
        {
            if (e.DataItem != null)
            {
                string result = gvList.Rows[e.RowIndex].Values[2].ToString();
                if (result == "0")
                {
                    gvList.Rows[e.RowIndex].Values[2] = "正常";
                }
                else
                {
                    gvList.Rows[e.RowIndex].Values[2] = "异常";
                }

                string hlflag = gvList.Rows[e.RowIndex].Values[4].ToString();
                if (hlflag == "H")
                {
                    gvList.Rows[e.RowIndex].Values[4] = "↑";
                }
                else if (hlflag == "L")
                {
                    gvList.Rows[e.RowIndex].Values[4] = "↓";
                }
            }
        }
    public void RowDataBound(object sender, GridRowEventArgs e)
    {
        if (e.Row.RowType == GridRowType.DataRow)
        {
            if (lastGroupHeader != null)
            {
                Literal textContainer = lastGroupHeader.Cells[0].Controls[0].Controls[lastGroupHeader.Cells[0].Controls[0].Controls.Count - 1].Controls[0] as Literal;
                textContainer.Text = ((GridDataControlFieldCell)e.Row.Cells[2]).Text;

                textContainer.Text += "&#160;&#187;&#160;";

                HyperLink link = new HyperLink();
                link.CssClass = "header-link";
                link.Attributes["onclick"] = "alert('In a real application the category form should open.')";
                link.NavigateUrl           = "aspnet_grouping_custom_headers.aspx?CategoryID=" + ((GridDataControlFieldCell)e.Row.Cells[1]).Text;
                link.Text = "Edit Category";

                textContainer.Parent.Controls.Add(link);

                lastGroupHeader = null;
            }
        }
        else if (e.Row.RowType == GridRowType.GroupHeader)
        {
            if (e.Row.GroupLevel == 0)
            {
                lastGroupHeader = e.Row;
            }
        }
    }
Exemple #18
0
        //行绑定
        protected void GridTest_RowDataBound(object sender, GridRowEventArgs e)
        {
            OrderRegister _register = e.DataItem as OrderRegister;

            e.Values[3] = _register.IsGroup ? "组合" : "项目";
            e.Values[4] = _register.Isactive == "1" ? "正常" : "已停测试";
        }
        // ---------Суммация  ------------------------------------------------------------------------
        public void SumDoc(object sender, GridRowEventArgs e)
        {
            if (e.Row.RowType == GridRowType.DataRow)
            {
                if (e.Row.Cells[5].Text == null | e.Row.Cells[5].Text == "")
                {
                    ItgDocKol += 0;
                }
                else
                {
                    ItgDocKol += decimal.Parse(e.Row.Cells[5].Text);
                }

                if (e.Row.Cells[6].Text == null | e.Row.Cells[6].Text == "")
                {
                    ItgDocSum += 0;
                }
                else
                {
                    ItgDocSum += decimal.Parse(e.Row.Cells[6].Text);
                }
            }
            else if (e.Row.RowType == GridRowType.ColumnFooter)
            {
                e.Row.Cells[4].Text = "Итого:";
                e.Row.Cells[5].Text = ItgDocKol.ToString();

                e.Row.Cells[6].Text = ItgDocSum.ToString();
            }
        }
Exemple #20
0
        /// <summary>
        /// 绑定下拉菜单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            //System.Web.UI.WebControls.Label news_state = (System.Web.UI.WebControls.Label)Grid1.Rows[e.RowIndex].FindControl("news_state");

            ////List<string> news_statelist = new List<string>();
            ////news_statelist.Add("头条新闻");
            ////news_statelist.Add("强调新闻");
            ////news_statelist.Add("普通新闻");
            ////news_state.DataSource = news_statelist;
            ////news_state.DataBind();


            //DataRowView row = e.DataItem as DataRowView;

            //int state = Convert.ToInt32(row["news_state"]);
            //if (state == 1)
            //{
            //    news_state.Text = "头条新闻";
            //}
            //else if (state == 2)
            //{
            //    news_state.Text = "强调新闻";
            //}
            //else
            //{
            //    news_state.Text = "普通新闻";
            //}
        }
Exemple #21
0
        /// <summary>
        /// 分组绑定右侧权限
        /// 修改人:金协民 2015年7月29日
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Grid2_RowDataBound(object sender, GridRowEventArgs e)
        {
            AspNet.CheckBoxList ddlPowers = (AspNet.CheckBoxList)Grid2.Rows[e.RowIndex].FindControl("ddlPowers");
            var             GroupName     = e.DataItem.GetType().GetProperty("GroupName").GetValue(e.DataItem, null);
            List <T_POWERS> T_POWERS_LIST = new List <T_POWERS>();
            var             query         = new DapperExQuery <T_POWERS>().AndWhere(n => n.GROUP_NAME, OperationMethod.Equal, GroupName);

            T_POWERS_LIST = T_POWERS_BLL.GetAllList(query);
            foreach (var po in T_POWERS_LIST)
            {
                AspNet.ListItem item = new AspNet.ListItem
                {
                    Value = po.P_CODE.ToString(),
                    Text  = string.Format("{0}({1})", po.P_CHINESE_NAME, po.P_NAME)
                };
                item.Attributes["data-qtip"] = po.P_NAME;
                if (_currentRolePowers.ContainsKey(po.P_NAME))
                {
                    item.Selected = true;
                }
                else
                {
                    item.Selected = false;
                }
                ddlPowers.Items.Add(item);
            }
        }
    public void RowDataBound(object sender, GridRowEventArgs e)
    {
        if (e.Row.RowType == GridRowType.DataRow)
        {
            if (lastGroupHeader != null)
            {
                Literal textContainer = lastGroupHeader.Cells[0].Controls[0].Controls[lastGroupHeader.Cells[0].Controls[0].Controls.Count - 1].Controls[0] as Literal;
                textContainer.Text = ((GridDataControlFieldCell)e.Row.Cells[2]).Text;

                textContainer.Text += "&#160;&#187;&#160;";

                HyperLink link = new HyperLink();
                link.CssClass = "header-link";
                link.Attributes["onclick"] = "alert('In a real application the category form should open.')";
                link.NavigateUrl = "aspnet_grouping_custom_headers.aspx?CategoryID=" + ((GridDataControlFieldCell)e.Row.Cells[1]).Text;
                link.Text = "Edit Category";

                textContainer.Parent.Controls.Add(link);

                lastGroupHeader = null;
            }            
            
        }
        else if (e.Row.RowType == GridRowType.GroupHeader)
        {
            if (e.Row.GroupLevel == 0)
            {
                lastGroupHeader = e.Row;
            }
        }
        
    }
Exemple #23
0
        protected void GridGoods_RowDataBound(object sender, GridRowEventArgs e)
        {
            DataRowView row = e.DataItem as DataRowView;

            if (row != null)
            {
                string flag = row["FLAG"].ToString();
                FineUIPro.BoundField flagcol = GridGoods.FindColumn("FLAGNAME") as FineUIPro.BoundField;
                if (flag != "Y" && flag != "R")
                {
                    foreach (GridColumn column in GridGoods.Columns)
                    {
                        e.CellAttributes[flagcol.ColumnIndex]["data-color"] = "f-grid-cell-uneditable";
                    }
                }
                if (flag == "C")
                {
                    e.CellAttributes[flagcol.ColumnIndex]["data-color"] = "color1";
                }
                if (flag == "Y")
                {
                    e.CellAttributes[flagcol.ColumnIndex]["data-color"] = "color2";
                }
                if (flag == "R")
                {
                    e.CellAttributes[flagcol.ColumnIndex]["data-color"] = "color3";
                }
            }
        }
 protected void grdCie10_RowDataBound(object sender, GridRowEventArgs e)
 {
     Sigesoft.Node.WinClient.BE.DxFrecuenteList row = (Sigesoft.Node.WinClient.BE.DxFrecuenteList)e.DataItem;
     if (row.v_DxFrecuenteId != null)
     {
         highlightRows.Text += e.RowIndex.ToString() + ",";
     }
 }
 protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
 {
     //DataRowView dr = e.DataItem as DataRowView;
     //if (dr != null)
     //{
     //    string strPublishDate = dr["PublishDate"].ToString();
     //    e.Values[3] = Conver_DateFormat(strPublishDate);
     //}
 }
Exemple #26
0
        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            var orgnization = e.DataItem as LHProjectItems;

            if (orgnization != null)
            {
                e.Values[4] = e.Values[4].ToString() == "1" ? "启用" : "禁用";
            }
        }
Exemple #27
0
        protected void Grid3_RowDataBound(object sender, GridRowEventArgs e)
        {
            var item = e.DataItem as LHDispatchCenter;

            if (item != null)
            {
                //if (item.FFlag == 0)
                //{
                //    for (int i = 0; i < e.Values.Length; i++)
                //    {
                //        if (!e.Values[i].ToString().Contains("#@TPL@"))
                //            e.Values[i] = String.Format("<span class=\"{0}\">{1}</span>", "colorred", e.Values[i].ToString().Contains("#@TPL@") ? "已作废" : e.Values[i]);
                //    }
                //}

                //if (item.FAuditFlag == 0)
                //{
                //    for (int i = 0; i < e.Values.Length; i++)
                //    {
                //        if (!e.Values[i].ToString().Contains("#@TPL@"))
                //            e.Values[i] = String.Format("<span class=\"{0}\">{1}</span>", "colorcoral", e.Values[i].ToString().Contains("#@TPL@") ? "已作废" : e.Values[i]);
                //    }
                //}

                if (item.FAuditFlag == 1)
                {
                    //if (item.FStatus == 50)
                    //{
                    for (int i = 0; i < e.Values.Length; i++)
                    {
                        if (!e.Values[i].ToString().Contains("#@TPL@"))
                        {
                            e.Values[i] = String.Format("<span class=\"{0}\">{1}</span>", "colorgreen", e.Values[i].ToString().Contains("#@TPL@") ? "已作废" : e.Values[i]);
                        }
                    }
                    //}
                    //else
                    //{
                    //    for (int i = 0; i < e.Values.Length; i++)
                    //    {
                    //        if (!e.Values[i].ToString().Contains("#@TPL@"))
                    //            e.Values[i] = String.Format("<span class=\"{0}\">{1}</span>", "colorgreen", e.Values[i].ToString().Contains("#@TPL@") ? "已作废" : e.Values[i]);
                    //    }
                    //}
                }
                else if (item.FAuditFlag == 1)
                {
                    for (int i = 0; i < e.Values.Length; i++)
                    {
                        if (!e.Values[i].ToString().Contains("#@TPL@"))
                        {
                            e.Values[i] = String.Format("<span class=\"{0}\">{1}</span>", "colorred", e.Values[i].ToString().Contains("#@TPL@") ? "已作废" : e.Values[i]);
                        }
                    }
                }
            }
        }
Exemple #28
0
        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            DataRowView dr = e.DataItem as DataRowView;

            if (dr != null)
            {
                string strIsInner = dr["IsInner"].ToString();
                e.Values[0] = Get_RegionName(strIsInner);
            }
        }
Exemple #29
0
        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            DataRowView dr = e.DataItem as DataRowView;

            if (dr != null)
            {
                string strReplyUserGUID = dr["ReplyUserGUID"].ToString();
                e.Values[3] = Get_PublishName(strReplyUserGUID);
            }
        }
Exemple #30
0
        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            DataRowView dr = e.DataItem as DataRowView;

            if (dr != null)
            {
                string strCareersTypeID = dr["DictionaryKey"].ToString();
                e.Values[0] = Conver_CareersType(strCareersTypeID);
            }
        }
        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            DataRowView dr = e.DataItem as DataRowView;

            if (dr != null)
            {
                string strJobCategoryGUID = dr["JobCategoryGUID"].ToString();
                e.Values[1] = Get_JobCategoryName(strJobCategoryGUID);
            }
        }
    protected void OnGridRowDataBound(object sender, GridRowEventArgs args)
    {
        args.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
        args.Row.Cells[0].BackColor = System.Drawing.Color.LightGray;

        if (args.Row.Cells[4].Text == "USA" || args.Row.Cells[4].Text == "Denmark" || args.Row.Cells[4].Text == "Germany")
        {
            for (int i = 1; i < args.Row.Cells.Count; i++)
            {
                args.Row.Cells[i].BackColor = System.Drawing.Color.DarkGray;
            }
        }
            
    }
    public void grid1_RowDataBound(object sender, GridRowEventArgs e)
    {
        if (e.Row.RowType == GridRowType.DataRow && Grid1.RowsInViewState.Count > 0)
        {
            if (Grid1.RowsInViewState.Count > e.Row.RowIndex)
            {
                for (int i = 1; i < e.Row.Cells.Count; i++)
                {
                    GridDataControlFieldCell cell = e.Row.Cells[i] as GridDataControlFieldCell;
                    TextBox textBox = cell.FindControl("TextBox1") as TextBox;

                    GridDataControlFieldCell cellInViewState = Grid1.RowsInViewState[e.Row.RowIndex].Cells[i] as GridDataControlFieldCell;
                    TextBox textBoxInViewState = cellInViewState.FindControl("TextBox1") as TextBox;

                    textBox.Text = textBoxInViewState.Text;
                }
            }
        }
    }
    public void RowDataBound(object sender, GridRowEventArgs e)
    {
        if (e.Row.RowType == GridRowType.DataRow)
        {
            tempTotalPrice += double.Parse(e.Row.Cells[3].Text);
            tempUnitsInStock += int.Parse(e.Row.Cells[4].Text);
            tempUnitsOnOrder += int.Parse(e.Row.Cells[5].Text);
            tempRowCounter++;
        }
        else if (e.Row.RowType == GridRowType.GroupHeader)
        {
            //Literal textContainer = e.Row.Cells[0].Controls[0].Controls[1].Controls[0] as Literal;
            if (!lastGroupHeaders.ContainsKey(e.Row.GroupLevel))
            {
                lastGroupHeaders.Add(e.Row.GroupLevel, null);
            }

            lastGroupHeaders[e.Row.GroupLevel] = e.Row;
        }
        else if (e.Row.RowType == GridRowType.GroupFooter)
        {
            if (e.Row.GroupLevel > 0)
            {
                for (int level = e.Row.GroupLevel - 1; level >= 0; level--)
                {
                    if (!totalPrices.ContainsKey(level))
                    {
                        totalPrices.Add(level, 0);
                        unitsInStock.Add(level, 0);
                        unitsOnOrder.Add(level, 0);
                        rowCounter.Add(level, 0);
                    }

                    totalPrices[level] += tempTotalPrice;
                    unitsInStock[level] += tempUnitsInStock;
                    unitsOnOrder[level] += tempUnitsOnOrder;
                    rowCounter[level] += tempRowCounter;
                }
            }

            double priceToDisplay = 0;
            int unitsInStockToDisplay = 0;
            int unitsOnOrderToDisplay = 0;
            int rowCounterToDisplay = 0;
            
            if (totalPrices.ContainsKey(e.Row.GroupLevel))
            {
                priceToDisplay = totalPrices[e.Row.GroupLevel];
                unitsInStockToDisplay = unitsInStock[e.Row.GroupLevel];
                unitsOnOrderToDisplay = unitsOnOrder[e.Row.GroupLevel];
                rowCounterToDisplay = rowCounter[e.Row.GroupLevel];

                totalPrices[e.Row.GroupLevel] = 0;
                unitsInStock[e.Row.GroupLevel] = 0;
                unitsOnOrder[e.Row.GroupLevel] = 0;
                rowCounter[e.Row.GroupLevel] = 0;
            }
            else
            {
                priceToDisplay = tempTotalPrice;
                unitsInStockToDisplay = tempUnitsInStock;
                unitsOnOrderToDisplay = tempUnitsOnOrder;
                rowCounterToDisplay = tempRowCounter;
            }

            // Display information in Group header
            Literal textContainer = lastGroupHeaders[e.Row.GroupLevel].Cells[0].Controls[0].Controls[lastGroupHeaders[e.Row.GroupLevel].Cells[0].Controls[0].Controls.Count - 1].Controls[0] as Literal;
            textContainer.Text = "<div class='group-total'>" + textContainer.Text + "</div>";
            textContainer.Text += "<div class='group-total' style='margin-left: " + (147 - (23 * e.Row.GroupLevel)).ToString() + "px;'>Price: $" + priceToDisplay.ToString() + "</div>";
            textContainer.Text += "<div class='group-total' style='margin-left: " + (297 - (23 * e.Row.GroupLevel)).ToString() + "px;'>Units in Stock:  $" + unitsInStockToDisplay.ToString() + "</div>";
            textContainer.Text += "<div class='group-total' style='margin-left: " + (447 - (23 * e.Row.GroupLevel)).ToString() + "px;'>Units on Order:  $" + unitsOnOrderToDisplay.ToString() + "</div>";


            // Display information in Group footer            
            e.Row.Cells[2].Text = "Total (" + rowCounterToDisplay.ToString() + " item" + (rowCounterToDisplay > 1 ? "s" : "") + "):";
            e.Row.Cells[3].Text = "$" + priceToDisplay.ToString();
            e.Row.Cells[4].Text = unitsInStockToDisplay.ToString();
            e.Row.Cells[5].Text = unitsOnOrderToDisplay.ToString();

            tempTotalPrice = 0;
            tempUnitsInStock = 0;
            tempUnitsOnOrder = 0;
            tempRowCounter = 0;
        }
    }
Exemple #35
0
        protected void OnGridRowDataBound_desempeño(object sender, GridRowEventArgs args)
        {
            //string total_curso = "0";
            string calificacion_valores = "0";
            string calificacion_kpi = "";
            string descripcion_calificacion = "";
            string descripcion_ponderacion = "";
            string necesidades = "";
            string comentarios = "";
            string ptos = "";
            string necesidades_jefe = "";
            string comentarios_jefe = "";
            string ptos_jefe = "";
            string fecha_captura = "";
            string estatus = "";
            string id_banda = "";
            string id_eva = "";
            string noevaluacion = "";
            string calificacion_indicador = "";
            string calificacion_total_eva = "";
            string estatuseva = "";

            if (!String.IsNullOrEmpty(args.Row.Cells[0].Text))
            {
                string noemp = args.Row.Cells[0].Text;
                string evaluacion_emp = args.Row.Cells[1].Text;

                //para buscar la ultima calificacion de evaluacion
                //List<EntidadCalificacionEva> listaEva = negocioEva.ListaPlantilla();
                //if (listaEva == null)
                //{
                //    MensajeErrorFiltros(negocioEva.Log + "/ O no se encuentra la plantilla Actualizada");
                //    panel1.Visible = false;
                //    return;
                //}
                //else
                //{
                //    lbPlantilla.Text = listaEva[0].PlantillaEva.ToString();
                //}

                //para sacar plantilla del la evaluacion
                EntidadCalificacionEva entidadEvaluacionx = new EntidadCalificacionEva();
                entidadEvaluacionx.NoEmpleado = noemp;
                entidadEvaluacionx.Evaluacion = evaluacion_emp;
                List<EntidadCalificacionEva> listaporEva = negocioEva.ListaPlantillaporEvaluacion(entidadEvaluacionx, entidadEvaluacionx);
                if (listaporEva == null)
                {
                    MensajeErrorFiltros(negocioEva.Log + "/ O no se encuentra la plantilla de esa Evaluacion");
                    panel1.Visible = false;
                    return;
                }
                else
                {
                    lbPlantilla.Text = listaporEva[0].PlantillaEva.ToString();
                    noevaluacion = listaporEva[0].Evaluacion.ToString();
                }
                //======================================Estatus de las evaluaciones realizadas por el empleado==============
                //para obtener los comentarios del usuario y jefe sobre la evaluacion
                EntidadCalificacionEva entidadStatus = new EntidadCalificacionEva();
                entidadStatus.PlantillaEva = lbPlantilla.Text;
                entidadStatus.NoEmpleado = noemp;

                NegocioPlantillaEva negocioPEva = new NegocioPlantillaEva();
                DataTable DgEstatus = negocioPEva.BuscarEstatusActual(entidadStatus, entidadStatus);
                if (DgEstatus != null)
                {
                    if (DgEstatus.Rows.Count != 0)
                    {
                        foreach (DataRow filavalor in DgEstatus.Rows)
                        {
                            noevaluacion = filavalor["evaluacion"].ToString();
                            estatuseva = filavalor["d_estatus"].ToString();
                            lbPlantilla.Text = filavalor["id_plantilla"].ToString();


                //=========================================================================================================
                //para sacar puntaje de Indicadores
                EntidadCalificacionEva entidadEvaluacion = new EntidadCalificacionEva();

                entidadEvaluacion.PlantillaEva = lbPlantilla.Text;
                entidadEvaluacion.NoEmpleado = noemp;

                NegocioPlantillaEva negocioEvalaucion = new NegocioPlantillaEva();
                DataTable DgPuntajeIndicadores = negocioEvalaucion.BuscarPuntajeInd(entidadEvaluacion, entidadEvaluacion);
                if (DgPuntajeIndicadores != null)
                {
                    if (DgPuntajeIndicadores.Rows.Count != 0)
                    {
                        foreach (DataRow fila in DgPuntajeIndicadores.Rows)
                        {
                            //noemp.Text = fila["no_emp"].ToString();
                            noevaluacion = fila["evaluacion"].ToString();
                            calificacion_indicador = fila["totalpuntaje"].ToString();
                        }
                    }
                }
               
                //--------------para sacar el puntaje en seccion valores de la evaluacion de desempeño
                EntidadCalificacionEva entidadPuntajeVal = new EntidadCalificacionEva();
                entidadPuntajeVal.Evaluacion = noevaluacion;
                entidadPuntajeVal.PlantillaEva = lbPlantilla.Text;
                DataTable DgPuntajeValores = negocioEvalaucion.BuscarPuntajeVal(entidadPuntajeVal, entidadPuntajeVal);
                if (DgPuntajeValores != null)
                {
                    if (DgPuntajeValores.Rows.Count != 0)
                    {
                        foreach (DataRow filaval in DgPuntajeValores.Rows)
                        {
                            calificacion_valores = filaval["total_puntaje_val"].ToString();
                        }
                    }
                }

                //para obtener el valor general de la evaluacion con calificacion de Indicadores 
                EntidadCalificacionEva entidadPuntajeGral = new EntidadCalificacionEva();
                entidadPuntajeGral.CalificacionInd = calificacion_indicador;
                DataTable DgPuntajeIndicadoresLetra = negocioEvalaucion.BuscarPuntajeGeneral(entidadPuntajeGral);
                if (DgPuntajeIndicadoresLetra != null)
                {
                    if (DgPuntajeIndicadoresLetra.Rows.Count != 0)
                    {
                        foreach (DataRow filaval in DgPuntajeIndicadoresLetra.Rows)
                        {
                            calificacion_kpi = filaval["calificacion_kpi"].ToString();
                            descripcion_calificacion = filaval["descripcion_kpi"].ToString().ToUpper();
                        }
                    }
                }

                //para obtener la descripcion de los valores del puntaje obtenido 
                EntidadCalificacionEva entidadCalValores = new EntidadCalificacionEva();
                entidadCalValores.CalificacionVal = calificacion_valores;
                DataTable DgPuntajeValoresLetra = negocioEvalaucion.BuscarDescCalValores(entidadCalValores);
                if (DgPuntajeValoresLetra != null)
                {
                    if (DgPuntajeValoresLetra.Rows.Count != 0)
                    {
                        foreach (DataRow filaval in DgPuntajeValoresLetra.Rows)
                        {
                            descripcion_ponderacion = filaval["descripcion_pondera"].ToString();
                        }
                    }
                }

                //======================================================================================================
                //para obtener los comentarios del usuario y jefe sobre la evaluacion
                EntidadCalificacionEva entidadComentarios = new EntidadCalificacionEva();
                entidadComentarios.PlantillaEva = lbPlantilla.Text;
                entidadComentarios.NoEmpleado = noemp;

                DataTable DgComentarios = negocioEvalaucion.BuscarComentarios(entidadComentarios, entidadComentarios);
                if (DgComentarios != null)
                {
                    if (DgComentarios.Rows.Count != 0)
                    {
                        foreach (DataRow filaval in DgComentarios.Rows)
                        {
                            necesidades = filaval["necesidades"].ToString();
                            comentarios = filaval["comentarios"].ToString();
                            ptos = filaval["ptos_ftes"].ToString();

                            necesidades_jefe = filaval["necesidades_jefe"].ToString();
                            comentarios_jefe = filaval["comentarios_jefe"].ToString();
                            ptos_jefe = filaval["ptos_ftes_jefe"].ToString();
                            fecha_captura = filaval["fecha_captura"].ToString();
                            estatus = filaval["estatus"].ToString();
                            id_banda = filaval["id_banda_emp"].ToString();
                            id_eva = filaval["id_eva"].ToString();
                        }
                    }
                }
                //==================================================================================================
                //---para poner la calificacion general
                if ((calificacion_valores == ""))
                {
                    calificacion_total_eva = estatuseva;
                    args.Row.Cells[13].Text = estatuseva;
                    descripcion_ponderacion = "";
                    calificacion_kpi = "";
                    descripcion_calificacion = "";
                }
                else
                {

                    if ((Convert.ToInt32(calificacion_valores) >= 17) && ((Convert.ToInt32(calificacion_valores)) <= 22))
                    {
                        if (calificacion_kpi.Trim() == "A" || calificacion_kpi.Trim() == "B")
                        {
                            calificacion_total_eva = "CRITICO";
                        }
                        if (calificacion_kpi.Trim() == "C-" || calificacion_kpi.Trim() == "C")
                        {
                            calificacion_total_eva = "NECESITA CAPACITAR/ENTRENAR";
                        }
                        if (calificacion_kpi.Trim() == "C+" || calificacion_kpi.Trim() == "D")
                        {
                            calificacion_total_eva = "NECESITA CAPACITAR/ENTRENAR";
                        }
                    }
                    else
                    {
                        if ((Convert.ToInt32(calificacion_valores) >= 23) && (Convert.ToInt32(calificacion_valores) <= 45))
                        {
                            if (calificacion_kpi.Trim() == "A" || calificacion_kpi.Trim() == "B")
                            {
                                calificacion_total_eva = "NECESITA CAPACITAR/ENTRENAR";
                            }
                            if (calificacion_kpi.Trim() == "C-" || calificacion_kpi.Trim() == "C")
                            {
                                calificacion_total_eva = "RECONOCER Y DESARROLLAR";
                            }
                            if (calificacion_kpi.Trim() == "C+" || calificacion_kpi.Trim() == "D")
                            {
                                calificacion_total_eva = "RECONOCER Y DESARROLLAR";
                            }
                        }
                        else
                        {
                            if ((Convert.ToInt32(calificacion_valores) >= 45) && (Convert.ToInt32(calificacion_valores) <= 51))
                            {
                                if (calificacion_kpi.Trim() == "A" || calificacion_kpi.Trim() == "B")
                                {
                                    calificacion_total_eva = "NECESITA CAPACITAR/ENTRENAR";
                                }
                                if (calificacion_kpi.Trim() == "C-" || calificacion_kpi.Trim() == "C")
                                {
                                    calificacion_total_eva = "RECONOCER Y DESARROLLAR";
                                }
                                if (calificacion_kpi.Trim() == "C+" || calificacion_kpi.Trim() == "D")
                                {
                                    calificacion_total_eva = "RETENER";
                                }
                            }
                        }
                    }
                }

                if (estatus == "0")
                {
                    estatus = "PENDIENTE DE TERMINAR";
                }
                if (estatus == "1")
                {
                    estatus = "TERMINADA POR EMPLEADO";
                }
                if (estatus == "2")
                {
                    estatus = "LIBERADA POR JEFE";
                }
                if (estatus == "3")
                {
                    estatus = "EVALUACION CANCELADA";
                }

                //if ((calificacion_valores == ""))
                //{
                //    calificacion_valores = "-";
                //    descripcion_ponderacion = "-";
                //    calificacion_kpi = "-";
                //    descripcion_calificacion = "-";
                //    calificacion_total_eva = "-";
                //}
                //=========================================================================================================        

                args.Row.Cells[1].Text = txtNoEmpleado.Text;
                args.Row.Cells[2].Text = calificacion_valores + " " + descripcion_ponderacion;
                args.Row.Cells[3].Text = calificacion_kpi + descripcion_calificacion;
                args.Row.Cells[4].Text = calificacion_total_eva;
                args.Row.Cells[5].Text = fecha_captura;
                args.Row.Cells[6].Text = id_banda;
                args.Row.Cells[7].Text = ptos;
                args.Row.Cells[8].Text = ptos_jefe;
                args.Row.Cells[9].Text = necesidades;
                args.Row.Cells[10].Text = necesidades_jefe;
                args.Row.Cells[11].Text = comentarios;
                args.Row.Cells[12].Text = comentarios_jefe;
                args.Row.Cells[13].Text = id_eva;

                        }
                    }
                }
//=========================aqui termina el for
            }
        }
Exemple #36
0
        protected void OnGridRowDataBound(object sender, GridRowEventArgs args)
        {
            string total_curso = "0";

            if (!String.IsNullOrEmpty(args.Row.Cells[1].Text))
            {

                string tipodoc = args.Row.Cells[0].Text;
                string noemp = args.Row.Cells[1].Text;
                string noproveedor = args.Row.Cells[3].Text;
                string fecha_ini = "";
                string vencimiento = "";
                string estatus_vencimiento = "";

                using (SqlConnection cnx = new SqlConnection(ConfigurationManager.ConnectionStrings["conexionAPPS"].ToString()))
                {
                    cnx.Open();

                    string query = " SELECT     count(e.doc_IdArchivo) as totalarchivo,  " +
                                   "            e.doc_fecha_ini_vig as fi, e.doc_fecha_fin_vig as ff , c.id_curso,  " +
                                   "            c.vencimiento_curso as vencimiento " +
                                   " FROM       AUD_EXPEDIENTE  as e,  AUD_C_CURSOS as c " +
                                   " WHERE      e.doc_id_curso= c.id_curso and c.id_curso='" + tipodoc + "' and e.doc_IdEmpleado='" + noemp + "' " +
                                   " GROUP BY   e.doc_fecha_ini_vig, e.doc_fecha_fin_vig , c.id_curso, c.vencimiento_curso ";
                    SqlCommand cmd = new SqlCommand(query, cnx);
                    SqlDataReader dr = cmd.ExecuteReader();
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            vencimiento = dr["vencimiento"].ToString();
                            fecha_ini = dr["fi"].ToString();
                        }
                    }
                    else
                    {
                        fecha_ini = "";
                        estatus_vencimiento = "-";
                    }
                    if (vencimiento == "Ind")
                    {
                        estatus_vencimiento = "INDEFINIDO";
                        args.Row.Cells[11].Text = estatus_vencimiento;
                    }
                    else
                    {
                        if (vencimiento == "1")
                        {
                            string separarpto = fecha_ini;
                            // Split on directory separator
                            string[] parts = separarpto.Split('/');

                            string anio = parts[2];
                            string[] parts2 = anio.Split(' ');
                            string anio2 = parts2[0];
                            string mes = parts[1];
                            string dia = parts[0];

                            string fecha_inicio = dia + "/" + mes + "/" + anio2;
                            DateTime fecha = Convert.ToDateTime(fecha_inicio, new CultureInfo("es-ES"));
                            fecha = fecha.AddYears(Convert.ToInt32(vencimiento));
                            string resultado = fecha.ToString("dd/MM/yyyy");
                            estatus_vencimiento = resultado;
                            args.Row.Cells[11].Text = estatus_vencimiento;
                        }

                        if (vencimiento == "2")
                        {
                            string separarpto = fecha_ini;
                            // Split on directory separator
                            string[] parts = separarpto.Split('/');

                            string anio = parts[2];
                            string[] parts2 = anio.Split(' ');
                            string anio2 = parts2[0];
                            string mes = parts[1];
                            string dia = parts[0];

                            string fecha_inicio = dia + "/" + mes + "/" + anio2;
                            DateTime fecha = Convert.ToDateTime(fecha_inicio, new CultureInfo("es-ES"));
                            fecha = fecha.AddYears(Convert.ToInt32(vencimiento));
                            string resultado = fecha.ToString("dd/MM/yyyy");
                            estatus_vencimiento = resultado;
                            args.Row.Cells[11].Text = estatus_vencimiento;
                        }
                        if (vencimiento == "10")
                        {
                            string separarpto = fecha_ini;
                            // Split on directory separator
                            string[] parts = separarpto.Split('/');

                            string anio = parts[2];
                            string[] parts2 = anio.Split(' ');
                            string anio2 = parts2[0];
                            string mes = parts[1];
                            string dia = parts[0];

                            string fecha_inicio = dia + "/" + mes + "/" + anio2;
                            DateTime fecha = Convert.ToDateTime(fecha_inicio, new CultureInfo("es-ES"));
                            fecha = fecha.AddYears(Convert.ToInt32(vencimiento));
                            string resultado = fecha.ToString("dd/MM/yyyy");
                            estatus_vencimiento = resultado;
                            args.Row.Cells[11].Text = estatus_vencimiento;
                        }
                    }
                    //para sacar el nombre del proveedor del JDE
                    List<Capacitaciones> listaProveedores = capacitacion.ListaxNoProveedores(noproveedor);
                    //----para validar que no venga vacio los datos y marque error
                    if (listaProveedores != null)
                    {
                        args.Row.Cells[3].Text = listaProveedores[0].nomproveedor.ToString();
                    }

                    //PARA OBTENER EL NUMERO DE DIGITALIZACION DE ESE CURSO
                    using (SqlConnection cnx2 = new SqlConnection(ConfigurationManager.ConnectionStrings["conexionAPPS"].ToString()))
                    {
                        cnx2.Open();
                        string query2 = "SELECT count(doc_id_curso) as total " +
                                       " FROM   AUD_EXPEDIENTE " +
                                       " WHERE (doc_IdEmpleado = '" + noemp + "') and doc_id_curso='" + tipodoc + "' ";
                        SqlCommand cmd2 = new SqlCommand(query2, cnx2);

                        SqlDataReader dr2 = cmd2.ExecuteReader();
                        if (dr2.HasRows)
                        {
                            while (dr2.Read())
                            {
                                total_curso = dr2["total"].ToString();
                                args.Row.Cells[12].Text = total_curso;
                            }
                        }
                        if (total_curso == "0")
                        {
                            args.Row.Cells[12].Text = "Sin Archivos";
                        }
                    }

                }
            }
        }
    public void grid2_RowDataBound(object sender, GridRowEventArgs e)
    {
        Grid detail = sender as Grid;

        if (!details.ContainsKey(detail.ID))
        {
            details.Add(detail.ID, detail);
        }

        if (e.Row.RowType == GridRowType.DataRow && detail.RowsInViewState.Count > 0)
        {
            if (detail.RowsInViewState.Count > e.Row.RowIndex)
            {
                for (int i = 1; i < e.Row.Cells.Count; i++)
                {
                    GridDataControlFieldCell cell = e.Row.Cells[i] as GridDataControlFieldCell;
                    TextBox textBox = cell.FindControl("TextBox1") as TextBox;

                    GridDataControlFieldCell cellInViewState = detail.RowsInViewState[e.Row.RowIndex].Cells[i] as GridDataControlFieldCell;
                    TextBox textBoxInViewState = cellInViewState.FindControl("TextBox1") as TextBox;

                    textBox.Text = textBoxInViewState.Text;
                }
            }
        }
    }
 protected void OnGridRowCreated(object sender, GridRowEventArgs args)
 {
     // modify the row structure here
 }
Exemple #39
0
 /// <summary>
 /// Вызывает событие RowExpanded
 /// </summary>
 /// <returns></returns>
 protected internal virtual void OnRowCollapsed(int rowIndex, object rowData)
 {
  if(RowCollapsed != null)
  {
   GridRowEventArgs args = new GridRowEventArgs(rowIndex, rowData);
   RowCollapsed(this, args);
  }
 }
 protected void grid2_RowCreated(object sender, GridRowEventArgs e)
 {
     DetailGrid detailGrid = sender as DetailGrid;
     detailGrid.DataBound += new EventHandler(grid2_DataBound);
 }
Exemple #41
0
 public void SourceObject_RowEnter(object sender, GridRowEventArgs e)
 {
     RefreshAssignedObjects(e.RowIndex);
     lastRowIndex = e.RowIndex;
 }
        protected void gridTotales_RowDataBound(object sender, GridRowEventArgs e)
        {
            if (e.Row.RowType == GridRowType.DataRow)
            {
                tempTotalStockIni += e.Row.Cells[3].Text == "" ? 0 : (int)double.Parse(e.Row.Cells[3].Text);
                tempTotalIni += e.Row.Cells[4].Text == "" ? 0.0 : double.Parse(e.Row.Cells[4].Text);
                tempCOMPRA_Cantidad += e.Row.Cells[5].Text == "" ? 0 : (int)double.Parse(e.Row.Cells[5].Text);
                tempCOMPRA_Total += e.Row.Cells[6].Text == "" ? 0.0 : double.Parse(e.Row.Cells[6].Text);
                tempVENTA_Cantidad += e.Row.Cells[7].Text == "" ? 0 : (int)double.Parse(e.Row.Cells[7].Text);
                tempVENTA_Total += e.Row.Cells[8].Text == "" ? 0.0 : double.Parse(e.Row.Cells[8].Text);
                tempTotalStockFin += e.Row.Cells[9].Text == "" ? 0 : (int)double.Parse(e.Row.Cells[9].Text);
                tempTotalFin += e.Row.Cells[10].Text == "" ? 0.0 : double.Parse(e.Row.Cells[10].Text);

                //if (lastGroupHeader != null)
                //{
                //    Literal textContainer = lastGroupHeader.Cells[0].Controls[0].Controls[lastGroupHeader.Cells[0].Controls[0].Controls.Count - 1].Controls[0] as Literal;
                //    textContainer.Text = "<div style='margin-right:100px; float:left;' >Articulo: " + ((GridDataControlFieldCell)e.Row.Cells[1]).Text + " - " + ((GridDataControlFieldCell)e.Row.Cells[2]).Text;
                //    textContainer.Text += "</div><div style='float:left;'>";
                //    textContainer.Text += "Stock Inicial: " + ((GridDataControlFieldCell)e.Row.Cells[3]).Text + "</div>";

                //    lastGroupHeader = null;
                //}
            }
            else if (e.Row.RowType == GridRowType.GroupHeader)
            {
                //Literal textContainer = e.Row.Cells[0].Controls[0].Controls[1].Controls[0] as Literal;
                if (!lastGroupHeaders.ContainsKey(e.Row.GroupLevel))
                {
                    lastGroupHeaders.Add(e.Row.GroupLevel, null);
                }
                lastGroupHeaders[e.Row.GroupLevel] = e.Row;

                if (e.Row.GroupLevel == 1)
                {
                    lastGroupHeader = e.Row;
                }
            }
            else if (e.Row.RowType == GridRowType.GroupFooter)
            {
                if (e.Row.GroupLevel > 0)
                {
                    for (int level = e.Row.GroupLevel - 1; level >= 0; level--)
                    {
                        if (!TotalStockIni.ContainsKey(level))
                        {
                            TotalStockIni.Add(level, 0);
                            TotalIni.Add(level, 0);
                            COMPRA_Cantidad.Add(level, 0);
                            COMPRA_Total.Add(level, 0);
                            VENTA_Cantidad.Add(level, 0);
                            VENTA_Total.Add(level, 0);
                            TotalStockFin.Add(level, 0);
                            TotalFin.Add(level, 0);
                        }

                        TotalStockIni[level] += tempTotalStockIni;
                        TotalIni[level] += tempTotalIni;
                        COMPRA_Cantidad[level] += tempCOMPRA_Cantidad;
                        COMPRA_Total[level] += tempCOMPRA_Total;
                        VENTA_Cantidad[level] += tempVENTA_Cantidad;
                        VENTA_Total[level] += tempVENTA_Total;
                        TotalStockFin[level] += tempTotalStockFin;
                        TotalFin[level] += tempTotalFin;
                    }
                }

                int TotalStockIniToDisplay = 0;
                double TotalIniToDisplay = 0;
                int COMPRA_CantidadToDisplay = 0;
                double COMPRA_TotalToDisplay = 0;
                int VENTA_CantidadToDisplay = 0;
                double VENTA_TotalToDisplay = 0;
                int TotalStockFinToDisplay = 0;
                double TotalFinToDisplay = 0;

                if (TotalStockIni.ContainsKey(e.Row.GroupLevel))
                {
                    TotalStockIniToDisplay = TotalStockIni[e.Row.GroupLevel];
                    TotalIniToDisplay = TotalIni[e.Row.GroupLevel];
                    COMPRA_CantidadToDisplay = COMPRA_Cantidad[e.Row.GroupLevel];
                    COMPRA_TotalToDisplay = COMPRA_Total[e.Row.GroupLevel];
                    VENTA_CantidadToDisplay = VENTA_Cantidad[e.Row.GroupLevel];
                    VENTA_TotalToDisplay = VENTA_Total[e.Row.GroupLevel];
                    TotalStockFinToDisplay = TotalStockFin[e.Row.GroupLevel];
                    TotalFinToDisplay = TotalFin[e.Row.GroupLevel];

                    TotalStockIni[e.Row.GroupLevel] = 0;
                    TotalIni[e.Row.GroupLevel] = 0;
                    COMPRA_Cantidad[e.Row.GroupLevel] = 0;
                    COMPRA_Total[e.Row.GroupLevel] = 0;
                    VENTA_Cantidad[e.Row.GroupLevel] = 0;
                    VENTA_Total[e.Row.GroupLevel] = 0;
                    TotalStockFin[e.Row.GroupLevel] = 0;
                    TotalFin[e.Row.GroupLevel] = 0;
                }
                else
                {
                    TotalStockIniToDisplay = tempTotalStockIni;
                    TotalIniToDisplay = tempTotalIni;
                    COMPRA_CantidadToDisplay = tempCOMPRA_Cantidad;
                    COMPRA_TotalToDisplay = tempCOMPRA_Total;
                    VENTA_CantidadToDisplay = tempVENTA_Cantidad;
                    VENTA_TotalToDisplay = tempVENTA_Total;
                    TotalStockFinToDisplay = tempTotalStockFin;
                    TotalFinToDisplay = tempTotalFin;
                }

                // Display information in Group footer
                e.Row.Cells[3].Text = TotalStockIniToDisplay.ToString();
                e.Row.Cells[4].Text = "S/." + TotalIniToDisplay.ToString();
                e.Row.Cells[5].Text = COMPRA_CantidadToDisplay.ToString();
                e.Row.Cells[6].Text = "S/." + COMPRA_TotalToDisplay.ToString();
                e.Row.Cells[7].Text = VENTA_CantidadToDisplay.ToString();
                e.Row.Cells[8].Text = "S/." + VENTA_TotalToDisplay.ToString();
                e.Row.Cells[9].Text = TotalStockFinToDisplay.ToString();
                e.Row.Cells[10].Text = "S/." + TotalFinToDisplay.ToString();

                tempTotalStockIni = 0;
                tempTotalIni = 0;
                tempCOMPRA_Cantidad = 0;
                tempCOMPRA_Total = 0;
                tempVENTA_Cantidad = 0;
                tempVENTA_Total = 0;
                tempTotalStockFin = 0;
                tempTotalFin = 0;
            }
        }
        protected void gridVentasxCobrar_RowDataBound(object sender, GridRowEventArgs e)
        {
            if (e.Row.RowType == GridRowType.DataRow)
            {
                tempTotalCOM += e.Row.Cells[10].Text == "" ? 0.0 : double.Parse(e.Row.Cells[10].Text);
                tempTotalVEN += e.Row.Cells[14].Text == "" ? 0.0 : double.Parse(e.Row.Cells[14].Text);
                tempTotal += e.Row.Cells[17].Text == "" ? 0.0 : double.Parse(e.Row.Cells[17].Text);

                if (lastGroupHeader != null)
                {
                    Literal textContainer = lastGroupHeader.Cells[0].Controls[0].Controls[lastGroupHeader.Cells[0].Controls[0].Controls.Count - 1].Controls[0] as Literal;
                    textContainer.Text = "<div style='margin-right:100px; float:left;' >Articulo: " + ((GridDataControlFieldCell)e.Row.Cells[1]).Text + " - " + ((GridDataControlFieldCell)e.Row.Cells[2]).Text;
                    textContainer.Text += "</div><div style='float:left;'>";
                    textContainer.Text += "Stock Inicial: " + ((GridDataControlFieldCell)e.Row.Cells[3]).Text + "</div>";

                    lastGroupHeader = null;
                }
            }
            else if (e.Row.RowType == GridRowType.GroupHeader)
            {
                //Literal textContainer = e.Row.Cells[0].Controls[0].Controls[1].Controls[0] as Literal;
                if (!lastGroupHeaders.ContainsKey(e.Row.GroupLevel))
                {
                    lastGroupHeaders.Add(e.Row.GroupLevel, null);
                }
                lastGroupHeaders[e.Row.GroupLevel] = e.Row;

                if (e.Row.GroupLevel == 1)
                {
                    lastGroupHeader = e.Row;
                }
            }
            else if (e.Row.RowType == GridRowType.GroupFooter)
            {
                if (e.Row.GroupLevel > 0)
                {
                    for (int level = e.Row.GroupLevel - 1; level >= 0; level--)
                    {
                        if (!totalCOM.ContainsKey(level))
                        {
                            totalCOM.Add(level, 0);
                            totalVEN.Add(level, 0);
                            total.Add(level, 0);
                        }

                        totalCOM[level] += tempTotalCOM;
                        totalVEN[level] += tempTotalVEN;
                        total[level] += tempTotal;
                    }
                }

                double totalCOMToDisplay = 0;
                double totalVENToDisplay = 0;
                double totalToDisplay = 0;

                if (totalCOM.ContainsKey(e.Row.GroupLevel))
                {
                    totalCOMToDisplay = totalCOM[e.Row.GroupLevel];
                    totalVENToDisplay = totalVEN[e.Row.GroupLevel];
                    totalToDisplay = total[e.Row.GroupLevel];

                    totalCOM[e.Row.GroupLevel] = 0;
                    totalVEN[e.Row.GroupLevel] = 0;
                    total[e.Row.GroupLevel] = 0;
                }
                else
                {
                    totalCOMToDisplay = tempTotalCOM;
                    totalVENToDisplay = tempTotalVEN;
                    totalToDisplay = tempTotal;
                }

                // Display information in Group footer
                e.Row.Cells[10].Text = "S/." + totalCOMToDisplay.ToString();
                e.Row.Cells[14].Text = "S/." + totalVENToDisplay.ToString();
                //e.Row.Cells[17].Text = "S/." + totalToDisplay.ToString();

                tempTotalCOM = 0;
                tempTotalVEN = 0;
                tempTotal = 0;
            }
        }