Example #1
0
        public static String DeleteAllData(Regular_Registration_Data data)
        {
            string    str = "";
            string    query;
            ArrayList arr = new ArrayList();

            try
            {
                query = "exec [dbo].[DELETE_ALL_DATA] '',1";

                arr = DBConnection.selectRecord(query);


                if (arr.Count > 0)
                {
                    str = "Success";

                    return(str);
                }
                else
                {
                    str = "Error occur";

                    return(str);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
        public static ArrayList LoadRegularRegistrationData(Regular_Registration_Data data)
        {
            ArrayList arr = new ArrayList();
            string    query;

            try
            {
                query = "EXEC [dbo].[Autocomplete_Regular_Registration_Data] '" + data.Semester_Id + "',2";

                DataTable result = DBConnection.selectRecords(query);

                foreach (DataRow dtRow in result.Rows)
                {
                    Regular_Registration_Data rtn = new Regular_Registration_Data();
                    rtn.Semester_Id            = dtRow["Semester_Id"].ToString();
                    rtn.Semester_Name          = dtRow["Semester_Name"].ToString();
                    rtn.Payment_Start_Date     = dtRow["Payment_Start_Date"].ToString();
                    rtn.Payment_End_Date       = dtRow["Payment_End_Date"].ToString();
                    rtn.Semester_Start_Date    = dtRow["Semester_Start_Date"].ToString();
                    rtn.Semester_End_Date      = dtRow["Semester_End_Date"].ToString();
                    rtn.Semester_Fee           = dtRow["Semester_Fee"].ToString();
                    rtn.Late_Payment_Date_From = dtRow["Late_Payment_Date_From"].ToString(); // this is used to pass the subject list to the front end
                    rtn.Late_Payment_Date_To   = dtRow["Late_Payment_Date_To"].ToString();
                    rtn.Late_Payment_Fee       = dtRow["Late_Payment_Fee"].ToString();
                    arr.Add(rtn);
                }

                return(arr);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #3
0
        //here we create static methods api controllers to save data

        public static String SaveRegularRegistrationData(Regular_Registration_Data data)
        {
            string    str = "";
            string    query;
            ArrayList arr = new ArrayList();

            try
            {
                query = "exec [dbo].[Save_Regular_Registration_Data] '"
                        + data.Semester_Id + "','"
                        + data.Semester_Name + "','"
                        + data.Payment_Start_Date + "','"
                        + data.Payment_End_Date + "','"
                        + data.Semester_Start_Date + "','"
                        + data.Semester_End_Date + "','"
                        + data.Semester_Fee + "','"
                        + data.Late_Payment_Date_From + "','"
                        + data.Late_Payment_Date_To + "','"
                        + data.Late_Payment_Fee + "','"
                        + data.Status + "'";

                arr = DBConnection.selectRecord(query);


                if (arr.Count > 0)
                {
                    str = "Success";

                    return(str);
                }
                else
                {
                    str = "Error occur";

                    return(str);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public IHttpActionResult SaveProRataRegistrationData(Regular_Registration_Data data)
 {
     return(Ok(DA_AdminController.DeleteAllData(data)));
 }
 public IHttpActionResult GetNLPAnswerData(Regular_Registration_Data data)
 {
     return(Ok(DA_NLPFrontControllerController.GetNLPAnswerData(data)));
 }
Example #6
0
        public static Regular_Registration_Data GetNLPAnswerData(Regular_Registration_Data data)
        {
            try {
                Regular_Registration_Data Rtndata = new Regular_Registration_Data();
                string parameterOne = "";
                string parameterTwo = "";

                if (data.Semester_Id != null)
                {
                    parameterOne = data.Semester_Id.ToLower();
                }
                if (data.Semester_Name != null)
                {
                    parameterTwo = data.Semester_Name.ToLower();
                }
                ResponseObject response   = new ResponseObject();
                NLPCompromise  Compromise = new NLPCompromise();

                ArrayList Arlst = new ArrayList();
                string[]  test  = parameterOne.Split(',');
                int       count = test.Length;


                for (int i = 0; i < count; i++)
                {
                    if (test[i] != null && test[i] != "")
                    {
                        string[] testInner  = test[i].Split(' ');
                        int      countInner = testInner.Length;
                        //int index = 0;

                        for (int j = 0; j < countInner; j++)
                        {
                            if (testInner[j].Trim() != null && testInner[j].Trim() != "")
                            {
                                Arlst.Add(testInner[j].Trim());
                            }
                        }
                    }
                }

                response = Compromise.GetParameter(Arlst);
                DA_NLPFrontControllerController cont = new DA_NLPFrontControllerController();

                if (response.ParameterThree == "Test" || response.ParameterThree == "" || response.ParameterThree == null)
                {
                    string str = cont.ProcessNLP(response.ParameterOne, response.ParameterTwo);
                    Rtndata.Semester_Id = str;
                }
                else
                {
                    string str = cont.ProcessNLPForSubject(response.ParameterOne, response.ParameterTwo, response.ParameterFour, response.ParameterThree);
                    Rtndata.Semester_Id = str;
                }

                return(Rtndata);
            }
            catch (Exception ex) {
                Regular_Registration_Data Rtndata = new Regular_Registration_Data();
                string str = "Sorry there is no entry regarding this search";
                Rtndata.Semester_Id = str;
                return(Rtndata);

                throw ex;
            }
        }
 public IHttpActionResult SaveRegularRegistrationData(Regular_Registration_Data data)
 {
     return(Ok(DA_AdminController.SaveRegularRegistrationData(data)));
 }