CCOA\CCOA\WF\CCForm\Dtl.aspx 明细表列上下排序显示

Dtl.aspx

function DtlOpt(workId, fk_mapdtl) {
    var url = 'DtlOpt.aspx?WorkID=' + workId + '&FK_MapDtl=' + fk_mapdtl;
    var b = window.showModalDialog(url, 'ass', 'dialogHeight: 400px; dialogWidth: 600px;center: yes; help: no');
    window.location.href = 'Dtl.aspx?EnsName=' + fk_mapdtl + '&IsReadonly=1&RefPKVal=' + workId;
}// add &IsReadonly=1

Dtl.aspx.cs

 this.Pub1.Add(mdtl.MTR);

            if (this.IsReadonly == 1 && !string.IsNullOrEmpty(mdtl.MulColsMerge.Trim()))//add by haisheng
            {
                if (!mdtl.IsReadonly || mdtl.IsExp)
                    this.Pub1.Add("<TD class='FDesc'><img src='/WF/Img/Btn/Table.gif' οnclick=\"return DtlOpt('" + this.RefPKVal + "','" + this.EnsName + "');\" border=0/></TD>");
                else
                    this.Pub1.AddTDTitle();

                numOfCol++;
                string [] colArray=mdtl.MulColsMerge.Split(new char[] { ';',' '} ,StringSplitOptions.RemoveEmptyEntries);
                string [] colArr=null;
                string colstr = null;
                for (int i = 0; i < colArray.Length; i++)
                {                 
                    colstr = string.Empty;
                    colArr = colArray[i].Split(',');
                    for (int j = 0; j < colArr.Length; j++)
                    {
                        foreach (MapAttr attr in attrs)
                        {
                            if (attr.KeyOfEn.Equals(colArr[j]))
                            {
                                colstr = colstr+attr.Name + "<br/>";
                                break;
                            }                          
                        }
                      
                    }
                    colstr = colstr.Substring(0, colstr.Length - 5);
                    this.Pub1.AddTDTitleExt(colstr);
                }
               
            }
            else if (mdtl.IsShowTitle)

     {

    ......

    }

---------------------------------在if (mdtl.IsEnableGroupField)后增加-----

if (mdtl.IsEnableGroupField)
            {

            .......

            }

