コード例 #1
0
    //保存信息,单表保存
    protected void SaveInfo()
    {
        String str   = "true";
        String ResID = "";

        if (Request["ResID"] != null)
        {
            ResID = Request["ResID"];
            String RecID   = Request["RecID"];
            String lxrJson = "";
            if (Request["lxrJson"] != null)
            {
                lxrJson = Request["lxrJson"];
            }
            else
            {
                str = "false";
            }
            bool isSuccess = CommonMethod.AddOrEidt(lxrJson, ResID, RecID, UserID);
            if (!isSuccess)
            {
                str = "false";
            }
        }
        else
        {
            str = "false";
        }
        Response.Write(str);
    }
コード例 #2
0
 private string SaveInfo(string ResID, string dataJson, string RecID)
 {
     if (CommonMethod.AddOrEidt(dataJson, ResID, RecID, UserID))
     {
         return("{\"success\": true}");
     }
     else
     {
         return("{\"success\": false}");
     }
 }
コード例 #3
0
 /// <summary>
 /// 数据字典项,保存方法
 /// </summary>
 public string KeyDataSave(string ResID, string dataJson, string RecID, string userId)
 {
     if (CommonMethod.AddOrEidt(dataJson, ResID, RecID, userId))
     {
         return("{\"success\": true}");
     }
     else
     {
         return("{\"success\": false}");
     }
 }
コード例 #4
0
 private string SaveInfo(string ResID, string dataJson, string RecID, string UserID)
 {
     if (CommonMethod.AddOrEidt(dataJson, ResID, RecID, UserID))
     {
         Services Resource = new Services();
         //CommonProperty.InitProperty(Resource.GetUserInfo(UserID));
         return("{\"success\": true}");
     }
     else
     {
         return("{\"success\": false}");
     }
 }
コード例 #5
0
    protected void SavePPXTPJL()
    {
        Response.ContentType = "text/plain";
        Response.Charset     = "utf-8";
        HttpPostedFile file        = Request.Files["Filedata"];
        string         TPJLResID   = "";
        string         RecID       = "";
        string         TPJLWDResID = "";
        string         jsonStr     = "";
        string         jsonStr1    = "";

        if (Request["RecID"] != null)
        {
            RecID = Request["RecID"];
        }
        if (Request["ResID"] != null)
        {
            TPJLResID = Request["ResID"];
        }
        if (Request["TPJLWDResID"] != null)
        {
            TPJLWDResID = Request["TPJLWDResID"];
        }
        if (Request["jsonStr"] != null)
        {
            jsonStr = Request["jsonStr"];
        }
        if (Request["jsonStr1"] != null)
        {
            jsonStr1 = Request["jsonStr1"];
        }
        bool isSuccess = CommonMethod.AddOrEidt(jsonStr1, TPJLResID, RecID, UserID);

        if (isSuccess)
        {
            string    uploadPath = HttpContext.Current.Server.MapPath(Request["folder"]) + "\\";
            DataTable dt         = (DataTable)Newtonsoft.Json.JsonConvert.DeserializeObject <DataTable>(jsonStr);
            WebServices.FieldInfo[] FieldListInfo = new WebServices.FieldInfo[dt.Rows.Count];
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    WebServices.FieldInfo fi = new WebServices.FieldInfo();
                    fi.FieldDescription = dt.Rows[i]["Description"].ToString();
                    fi.FieldValue       = dt.Rows[i]["Value"].ToString();
                    FieldListInfo[i]    = fi;
                }
            }
            WebServices.Services Resource = new WebServices.Services();

            if (file != null)
            {
                string           fileName = System.IO.Path.GetFileName(file.FileName);
                int              FileLen  = file.ContentLength;
                byte[]           FileData = new byte[FileLen];
                System.IO.Stream sr       = file.InputStream;//创建数据流对象
                sr.Read(FileData, 0, FileLen);
                sr.Close();
                Resource.UploadFile(TPJLWDResID, UserID, fileName, FileData, FieldListInfo);
                //下面这句代码缺少的话,上传成功后上传队列的显示不会自动消失
                Response.Write("1");
            }
            else
            {
                Resource.UploadFile(TPJLWDResID, UserID, "", null, FieldListInfo);
                Response.Write("1");
            }
        }
        else
        {
            Response.Write("0");
        }
    }