示例#1
0
        /// <summary>
        ///  Call method http://localhost:9517/api/PLF/?schoolYear=20182019schoolCode=0290itemCode=PLP11value=myinputtext
        ///  by provide the value the Web API will save the value to database and return save or update action result.
        /// </summary>
        /// <param name="schoolYear"></param>
        /// <param name="schoolCode"></param>
        /// <param name="itemCode"></param>
        /// <param name="value"></param>
        /// <returns>PLF Form save content and get save result back</returns>
        // GET: api/PLF/itemCode/value
        public string Get(string schoolYear, string schoolCode, string itemCode, string value)
        {
            ParameterSP0 parameter = new ParameterSP0 {
                Operate = "Content", UserID = "", UserRole = "", SchoolYear = schoolYear, SchoolCode = schoolCode, ItemCode = itemCode, Value = value
            };

            return(FormData.Content(parameter));
        }
示例#2
0
        /// <summary>
        ///  http://localhost:9517/api/PLF/?userID=mif&schoolYear=20182019schoolCode=0290itemCode=PLP11
        /// This is save the content to Database using POST method
        /// </summary>
        /// <param name="plfcontent">  PLF form content object </param>

        // POST: api/PLF
        public void Post(FormContent1 plfcontent)
        {
            ParameterSP0 parameter = new ParameterSP0 {
                Operate = "Content", SchoolYear = plfcontent.SchoolYear, SchoolCode = plfcontent.SchoolCode, ItemCode = plfcontent.ItemCode, Value = plfcontent.Notes
            };

            FormData.Content(parameter);
            //  FormData.Content("Content", plfcontent.Title, "", plfcontent.SchoolYear, plfcontent.SchoolCode, plfcontent.ItemCode, plfcontent.Notes);
        }
示例#3
0
 public static string TextValue(string sp, ParameterSP0 parameter)
 {
     using (IDbConnection connection = new SqlConnection(conSTR))
     {
         //  string SP = sp;
         //  ParameterSP0 parameter = new ParameterSP0 { Operate = operate, UserID = userID, ItemCode = itemCode, SchoolYear = schoolYear, SchoolCode = schoolCode };
         var myText = connection.QuerySingle <SingleString>(sp, parameter);
         return(myText.MyText);
     }
 }
示例#4
0
 public static string Title(string sp, ParameterSP0 parameter)
 {
     using (IDbConnection connection = new SqlConnection(conSTR))
     {
         // string SP = sp + " @Operate,@UserID,@UserRole,@ItemCode";
         //  ParameterSP0 parameter = new ParameterSP0 { Operate = operate, UserID = userID, UserRole = userRole, ItemCode = itemCode };
         var myTitle = connection.QuerySingle <SingleString>(sp, parameter);
         //  new { Operate = operate, UserID = userID, SchoolYear = schoolYear, SchoolCode = schoolCode,SchoolArea = schoolArea }).ToList();
         return(myTitle.MyText);
     }
 }
示例#5
0
 public static string TextValue(string operate, string userID, string userRole, string itemCode, string schoolYear, string schoolCode, string value)
 {
     using (IDbConnection connection = new SqlConnection(conSTR))
     {
         string       sp        = "dbo.tcdsb_PLF_FormNew @Operate,@UserID,@UserRole,@SchoolYear,@SchoolCode,@ItemCode,@Value";
         ParameterSP0 parameter = new ParameterSP0 {
             Operate = operate, UserID = userID, ItemCode = itemCode, SchoolYear = schoolYear, SchoolCode = schoolCode, Value = value
         };
         var myText = connection.QuerySingle <SingleString>(sp, parameter);
         return(myText.MyText);
     }
 }
