首页 > Windows开发 > 详细

C# ------- 二维表变成一行数据存储,使用后如何分别获取

时间:2020-05-06 21:34:09      阅读:68      评论:0      收藏:0      [点我收藏+]

将一个二维表,使用一行数据表示

技术分享图片

 

 在数据库中可以看做

技术分享图片

然后实际应用的时候,将字段名为 Ext05 中数据进行拆分获取,

根据对应的规格获取其对应的价格

技术分享图片

 

 就可以得到每行数据了

 

dd

  try
        {
            
            List<ITEM.Model.qdCnt4.FourCollsType> mBiaoZhunList = _bllCollType.Get_Ex_FourCollsTypeListByTypeCollName_Like("*", sQiyeGuid, 4010, xbomlist.LianjianMark, 0f);//比对的是 对应手册编号
            if (mBiaoZhunList.Count > 0)
            {
                for (int i = 0; i <= mBiaoZhunList.Count - 1; i++)
                {
                    ITEM.Model.qdCnt4.FourCollsType mType = mBiaoZhunList[i];
                    
                    if (mType.Ext05.IndexOf(xbomlist.LianJianFormat) >= 0)
                    {
                        #region 拆分Ext05 中的规格和单价
                        string[] s1 = mType.Ext05.Split(|);
                        for (int j = 0; j <= s1.Length - 1; j++)
                        {
                            string[] s2 = s1[j].Split(~);
                            if (s2[0] == xbomlist.LianJianFormat)
                            {
                                decimal dPrice = Convert.ToDecimal(s2[1]);
                                xbomlist.LFeePrice = dPrice;
                                xbomlist.LFeeCount = xbomlist.LianJianSum * dPrice;
                                return 1;
                            }
                        }
                        #endregion
                    }
                }
            }
        }
        catch
        {
            
        }


 

第一步调用的方法

        public List<ITEM.Model.qdCnt4.FourCollsType> Get_Ex_FourCollsTypeListByTypeCollName_Like(string sFilesName, string QiyeGuid, int iTypeID, string sTypeCollName, float _iFlag)
        {
            int iFlag = (int)_iFlag;
            if (AppFourCollsType.get_List_CollsType_Application_CollName(iTypeID, sTypeCollName, iFlag.ToString()) != null)
            {
                return AppFourCollsType.get_List_CollsType_Application_CollName_Like(iTypeID, sTypeCollName, iFlag.ToString());
            }
            else
            {
                string strsql = " and TypeCollName like ‘%" + sTypeCollName + "%‘ and SysTypeID=" + iTypeID + " and IsDelete=0 order by TypeCollMark";
                List<ITEM.Model.qdCnt4.FourCollsType> mList = GetListSelFourCollsType3(sFilesName, QiyeGuid, iFlag, strsql);
                return mList;
            }
        }

 

C# ------- 二维表变成一行数据存储,使用后如何分别获取

原文:https://www.cnblogs.com/obge/p/12837645.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!