Ejemplo n.º 1
0
 public List<SearchResourceCardResult> searchResourceDataBase(int index, SearchResourceCard SearchData)
 {
     CaseDataBase SDB = new CaseDataBase();
     return SDB.searchResourceDataBase(index, SearchData);
 }
Ejemplo n.º 2
0
    public string[] createStudentService(CreateStudentService StudentService)
    {
        string[] returnValue = new string[2];
        returnValue[0] = "0";
        returnValue[1] = "0";
        CaseDataBase CData = new CaseDataBase();
        DataBase Base = new DataBase();
        SqlConnection Sqlconn = new SqlConnection(Base.GetConnString());
        int viewStaff1 = 0;
        int viewStaff2 = 0;
        if (StudentService.viewStaff.Count < 2)
        {
            viewStaff1 = Chk.CheckStringtoIntFunction(StudentService.viewStaff[0]);
        }
        else if (StudentService.viewStaff.Count >= 2)
        {
            viewStaff1 = Chk.CheckStringtoIntFunction(StudentService.viewStaff[0]);
            viewStaff2 = Chk.CheckStringtoIntFunction(StudentService.viewStaff[1]);
        }
        using (Sqlconn)
        {
            try
            {
                StaffDataBase sDB = new StaffDataBase();
                List<string> CreateFileName = sDB.getStaffDataName(HttpContext.Current.User.Identity.Name);
                Sqlconn.Open();
                string sql = "INSERT INTO CaseServiceRecord(Unit, StudentID, ServiceDate, ServiceTime, Method, Theme, Objects, Place, Personnel1, Personnel2, Item, CreateFileBy, UpFileBy, UpFileDate ) " +
                    "VALUES (@Unit, @StudentID, @ServiceDate, @ServiceTime, @Method, @Theme, @Objects, @Place, @Personnel1, @Personnel2, @Item, @CreateFileBy, @UpFileBy, (getDate()) )";
                SqlCommand cmd = new SqlCommand(sql, Sqlconn);
                cmd.Parameters.Add("@Unit", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(CreateFileName[2]);
                cmd.Parameters.Add("@StudentID", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentService.studentID);
                cmd.Parameters.Add("@ServiceDate", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(StudentService.viewData);
                cmd.Parameters.Add("@ServiceTime", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentService.viewTime);
                cmd.Parameters.Add("@Method", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentService.viewStyle);
                cmd.Parameters.Add("@Theme", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentService.viewTitle);
                cmd.Parameters.Add("@Objects", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentService.viewPeople);
                cmd.Parameters.Add("@Place", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentService.viewPlace);
                cmd.Parameters.Add("@Personnel1", SqlDbType.Int).Value = viewStaff1;
                cmd.Parameters.Add("@Personnel2", SqlDbType.Int).Value = viewStaff2;
                cmd.Parameters.Add("@Item", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentService.viewContent);
                cmd.Parameters.Add("@CreateFileBy", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(CreateFileName[0]);
                cmd.Parameters.Add("@UpFileBy", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(CreateFileName[0]);
                returnValue[0] = cmd.ExecuteNonQuery().ToString();

                if (returnValue[0] != "0")
                {
                    sql = "select IDENT_CURRENT('CaseServiceRecord') AS cID";
                    cmd = new SqlCommand(sql, Sqlconn);
                    SqlDataReader dr = cmd.ExecuteReader();
                    while (dr.Read())
                    {
                        returnValue[1] = dr["cID"].ToString();
                    }
                    dr.Close();
                }

                Sqlconn.Close();
            }
            catch (Exception e)
            {
                returnValue[0] = "-1";
                returnValue[1] = e.Message;
            }
        }
        return returnValue;
    }
Ejemplo n.º 3
0
    public string[] createCaseISP(Int64 StuCaseDataID, CreateTeachISP StudentISP)
    {
        string[] returnValue = new string[2];
        returnValue[0] = "0";
        returnValue[1] = "0";
        CaseDataBase CData = new CaseDataBase();
        StudentResult getCaseData = CData.getStudentData(StuCaseDataID.ToString());
        DataBase Base = new DataBase();
        SqlConnection Sqlconn = new SqlConnection(Base.GetConnString());
        using (Sqlconn)
        {
            try
            {
                Sqlconn.Open();
                string sql = "INSERT INTO CaseISPstate (Unit, StudentID, PhysicalAndMentalDisabilityHandbook, DisabilityCategory1, DisabilityGrade1, DisabilityCategory2, DisabilityGrade2, "+
                    "DisabilityCategory3, DisabilityGrade3, NoDisabilityHandbook, ApplyDisabilityHandbook, DisabilityProve, AidsManagement, AidsManagementTextAge, "+
                    "HearingAids_R, AidsBrand_R, AidsOptionalTime_R, AidsOptionalLocation_R, EEarHospital_R, EEarImplants_R, EEarOpen_R, HearingAids_L, AidsBrand_L, "+
                    "AidsOptionalTime_L, AidsOptionalLocation_L, EEarHospital_L, EEarImplants_L, EEarOpen_L, AcceptClass, MedicalEducation, MedicalEducationText1, "+
                    "MedicalEducationText2, MedicalEducationText3, MedicalEducationText4, MedicalEducationText5, MedicalEducationText6, MedicalEducationText7," +
                    "ExecutionTimeSince, ExecutionTimeUntil, ParticipantDate1, ParticipantParent1, ParticipantTeache1, ParticipantSocialWorker1, ParticipantAudiologist1, "+
                    "ParticipantHead1, ParticipantProfessionals1, ParticipantDate2, ParticipantParent2, ParticipantTeache2, ParticipantSocialWorker2, ParticipantAudiologist2, "+
                    "ParticipantHead2, ParticipantProfessionals2, PlanWriter1, PlanWriteFrameDate1, PlanWriter2, PlanWriteFrameDate2, PlanWriter3, PlanWriteFrameDate3) " +
                    "VALUES (@Unit, @StudentID, @PhysicalAndMentalDisabilityHandbook, @DisabilityCategory1, @DisabilityGrade1, @DisabilityCategory2, @DisabilityGrade2, "+
                    "@DisabilityCategory3, @DisabilityGrade3, @NoDisabilityHandbook, @ApplyDisabilityHandbook, @DisabilityProve, @AidsManagement, @AidsManagementTextAge, "+
                    "@HearingAids_R, @AidsBrand_R, @AidsOptionalTime_R, @AidsOptionalLocation_R, @EEarHospital_R, @EEarImplants_R, @EEarOpen_R, @HearingAids_L, @AidsBrand_L, "+
                    "@AidsOptionalTime_L, @AidsOptionalLocation_L, @EEarHospital_L, @EEarImplants_L, @EEarOpen_L, @AcceptClass, @MedicalEducation, @MedicalEducationText1, "+
                    "@MedicalEducationText2, @MedicalEducationText3, @MedicalEducationText4, @MedicalEducationText5, @MedicalEducationText6, @MedicalEducationText7," +
                    "@ExecutionTimeSince, @ExecutionTimeUntil, @ParticipantDate1, @ParticipantParent1, @ParticipantTeache1, @ParticipantSocialWorker1, @ParticipantAudiologist1, "+
                    "@ParticipantHead1, @ParticipantProfessionals1, @ParticipantDate2, @ParticipantParent2, @ParticipantTeache2, @ParticipantSocialWorker2, "+
                    "@ParticipantAudiologist2, @ParticipantHead2, @ParticipantProfessionals2, @PlanWriter1, @PlanWriteFrameDate1, @PlanWriter2, @PlanWriteFrameDate2, @PlanWriter3, @PlanWriteFrameDate3)";
                SqlCommand cmd = new SqlCommand(sql, Sqlconn);
                cmd.Parameters.Add("@Unit", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(getCaseData.StudentData.caseStatu);
                cmd.Parameters.Add("@StudentID", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(getCaseData.StudentData.studentID);
                cmd.Parameters.Add("@PhysicalAndMentalDisabilityHandbook", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentISP.manualWhether);
                cmd.Parameters.Add("@DisabilityCategory1", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.manualCategory1);
                cmd.Parameters.Add("@DisabilityGrade1", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.manualGrade1);
                cmd.Parameters.Add("@DisabilityCategory2", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.manualCategory2);
                cmd.Parameters.Add("@DisabilityGrade2", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.manualGrade2);
                cmd.Parameters.Add("@DisabilityCategory3", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.manualCategory3);
                cmd.Parameters.Add("@DisabilityGrade3", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.manualGrade3);
                cmd.Parameters.Add("@NoDisabilityHandbook", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentISP.manualNo);
                cmd.Parameters.Add("@ApplyDisabilityHandbook", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.manualUnit);
                cmd.Parameters.Add("@DisabilityProve", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.studentManualImg);
                cmd.Parameters.Add("@AidsManagement", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentISP.assistmanage);
                cmd.Parameters.Add("@AidsManagementTextAge", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentISP.Accessory);
                cmd.Parameters.Add("@HearingAids_R", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentISP.assistmanageR);
                cmd.Parameters.Add("@AidsBrand_R", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentISP.BrandR1);
                cmd.Parameters.Add("@AidsOptionalTime_R", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(StudentISP.BuyingtimeR);
                cmd.Parameters.Add("@AidsOptionalLocation_R", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.BuyingPlaceR);
                cmd.Parameters.Add("@EEarHospital_R", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.InsertHospitalR);
                cmd.Parameters.Add("@EEarImplants_R", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(StudentISP.InsertDateR);
                cmd.Parameters.Add("@EEarOpen_R", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(StudentISP.OpenHzDateR);
                cmd.Parameters.Add("@HearingAids_L", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentISP.assistmanageL);
                cmd.Parameters.Add("@AidsBrand_L", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentISP.BrandL1);
                cmd.Parameters.Add("@AidsOptionalTime_L", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(StudentISP.BuyingtimeL);
                cmd.Parameters.Add("@AidsOptionalLocation_L", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.BuyingPlaceL);
                cmd.Parameters.Add("@EEarHospital_L", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.InsertHospitalL);
                cmd.Parameters.Add("@EEarImplants_L", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(StudentISP.InsertDateL);
                cmd.Parameters.Add("@EEarOpen_L", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(StudentISP.OpenHzDateL);
                cmd.Parameters.Add("@AcceptClass", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(StudentISP.edu);
                cmd.Parameters.Add("@MedicalEducation", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.edu1);
                cmd.Parameters.Add("@MedicalEducationText1", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.PandF1);
                cmd.Parameters.Add("@MedicalEducationText2", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.PandF2);
                cmd.Parameters.Add("@MedicalEducationText3", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.PandF3);
                cmd.Parameters.Add("@MedicalEducationText4", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.PandF4);
                cmd.Parameters.Add("@MedicalEducationText5", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.PandF5);
                cmd.Parameters.Add("@MedicalEducationText6", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.PandF6);
                cmd.Parameters.Add("@MedicalEducationText7", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.PandF7);
                cmd.Parameters.Add("@ExecutionTimeSince", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(StudentISP.startPlanDate);
                cmd.Parameters.Add("@ExecutionTimeUntil", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(StudentISP.endPlanDate);
                cmd.Parameters.Add("@ParticipantDate1", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(StudentISP.ServiceDate1);
                cmd.Parameters.Add("@ParticipantParent1", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.Parent1);
                cmd.Parameters.Add("@ParticipantTeache1", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(StudentISP.Teacher1);
                cmd.Parameters.Add("@ParticipantSocialWorker1", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(StudentISP.Sociality1);
                cmd.Parameters.Add("@ParticipantAudiologist1", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(StudentISP.ListenTutor1);
                cmd.Parameters.Add("@ParticipantHead1", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(StudentISP.Manager1);
                cmd.Parameters.Add("@ParticipantProfessionals1", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.RelationalPeople1);
                cmd.Parameters.Add("@ParticipantDate2", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(StudentISP.ServiceDate2); ;
                cmd.Parameters.Add("@ParticipantParent2", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.Parent2);
                cmd.Parameters.Add("@ParticipantTeache2", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(StudentISP.Teacher2);
                cmd.Parameters.Add("@ParticipantSocialWorker2", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(StudentISP.Sociality2);
                cmd.Parameters.Add("@ParticipantAudiologist2", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(StudentISP.ListenTutor2);
                cmd.Parameters.Add("@ParticipantHead2", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(StudentISP.Manager2);
                cmd.Parameters.Add("@ParticipantProfessionals2", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentISP.RelationalPeople2);
                cmd.Parameters.Add("@PlanWriter1", SqlDbType.Int).Value = HttpContext.Current.User.Identity.Name;
                cmd.Parameters.Add("@PlanWriteFrameDate1", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(StudentISP.startPlanDate);
                cmd.Parameters.Add("@PlanWriter2", SqlDbType.Int).Value = HttpContext.Current.User.Identity.Name;
                cmd.Parameters.Add("@PlanWriteFrameDate2", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(StudentISP.startPlanDate);
                cmd.Parameters.Add("@PlanWriter3", SqlDbType.Int).Value = HttpContext.Current.User.Identity.Name;
                cmd.Parameters.Add("@PlanWriteFrameDate3", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(StudentISP.startPlanDate);
                returnValue[0] = cmd.ExecuteNonQuery().ToString();

                if (returnValue[0] == "1")
                {
                    sql = "select IDENT_CURRENT('CaseISPstate') AS TID";
                    cmd = new SqlCommand(sql, Sqlconn);
                    SqlDataReader dr = cmd.ExecuteReader();
                    while (dr.Read())
                    {
                        returnValue[1] = dr["TID"].ToString();
                    }
                    dr.Close();
                }
                Sqlconn.Close();

            }
            catch (Exception e)
            {
                returnValue[0] = "-1";
                returnValue[1] = e.Message.ToString();
            }
        }
        return returnValue;
    }
Ejemplo n.º 4
0
 public string[] setStudentVisitDataBase(CreateStudentView StudentTracked)
 {
     CaseDataBase SDB = new CaseDataBase();
     if (int.Parse(SDB._StaffhaveRoles[1]) == 1)
     {
         return SDB.setStudentVisitData(StudentTracked);
     }
     else
     {
         return new string[2] { _noRole, _errorMsg };
     }
 }
Ejemplo n.º 5
0
 public string[] createStudentActivityData(createStudentActivity StudentData)
 {
     CaseDataBase SDB = new CaseDataBase();
     if (int.Parse(SDB._StaffhaveRoles[2]) == 1)
     {
         return SDB.createStudentActivityData(StudentData);
     }
     else
     {
         return new string[2] { _noRole, _errorMsg };
     }
 }
Ejemplo n.º 6
0
 public string[] setStudentDataBase6(StudentHearingInformation StudentHearingData)
 {
     Audiometry aDB = new Audiometry();
     CaseDataBase SDB = new CaseDataBase();
     //if (int.Parse(aDB._StaffhaveRoles[1]) == 1)
     //{
         return SDB.setStudentDataBase6(StudentHearingData);
     //}
     //else
     //{
     //    return new string[2] { _noRole, _errorMsg };
     //}
 }
Ejemplo n.º 7
0
 public string[] setStudentServiceData(CreateStudentService StudentService)
 {
     CaseDataBase SDB = new CaseDataBase();
     if (int.Parse(SDB._StaffhaveRoles[1]) == 1)
     {
         return SDB.setStudentService(StudentService);
     }
     else
     {
         return new string[2] { _noRole, _errorMsg };
     }
 }
Ejemplo n.º 8
0
 public List<SearchStudentServiceResult> SearchStudentServiceDataBase(int index, SearchStudentService SearchStructure)
 {
     CaseDataBase SDB = new CaseDataBase();
     return SDB.SearchStudentService(index, SearchStructure);
 }
Ejemplo n.º 9
0
 public List<SearchStudentTrackResult> SearchStudentTrackedDataBase(int index, SearchStudent SearchStructure)
 {
     CaseDataBase SDB = new CaseDataBase();
     return SDB.SearchStudentTracked(index, SearchStructure);
 }
Ejemplo n.º 10
0
 public List<SearchStudentAidResult> searchStudentAidData(int index, SearchStudentAid SearchData)
 {
     CaseDataBase SDB = new CaseDataBase();
     return SDB.searcStudentAidt(index, SearchData);
 }
Ejemplo n.º 11
0
 public List<SearchStudentResult> SearchStudentDataBase1(int index, SearchStudent SearchStructure)
 {
     CaseDataBase SDB = new CaseDataBase();
      return SDB.SearchStudent(index, SearchStructure, 1);
 }
Ejemplo n.º 12
0
 public List<SearchStudentActivityResult> SearchStudentActivityDataBase(int index, SearchStudentActivity SearchStructure)
 {
     CaseDataBase SDB = new CaseDataBase();
     return SDB.SearchStudentActivity(index, SearchStructure);
 }
Ejemplo n.º 13
0
    public List<string> SearchStudent(string SearchString)
    {
        CaseDataBase sDB = new CaseDataBase();

        // string SearchString = HttpContext.Current.Request["data"];
         return sDB.SearchStudent(SearchString);
    }
Ejemplo n.º 14
0
 public string[] searchResourceDataBaseCount(SearchResourceCard SearchData)
 {
     CaseDataBase SDB = new CaseDataBase();
     if (int.Parse(SDB._StaffhaveRoles[3]) == 1)
     {
         return SDB.SearchResourceDataCount(SearchData);
     }
     else
     {
         return new string[2] { _noRole, _errorMsg };
     }
 }
Ejemplo n.º 15
0
 public string[] setStudentActivityData(createStudentActivity StudentData, List<string> DelParticipantsID, List<string> NewParticipantsValue)
 {
     CaseDataBase SDB = new CaseDataBase();
     if (int.Parse(SDB._StaffhaveRoles[1]) == 1)
     {
         return SDB.setStudentActivityData(StudentData, DelParticipantsID, NewParticipantsValue);
     }
     else
     {
         return new string[2] { _noRole, _errorMsg };
     }
 }
Ejemplo n.º 16
0
 public List<SearchTransRecordResult> SearchStudentTransDataBase(int index, SearchTransRecord SearchStructure)
 {
     CaseDataBase SDB = new CaseDataBase();
     return SDB.SearchStudentTrans(index, SearchStructure);
 }
Ejemplo n.º 17
0
 public string[] setStudentDataBase4(StudentData4 StudentData)
 {
     CaseDataBase SDB = new CaseDataBase();
     //if (int.Parse(SDB._StaffhaveRoles[1]) == 1)
     //{
         return SDB.setStudentDataBase4(StudentData);
     //}
     //else
     //{
     //    return new string[2] { _noRole, _errorMsg };
     //}
 }
Ejemplo n.º 18
0
 public List<SearchVisitRecordResult> SearchStudentVisitDataBase(int index, SearchVisitRecord SearchStructure)
 {
     CaseDataBase SDB = new CaseDataBase();
     return SDB.SearchStudentVisitRecord(index, SearchStructure);
 }
Ejemplo n.º 19
0
 public string[] setStudentDataBase8(StudentBodyInformation StudentBody)
 {
     TeachDataBase aDB = new TeachDataBase();
     aDB.personnelFunction();
     CaseDataBase SDB = new CaseDataBase();
     //if (int.Parse(aDB._StaffhaveRoles[1]) == 1)
     //{
         return SDB.setStudentDataBase8(StudentBody);
     //}
     //else
     //{
     //    return new string[2] { _noRole, _errorMsg };
     //}
 }
Ejemplo n.º 20
0
 public string[] SearchStudentVisitDataBaseCount(SearchVisitRecord SearchStructure)
 {
     CaseDataBase SDB = new CaseDataBase();
     if (int.Parse(SDB._StaffhaveRoles[3]) == 1)
     {
         return SDB.SearchStudentVisitRecordCount(SearchStructure);
     }
     else
     {
         return new string[2] { _noRole, _errorMsg };
     }
 }
Ejemplo n.º 21
0
 public string[] setStudentTrackedRecord(TeackedData StudentTracked)
 {
     CaseDataBase SDB = new CaseDataBase();
     if (int.Parse(SDB._StaffhaveRoles[1]) == 1)
     {
         return SDB.setStudentTrackedRecord(StudentTracked);
     }
     else
     {
         return new string[2] { _noRole, _errorMsg };
     }
 }
Ejemplo n.º 22
0
 public List<CreateVolunteer> searchVolunteerDataBase(int index,SearchVolunteer SearchStructure)
 {
     CaseDataBase SDB = new CaseDataBase();
     return SDB.searchVolunteerData(index, SearchStructure);
 }
Ejemplo n.º 23
0
 public string[] setVolunteerServiceDataBase(CreateVolunteerService VolunteerData)
 {
     CaseDataBase SDB = new CaseDataBase();
     if (int.Parse(SDB._StaffhaveRoles[1]) == 1)
     {
         return SDB.setVolunteerServiceDataBase(VolunteerData);
     }
     else
     {
         return new string[2] { _noRole, _errorMsg };
     }
 }
Ejemplo n.º 24
0
 public string[] searchVolunteerDataBaseCount(SearchVolunteer SearchStructure)
 {
     CaseDataBase SDB = new CaseDataBase();
     if (int.Parse(SDB._StaffhaveRoles[3]) == 1)
     {
         return SDB.searchVolunteerDataCount(SearchStructure);
     }
     else
     {
         return new string[2] { _noRole, _errorMsg };
     }
 }
Ejemplo n.º 25
0
    public string[] setStudentService(CreateStudentService StudentService)
    {
        string[] returnValue = new string[2];
        returnValue[0] = "0";
        returnValue[1] = "0";
        CaseDataBase CData = new CaseDataBase();
        DataBase Base = new DataBase();
        SqlConnection Sqlconn = new SqlConnection(Base.GetConnString());
        int viewStaff1 = 0;
        int viewStaff2 = 0;
        if (StudentService.viewStaff.Count < 2 && StudentService.viewStaff.Count != 0)
        {
            viewStaff1 = Chk.CheckStringtoIntFunction(StudentService.viewStaff[0]);
        }
        else if (StudentService.viewStaff.Count >= 2)
        {
            viewStaff1 = Chk.CheckStringtoIntFunction(StudentService.viewStaff[0]);
            viewStaff2 = Chk.CheckStringtoIntFunction(StudentService.viewStaff[1]);
        }
        using (Sqlconn)
        {
            try
            {
                StaffDataBase sDB = new StaffDataBase();
                List<string> CreateFileName = sDB.getStaffDataName(HttpContext.Current.User.Identity.Name);
                Sqlconn.Open();
                string sql = "UPDATE CaseServiceRecord SET ServiceDate=@ServiceDate, ServiceTime=@ServiceTime, Method=@Method, Theme=@Theme, Objects=@Objects, " +
                    "Place=@Place, Personnel1=@Personnel1, Personnel2=@Personnel2, Item=@Item, UpFileBy=@UpFileBy, UpFileDate=(getDate()) " +
                    "WHERE ID=@ID";
                SqlCommand cmd = new SqlCommand(sql, Sqlconn);
                cmd.Parameters.Add("@ID", SqlDbType.BigInt).Value = Chk.CheckStringtoIntFunction(StudentService.ID);
                cmd.Parameters.Add("@ServiceDate", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(StudentService.viewData);
                cmd.Parameters.Add("@ServiceTime", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentService.viewTime);
                cmd.Parameters.Add("@Method", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(StudentService.viewStyle);
                cmd.Parameters.Add("@Theme", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentService.viewTitle);
                cmd.Parameters.Add("@Objects", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentService.viewPeople);
                cmd.Parameters.Add("@Place", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentService.viewPlace);
                cmd.Parameters.Add("@Personnel1", SqlDbType.Int).Value = viewStaff1;
                cmd.Parameters.Add("@Personnel2", SqlDbType.Int).Value = viewStaff2;
                cmd.Parameters.Add("@Item", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(StudentService.viewContent);
                cmd.Parameters.Add("@UpFileBy", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(CreateFileName[0]);
                returnValue[0] = cmd.ExecuteNonQuery().ToString();

                Sqlconn.Close();
            }
            catch (Exception e)
            {
                returnValue[0] = "-1";
                returnValue[1] = e.Message;
            }
        }
        return returnValue;
    }
Ejemplo n.º 26
0
 public string[] searcStudentAidDataCount(SearchStudentAid SearchData)
 {
     CaseDataBase SDB = new CaseDataBase();
     if (int.Parse(SDB._StaffhaveRoles[3]) == 1)
     {
         return SDB.searcStudentAidCount(SearchData);
     }
     else
     {
         return new string[2] { _noRole, _errorMsg };
     }
 }
    public string[] createPropertyRecordData(CreatePropertyRecord propertyRecordData)
    {
        string[] returnValue = new string[2];
        returnValue[0] = "0";
        returnValue[1] = "0";
        DataBase Base = new DataBase();
        using (SqlConnection Sqlconn = new SqlConnection(Base.GetConnString()))
        {
            try
            {
                StaffDataBase sDB = new StaffDataBase();
                List<string> CreateFileName = sDB.getStaffDataName(HttpContext.Current.User.Identity.Name);
                Sqlconn.Open();
                string sql = "INSERT INTO PropertyRecord (WriteDate, Unit, PropertyState, PropertyAddImpairment, PropertyChangeState, PropertyID, " +
                    "Code, ApplyID, Category, PropertyName, Label, ItemUnit, Quantity, Fitting, Location, Custody, ScrapDate, " +
                    "Summons, Receipt, Accounting, RecordedDate, OutDate, FundSource, FundSourceAssist, FundSourceDonate, PurchaseDate, " +
                    "Residual, PurchaseSource, ExpirationDate, Price, Depreciation, SinceFundraising, Procurement, Grants, Remark, " +
                    "CreateFileBy, CreateFileDate, UpFileBy, UpFileDate, isDeleted) VALUES " +
                    "(@WriteDate, @Unit, @PropertyState, @PropertyAddImpairment, @PropertyChangeState, @PropertyID, " +
                    "@Code, @ApplyID, @Category, @PropertyName, @Label, @ItemUnit, @Quantity, @Fitting, @Location, @Custody, @ScrapDate, " +
                    "@Summons, @Receipt, @Accounting, @RecordedDate, @OutDate, @FundSource, @FundSourceAssist, @FundSourceDonate, @PurchaseDate, " +
                    "@Residual, @PurchaseSource, @ExpirationDate, @Price, @Depreciation, @SinceFundraising, @Procurement, @Grants, @Remark, " +
                    "@CreateFileBy, (getDate()), @UpFileBy, (getDate()), 0)";
                SqlCommand cmd = new SqlCommand(sql, Sqlconn);
                cmd.Parameters.Add("@WriteDate", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(propertyRecordData.fillInDate);
                cmd.Parameters.Add("@Unit", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(CreateFileName[2]);
                cmd.Parameters.Add("@PropertyState", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(propertyRecordData.propertyStatus);
                cmd.Parameters.Add("@PropertyAddImpairment", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(propertyRecordData.propertyChange);
                cmd.Parameters.Add("@PropertyChangeState", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(propertyRecordData.changeStatus);
                cmd.Parameters.Add("@PropertyID", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(propertyRecordData.propertyID);
                cmd.Parameters.Add("@Code", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(propertyRecordData.propertyCode);
                cmd.Parameters.Add("@ApplyID", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(propertyRecordData.applyID);
                cmd.Parameters.Add("@Category", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(propertyRecordData.propertyCategory);
                cmd.Parameters.Add("@PropertyName", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(propertyRecordData.propertyName);
                cmd.Parameters.Add("@Label", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(propertyRecordData.propertyLabel);
                cmd.Parameters.Add("@ItemUnit", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(propertyRecordData.propertyUnit);
                cmd.Parameters.Add("@Quantity", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(propertyRecordData.propertyQuantity);
                cmd.Parameters.Add("@Fitting", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(propertyRecordData.propertyFitting);
                cmd.Parameters.Add("@Location", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(propertyRecordData.propertyLocation);
                cmd.Parameters.Add("@Custody", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(propertyRecordData.propertyCustody);
                cmd.Parameters.Add("@ScrapDate", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(propertyRecordData.stopDate);
                cmd.Parameters.Add("@Summons", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(propertyRecordData.propertySummons);
                cmd.Parameters.Add("@Receipt", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(propertyRecordData.propertyReceipt);
                cmd.Parameters.Add("@Accounting", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(propertyRecordData.propertyAccounting);
                cmd.Parameters.Add("@RecordedDate", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(propertyRecordData.inputDate);
                cmd.Parameters.Add("@OutDate", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(propertyRecordData.outputDate);
                cmd.Parameters.Add("@FundSource", SqlDbType.TinyInt).Value = Chk.CheckStringtoIntFunction(propertyRecordData.fundSource);
                cmd.Parameters.Add("@FundSourceAssist", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(propertyRecordData.fundAssist);
                cmd.Parameters.Add("@FundSourceDonate", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(propertyRecordData.fundDonate);
                cmd.Parameters.Add("@PurchaseDate", SqlDbType.Date).Value = Chk.CheckStringtoDateFunction(propertyRecordData.buyDate);
                cmd.Parameters.Add("@Residual", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(propertyRecordData.Remnants);
                cmd.Parameters.Add("@PurchaseSource", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(propertyRecordData.buySource);
                cmd.Parameters.Add("@ExpirationDate", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(propertyRecordData.userYear);
                cmd.Parameters.Add("@Price", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(propertyRecordData.propertyPrice);
                cmd.Parameters.Add("@Depreciation", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(propertyRecordData.Depreciation);
                cmd.Parameters.Add("@SinceFundraising", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(propertyRecordData.selfFunds);
                cmd.Parameters.Add("@Procurement", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(propertyRecordData.Purchaser);
                cmd.Parameters.Add("@Grants", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(propertyRecordData.Grant);
                cmd.Parameters.Add("@Remark", SqlDbType.NVarChar).Value = Chk.CheckStringFunction(propertyRecordData.Remark);
                cmd.Parameters.Add("@CreateFileBy", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(CreateFileName[0]);
                cmd.Parameters.Add("@UpFileBy", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(CreateFileName[0]);

                returnValue[0] = cmd.ExecuteNonQuery().ToString();
                if (returnValue[0] != "0")
                {
                    string FieldName = "PropertDB_" + CreateFileName[2];
                    sql = "SELECT IDENT_CURRENT('PropertyRecord') AS pID " +
                          "UPDATE AutomaticNumberTable SET " + FieldName + "=" + FieldName + "+1 WHERE ID=1 ";
                    cmd = new SqlCommand(sql, Sqlconn);
                    SqlDataReader dr = cmd.ExecuteReader();
                    while (dr.Read())
                    {
                        returnValue[1] = dr["pID"].ToString();
                    }
                    dr.Close();

                    /*sql = "SELECT Count(*) AS QCOUNT FROM PropertyRecord WHERE isDeleted=0";
                    cmd = new SqlCommand(sql, Sqlconn);
                    string stuNumber = cmd.ExecuteScalar().ToString();
                    string stuIDName = CreateFileName[2] + stuNumber.PadLeft(4, '0');*/
                    CaseDataBase SDB = new CaseDataBase();
                    string stuNumber = SDB.getUnitAutoNumber(FieldName);
                    string stuIDName = CreateFileName[2] + stuNumber.PadLeft(4, '0');

                    sql = "UPDATE PropertyRecord SET Code=(@Code), UpFileBy=@UpFileBy, UpFileDate=(getDate()) WHERE RecordID=(@RecordID) AND isDeleted=0";
                    cmd = new SqlCommand(sql, Sqlconn);
                    cmd.Parameters.Add("@RecordID", SqlDbType.BigInt).Value = Chk.CheckStringtoInt64Function(returnValue[1]);
                    cmd.Parameters.Add("@Code", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(stuIDName);
                    cmd.Parameters.Add("@UpFileBy", SqlDbType.Int).Value = Chk.CheckStringtoIntFunction(CreateFileName[0]);
                    returnValue[0] = cmd.ExecuteNonQuery().ToString();
                }
                Sqlconn.Close();
            }
            catch (Exception e)
            {
                returnValue[0] = "-1";
                returnValue[1] = e.Message.ToString();
            }
        }
        return returnValue;
    }
Ejemplo n.º 28
0
 public string[] setResourceDataBase(CreateResourceCard StructData)
 {
     CaseDataBase SDB = new CaseDataBase();
     if (int.Parse(SDB._StaffhaveRoles[1]) == 1)
     {
         return SDB.setResourceData(StructData);
     }
     else
     {
         return new string[2] { _noRole, _errorMsg };
     }
 }
 public string[] searchUserDataCardNum(SearchUser userData)
 {
     string[] returnValue = new string[4];
     returnValue[0] = "0";
     returnValue[1] = "";
     returnValue[2] = "0"; //
     returnValue[3] = "";
     DataBase Base = new DataBase();
     using (SqlConnection Sqlconn = new SqlConnection(Base.GetConnString()))
     {
         try
         {
             StaffDataBase sDB = new StaffDataBase();
             CaseDataBase cDB = new CaseDataBase();
             List<string> CreateFileName = sDB.getStaffDataNameCardNum(userData.txtpeopleID);
             if (CreateFileName[1].Length == 0)
             {
                 CreateFileName = cDB.getStudentDataName(userData.txtpeopleID);
                 if (CreateFileName[1].Length != 0)
                 {
                     CreateFileName[2] = "2";
                 }
                 else
                 {
                     CreateFileName[0] = "0";
                 }
             }
             else
             {
                 CreateFileName[2] = "1";
             }
             returnValue[0] = CreateFileName[0];
             returnValue[1] = CreateFileName[1];
             returnValue[2] = CreateFileName[2];
             returnValue[3] = CreateFileName[3];
         }
         catch (Exception e)
         {
             returnValue[0] = "-1";
             returnValue[1] = e.Message.ToString();
             returnValue[2] = "0";
         }
     }
     return returnValue;
 }
Ejemplo n.º 30
0
 public string[] SearchHearingLossPreschoolCount(SearchStudent SearchStructure)
 {
     CaseDataBase SDB = new CaseDataBase();
      if (int.Parse(SDB._StaffhaveRoles[3]) == 1)
      {
          return SDB.SearchHearingLossPreschoolCount(SearchStructure, 1);
      }
      else
      {
          return new string[2] { _noRole, _errorMsg };
      }
 }