示例#6
0
 public static string Content(ParameterSP0 parameter)
 {
     try
     {
         string sp = "dbo.tcdsb_PLF_FormData_WebAPI @Operate,@UserID,@UserRole,@SchoolYear,@SchoolCode,@ItemCode,@Value";
         //    ParameterSP0 parameter = new ParameterSP0 { Operate = "Content", SchoolYear = schoolYear, SchoolCode = schoolCode, ItemCode = itemCode, Value = value };
         return(GeneralDataAccess.TextValue(sp, parameter));
     }
     catch (Exception ex)
     {
         var exm = ex.Message;
         return("");
     }
 }
示例#7
0
 public static string TextContent(string operate, string userID, string userRole, string schoolYear, string schoolCode, string itemCode)
 {
     try
     {
         ParameterSP0 parameter = new ParameterSP0 {
             Operate = operate, UserID = userID, ItemCode = itemCode, SchoolYear = schoolYear, SchoolCode = schoolCode
         };
         return(GeneralDataAccess.TextValue(sp, parameter));
     }
     catch (Exception ex)
     {
         var exm = ex.Message;
         return("");
     }
 }
示例#8
0
 public static string Title(string itemCode)
 {
     try
     {
         string       sp        = "dbo.tcdsb_PLF_FormData_WebAPI @Operate,@UserID,@UserRole,@SchoolYear,@SchoolCode,@ItemCode";
         ParameterSP0 parameter = new ParameterSP0 {
             Operate = "Title", ItemCode = itemCode
         };
         return(GeneralDataAccess.TextValue(sp, parameter));
     }
     catch (Exception ex)
     {
         var exm = ex.Message;
         return("Error Title");
     }
 }
示例#9
0
 public static string TitlebyCode(string itemCode)
 {
     try
     {
         string       sp        = "dbo.tcdsb_PLF_GetItemLabelNew @Operate,@UserID,@UserRole,@ItemCode";
         ParameterSP0 parameter = new ParameterSP0 {
             ItemCode = itemCode
         };
         return(GeneralDataAccess.TextValue(sp, parameter));
     }
     catch (Exception ex)
     {
         var exm = ex.Message;
         return("Error Title");
     }
 }
示例#10
0
 public static string TextContent(string operate, string userID, string userRole, string schoolYear, string schoolCode, string itemCode, string value)
 {
     try
     {
         ParameterSP0 parameter = new ParameterSP0 {
             Operate = operate, UserID = userID, ItemCode = itemCode, SchoolYear = schoolYear, SchoolCode = schoolCode, Value = value
         };
         return(GeneralDataAccess.TextValue(sp + ",@Value", parameter));
         // return FormContent.TextValue(operate, userID, userRole, itemCode, schoolYear, schoolCode, value);
         // return "Successfully";
     }
     catch (Exception ex)
     {
         var exm = ex.Message;
         return("Failed");
     }
 }
示例#11
0
        public static List <FormContent> ListofContent(string schoolYear, string schoolCode)
        {
            try
            {
                string       sp        = "dbo.tcdsb_PLF_FormData_WebAPI @Operate,@UserID,@UserRole,@SchoolYear,@SchoolCode";
                ParameterSP0 parameter = new ParameterSP0 {
                    Operate = "Content", UserID = "mif", SchoolYear = schoolYear, SchoolCode = schoolCode
                };
                List <FormContent> myList = GeneralDataAccess.GetListofTypeT <FormContent>(sp, parameter);

                return(myList);
            }
            catch (Exception ex)
            {
                var exm = ex.Message;
                return(null);
            }
        }
示例#12
0
        public static List <FormTitle> ListofTitle()
        {
            try
            {
                string       sp        = "dbo.tcdsb_PLF_FormData_WebAPI @Operate,@UserID,@UserRole";
                ParameterSP0 parameter = new ParameterSP0 {
                    Operate = "Title", UserID = "mif"
                };
                List <FormTitle> myList = GeneralDataAccess.GetTitleList(sp, parameter);

                return(myList);
            }
            catch (Exception ex)
            {
                var exm = ex.Message;
                return(null);
            }
        }