else if(this.IsReadonly==1 && !string.IsNullOrEmpty(mdtl.MulColsMerge.Trim()))//add by haisheng
         {

                foreach (BP.Sys.GEDtl dtl in dtls)
                {
                    #region 增加rows
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(idx++);
                    string[] colArray = mdtl.MulColsMerge.Split(new char[] { ';', ' ' }, StringSplitOptions.RemoveEmptyEntries);
                    string[] colatt = null;
                    string colstr = string.Empty;
                    for (int i = 0; i < colArray.Length; i++)
                    {
                        colatt = colArray[i].Split(',');
                        colstr = string.Empty;
                        for (int j = 0; j < colatt.Length; j++)
                        {

                 
                    foreach (MapAttr attr in attrs)
                    {
                        if (attr.KeyOfEn==colatt[j])
                        {
                           
                       
                        if (attr.UIVisible == false || attr.KeyOfEn == "OID")
                            continue;

                        //处理它的默认值.
                        if (attr.DefValReal.Contains("@") == true && attr.UIIsEnable == false)
                            dtl.SetValByKey(attr.KeyOfEn, attr.DefVal);

                        string val = dtl.GetValByKey(attr.KeyOfEn).ToString();
                        if (attr.UIIsEnable == false && dtl.OID >= 100 && LinkFields.Contains("," + attr.KeyOfEn + ","))
                        {
                            if (string.IsNullOrEmpty(val))
                                val = "...";
                            MapExt meLink = mes.GetEntityByKey(MapExtAttr.ExtType, MapExtXmlList.Link,
                                MapExtAttr.AttrOfOper, attr.KeyOfEn) as MapExt;

                            string url = meLink.Tag.Clone() as string;
                            if (url.Contains("?") == false)
                                url = url + "?a3=2";

                            url = url + "&WebUserNo=" + WebUser.No + "&SID=" + WebUser.SID + "&EnName=" + mdtl.No + "&OID=" + dtl.OID;
                            if (url.Contains("@AppPath"))
                                url = url.Replace("@AppPath", "http://" + this.Request.Url.Host + this.Request.ApplicationPath);
                            if (url.Contains("@"))
                            {
                                if (attrs2.Count == 0)
                                    attrs2 = new MapAttrs(mdtl.No);
                                foreach (MapAttr item in attrs2)
                                {
                                    url = url.Replace("@" + item.KeyOfEn, dtl.GetValStrByKey(item.KeyOfEn));
                                    if (url.Contains("@") == false)
                                        break;
                                }
                                if (url.Contains("@"))
                                {
                                    /*可能是主表也要有参数*/
                                    if (mainEn == null)
                                        mainEn = this.MainEn;
                                    foreach (Attr attrM in mainEn.EnMap.Attrs)
                                    {
                                        url = url.Replace("@" + attrM.Key, mainEn.GetValStrByKey(attrM.Key));
                                        if (url.Contains("@") == false)
                                            break;
                                    }
                                }
                            }
                            colstr = colstr + "<a href='" + url + "' target='" + meLink.Tag1 + "' >" + val + "</a><br/>";
                            //this.Pub1.AddTD("<a href='" + url + "' target='" + meLink.Tag1 + "' >" + val + "</a>");
                            continue;
                        }
                        if (string.IsNullOrEmpty(val.Trim()))
                        {
                            val = "No Data";
                        }

                        switch (attr.UIContralType)
                        {          
                            case UIContralType.HLink://add by haisheng
                                string hlink = "<a href='www.baidu.com'>百度</a>";
                                colstr = colstr + val + "<br/>";
                                //this.Pub1.AddTD(hlink);
                                break;
                            default:
                                colstr = colstr + val + "<br/>";
                                break;
                        }
                        break;
                    }
                      
                    }                  
                        }
                        if (colstr.Length >= 5)
                        {
                            colstr = colstr.Substring(0, colstr.Length - 5);
                            this.Pub1.AddTD(colstr);
                        }
                    }
                    if (mdtl.IsEnableAthM)
                    {
                        if (dtl.OID >= 100)
                            this.Pub1.AddTD("<a href=\"javascript:window.showModalDialog('AttachmentUpload.aspx?IsBTitle=1&PKVal=" + dtl.OID + "&Ath=AthM&FK_MapData=" + mdtl.No + "&FK_FrmAttachment=" + mdtl.No + "_AthM','dialogHeight: 500px; dialogWidth: 600px;center: yes; help: no')\"><img src='/WF/Img/AttachmentM.png' border=0 width='16px' /></a>");
                        else
                            this.Pub1.AddTD("");
                    }

                    if (mdtl.IsEnableM2M)
                    {
                        if (dtl.OID >= 100)
                            this.Pub1.AddTD("<a href=\"javascript:window.showModalDialog('M2M.aspx?IsOpen=1&NoOfObj=M2M&OID=" + dtl.OID + "&FK_MapData=" + mdtl.No + "','m2m','dialogHeight: 500px; dialogWidth: 600px;center: yes; help: no')\"><img src='/WF/Img/M2M.png' border=0 width='16px' /></a>");
                        else
                            this.Pub1.AddTD("");
                    }

                    if (mdtl.IsEnableM2MM)
                    {
                        if (dtl.OID >= 100)
                            this.Pub1.AddTD("<a href=\"javascript:window.showModalDialog('M2MM.aspx?IsOpen=1&NoOfObj=M2MM&OID=" + dtl.OID + "&FK_MapData=" + mdtl.No + "','m2m','dialogHeight: 500px; dialogWidth: 600px;center: yes; help: no')\"><img src='/WF/Img/M2M.png' border=0 width='16px' /></a>");
                        else
                            this.Pub1.AddTD("");
                    }

                    if (mdtl.IsEnableLink)
                    {
                        string url = mdtl.LinkUrl.Clone() as string;
                        if (url.Contains("?") == false)
                            url = url + "?a3=2";
                        url = url.Replace("*", "@");

                        if (url.Contains("OID="))
                            url = url + "&WebUserNo=" + WebUser.No + "&SID=" + WebUser.SID + "&EnName=" + mdtl.No;
                        else
                            url = url + "&WebUserNo=" + WebUser.No + "&SID=" + WebUser.SID + "&EnName=" + mdtl.No + "&OID=" + dtl.OID;

                        if (url.Contains("@AppPath"))
                            url = url.Replace("@AppPath", "http://" + this.Request.Url.Host + this.Request.ApplicationPath);

                        url = BP.WF.Glo.DealExp(url, dtl, null);
                        url = url.Replace("@OID", dtl.OID.ToString());
                        url = url.Replace("@FK_Node", this.FK_Node.ToString());
                        url = url.Replace("'", "");

                        if (dtl.OID >= 100)
                            this.Pub1.AddTD("<a href=\"" + url + "\" target='" + mdtl.LinkTarget + "' >" + mdtl.LinkLabel + "</a>");
                        else
                            this.Pub1.AddTD("");
                    }

                    if (mdtl.IsDelete && this.IsReadonly == 0 && dtl.OID >= 100)
                    {
                        if (isRowLock == true && dtl.IsRowLock == true)
                            this.Pub1.AddTD("<img src='/WF/Img/Btn/Lock.png' class=ICON />"); //如果当前记录是锁定的,并且启动了锁定设置.
                        else
                            this.Pub1.Add("<TD border=0><img src='/WF/Img/Btn/Delete.gif' οnclick=\"javascript:Del('" + dtl.OID + "','" + this.EnsName + "','" + this.RefPKVal + "','" + this.PageIdx + "')\" /></TD>");
                    }
                    else if (mdtl.IsDelete)
                    {
                        if (this.IsReadonly == 0)
                            this.Pub1.Add("<TD class=TD border=0>&nbsp;</TD>");
                    }
                    this.Pub1.AddTREnd();
                    #endregion 增加rows
                }
         }

----------------------------------------

  #region 生成合计
            if (mdtl.IsShowSum && dtls.Count > 1 && this.IsReadonly == 0)//add IsReadonly==0 by haisheng
            {

              ......

          }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值