示例#1
0
        public static JArray parseJsonJobLines(string result)
        {
            JArray conversion = null;

            try
            {
                var jObject2 = JObject.Parse(result);
                //dynamic json = JValue.Parse(result.ToString());
                //conversion = (JArray)json.value;


                JArray items = (JArray)jObject2["value"];
                for (int i = 0; i < items.Count; i++)
                {
                    ProjectMaster projobj = new ProjectMaster();
                    projobj.Project_Number = (string)jObject2["value"][i]["No"];
                    projobj.Project_Name   = (string)jObject2["value"][i]["Description"];
                    projobj.Blocked        = (string)jObject2["value"][i]["Blocked"];
                    projobj.Contact_Person = (string)jObject2["value"][i]["Bill_to_Contact_No"];
                    SyncJobs.InsertJobLines(projobj);
                }
            }
            catch (Exception e)
            {
            }
            return(conversion);
        }
示例#2
0
        public static int InsertJobLines(ProjectMaster obj)
        {
            DBHelper  DBConn = new DBHelper();
            DataTable dt;

            SqlParameter[] sqlparam;
            sqlparam = new SqlParameter[5];

            sqlparam[0] = new SqlParameter("@id", '0');
            sqlparam[1] = new SqlParameter("@project_name", obj.Project_Name);
            sqlparam[2] = new SqlParameter("@project_number", obj.Project_Number);
            sqlparam[3] = new SqlParameter("@contact_person", obj.Contact_Person);
            sqlparam[4] = new SqlParameter("@blocked", obj.Blocked);
            int a = DBConn.Save("InsertJobLines", sqlparam, "");

            return(a);
        }