zoukankan      html  css  js  c++  java
  • C# ------- 二维表变成一行数据存储,使用后如何分别获取

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

     在数据库中可以看做

    然后实际应用的时候,将字段名为 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;
                }
            }
  • 相关阅读:
    Scilab5.5.2 在Centos5.11下binary安装(注:不是源码编译安装)
    《DSP using MATLAB》Problem 9.5
    Java 出现警告 不能读取AppletViewer的属性文件
    《DSP using MATLAB》Problem 9.4
    《DSP using MATLAB》Problem 9.2
    《DSP using MATLAB》Problem 8.46
    《DSP using MATLAB》Problem 8.45
    风力摆?这是不是太简单了点
    树莓派:基于物联网做的指纹打卡器
    Python之面向对象(一)
  • 原文地址:https://www.cnblogs.com/obge/p/12837645.html
Copyright © 2011-2022 走看看