zoukankan      html  css  js  c++  java
  • sharepoint类型转换

    sharepoint学习汇总

    http://blog.csdn.net/qq873113580/article/details/20390149 

             r[col.ColumnName] = GetType(projectList.Fields[col.ColumnName].Type, projectItem[col.ColumnName].ToString(), spWeb);
                       

            public static string  GetType(SPFieldType fieldType, string fieldValue, SPWeb spWeb)
            {

                if (fieldValue != "")
                {
                    if (fieldType == SPFieldType.User)
                    {
                        string tempUser = string.Empty;
                        SPFieldUserValueCollection spFieldUserValueColl = new SPFieldUserValueCollection(spWeb, fieldValue);
                        foreach (SPFieldUserValue userValue in spFieldUserValueColl)
                        {
                            tempUser += userValue.User.Name + " ";
                        }
                        fieldValue = tempUser;
                    }
                    else if (fieldType == SPFieldType.DateTime)
                    {
                        fieldValue = DateTime.Parse(fieldValue).ToString("yyyy-MM-dd");
                    }
                    else if (fieldType == SPFieldType.Lookup)
                    {
                        SPFieldLookupValue sPFieldLookupValue = new SPFieldLookupValue(fieldValue);
                        fieldValue = sPFieldLookupValue.LookupValue;
                    }
                    return fieldValue;
                }
                else
                {
                    return "";
                }
            }

  • 相关阅读:
    css:水平居中和垂直居中
    python celery多worker、多队列、定时任务
    python 单例模式
    单例模式
    django 缓存信号等
    redis常用的命令总结
    在python项目中导出项目依赖的模块信息
    面向对象:类中的特殊成员
    python写算法中的栈
    CatLog_小鱼要加油
  • 原文地址:https://www.cnblogs.com/jzssuanfa/p/6869599.html
Copyright © 2011-2022 走看看