Beispiel #1
0
        public string CheckIsClassExists(string getGrade, string getClass, ref bool isOk)
        {
            using (OptionDataAccess optionDataAccess = new OptionDataAccess())
            {
                try
                {
                    int gradeNumber = Convert.ToInt32(getGrade.Replace(" ", ""));
                    int classNumber = Convert.ToInt32(getClass.Replace(" ", ""));

                    DataTable dtClass = optionDataAccess.IsExistClass(gradeNumber, classNumber);

                    if (dtClass.Rows.Count > 0)
                    {
                        isOk = true;
                        return("ok");
                    }
                    else
                    {
                        isOk = false;
                        return("班级不存在请重试!");
                    }
                }
                catch (Exception e)
                {
                    isOk = false;
                    Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
                    return("班级号码应该为数字!");
                }
            }
        }
Beispiel #2
0
        public bool UpdateStudentForGradeChange(string getName, int getGrade, int getClass, string getType)
        {
            using (OptionDataAccess optionDataAccess = new OptionDataAccess())
            {
                bool rtnValue = false;
                try
                {
                    int isStudentExisits = optionDataAccess.UpdateStudentForGradeChange(getName, getGrade, getClass, getType);

                    if (isStudentExisits != 0)
                    {
                        rtnValue = true;
                    }
                    else
                    {
                        rtnValue = false;
                    }
                }
                catch (Exception e)
                {
                    Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
                    rtnValue = false;
                }

                return(rtnValue);
            }
        }
Beispiel #3
0
 public void InsertMachine(string terminalNumbers, string machineVol)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             optionDataAccess.InsertMachine(terminalNumbers, machineVol);
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
         }
     }
 }
Beispiel #4
0
 public void InsertTeaInfo(Option option)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             optionDataAccess.InsertTeaInfo(option);
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
         }
     }
 }
Beispiel #5
0
 public void AddOrUpdateBackupPath(string path)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             optionDataAccess.AddOrUpdateBackupPath(path);
         }
         catch (Exception ex)
         {
             Util.WriteLog(ex.Message, Util.EXCEPTION_LOG_TITLE);
         }
     }
 }
Beispiel #6
0
 public void WriteStuCardInfoXLS(string getPath)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             optionRules.WriteStuCardInfoXLS(optionDataAccess.GetStuInfo(), getPath);
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
         }
     }
 }
Beispiel #7
0
 public int UpdateTeaCardInfo(string getID, string getNumber, int getSeq, DateTime getDate)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             return(optionDataAccess.UpdateTeaCardInfo(getID, getNumber, getSeq, getDate));
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
             return(0);
         }
     }
 }
Beispiel #8
0
 public int UpdateTeaInfo(string getID, string getName, string getNumber, string getDept, string getDuty, string getGender)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             return(optionDataAccess.UpdateTeaInfo(getID, getName, getNumber, getDept, getDuty, getGender));
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
             return(0);
         }
     }
 }
Beispiel #9
0
 private int UpdateStudentInfo(Option option)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             return(optionDataAccess.UpdateStudentInfo(option));
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
             return(0);
         }
     }
 }
Beispiel #10
0
 public int DeleteClassInfo(string getOriClassNumber, string getOriGradeNumber)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             return(optionDataAccess.DeleteClassInfo(getOriClassNumber, getOriGradeNumber));
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
             return(0);
         }
     }
 }
Beispiel #11
0
 public int UpdateGradeInfo(string getOriNumber, string getChNumber, string getChName, string getChRemark)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             return(optionDataAccess.UpdateGradeInfo(getOriNumber, getChNumber, getChName, getChRemark));
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
             return(0);
         }
     }
 }
Beispiel #12
0
 public DataSet GetMachine()
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             return(optionDataAccess.GetMachine());
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
             return(null);
         }
     }
 }
Beispiel #13
0
 public int DeleteTeaCardInfo(string getID, int getSeq)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             return(optionDataAccess.DeleteTeaCardInfo(getID, getSeq));
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
             return(0);
         }
     }
 }
Beispiel #14
0
 public int DeleteMachineInfo(int getMachineAddr, int getMachineType)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             return(optionDataAccess.DeleteMachineInfo(getMachineAddr, getMachineType));
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
             return(0);
         }
     }
 }
Beispiel #15
0
 public int InsertMachine(string getAddr, string getType, string getVol)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             return(optionDataAccess.InsertMachine(getAddr, getType, getVol));
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
             return(-1);
         }
     }
 }
Beispiel #16
0
 public int InsertTeaCardInfo(string getID, string getCardNumber, DateTime getCardSendDate, int getCardSeq)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             return(optionDataAccess.InsertTeaCardInfo(getID, getCardNumber, getCardSendDate, getCardSeq));
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
             return(0);
         }
     }
 }
Beispiel #17
0
 public DataSet GetTeaBasicInfo(string getDept, string getDuty, string getName, string getNumber)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             return(optionDataAccess.GetTeaBasicInfo(getDept, getDuty, getName, getNumber));
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
             return(null);
         }
     }
 }
Beispiel #18
0
 public int InsertStuInfo(Option option)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             return(optionDataAccess.InsertStuInfo(option));
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
             return(0);
         }
     }
 }
Beispiel #19
0
 public DataTable GetStuNameByNumber(string stuNumber)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             return(optionDataAccess.GetStuNameByNumber(stuNumber));
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
             return(null);
         }
     }
 }
Beispiel #20
0
 public DataSet GetStuCard(string getGrade, string getClass, string getName, string getNumber, string getCardNumber)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             return(optionDataAccess.GetStuCard(getGrade, getClass, getName, getNumber, getCardNumber));
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
             return(null);
         }
     }
 }
Beispiel #21
0
 public int UpdateClassNameByNumber(string getGradeNumber, string getClassNumber, string getClassName)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             return(optionDataAccess.UpdateClassNameByNumber(getGradeNumber, getClassNumber, getClassName));
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
             return(-1);
         }
     }
 }
Beispiel #22
0
 public int InsertNewStudentForGradeChange(string stuName, int stuGrade, int stuClass, string stuType)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             return(optionDataAccess.InsertNewStudentForGradeChange(stuName, stuGrade, stuClass, stuType));
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
             return(-1);
         }
     }
 }
Beispiel #23
0
 public DataTable GetClassNumberList(string getGradeNumber)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             return(optionDataAccess.GetClassNumberList(getGradeNumber));
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
             return(null);
         }
     }
 }
Beispiel #24
0
 public DataSet getClassInfo(string className, string classNumber, string gradeNumber, bool isForStu)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             return(optionDataAccess.GetClassList(className, classNumber, gradeNumber, isForStu));
         }
         catch (Exception e)
         {
             Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
             return(null);
         }
     }
 }
Beispiel #25
0
 public bool AddBackupJob(int type, string root)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             optionDataAccess.AddBackupJob(type, root);
             return(true);
         }
         catch (Exception ex)
         {
             Util.WriteLog(ex.Message, Util.EXCEPTION_LOG_TITLE);
             return(false);
         }
     }
 }
Beispiel #26
0
 public bool ExecuteRestoreDiff(string root)
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             optionDataAccess.ExecuteRestoreDiff(root);
             return(true);
         }
         catch (Exception ex)
         {
             Util.WriteLog(ex.Message, Util.EXCEPTION_LOG_TITLE);
             return(false);
         }
     }
 }
Beispiel #27
0
 public bool ExecuteKillSysdbProcesses()
 {
     using (OptionDataAccess optionDataAccess = new OptionDataAccess())
     {
         try
         {
             optionDataAccess.KillSysdbProcesses();
             return(true);
         }
         catch (Exception ex)
         {
             Util.WriteLog(ex.Message, Util.EXCEPTION_LOG_TITLE);
             return(false);
         }
     }
 }
Beispiel #28
0
        public string GetBackupPath()
        {
            var backupPath = string.Empty;

            using (OptionDataAccess optionDataAccess = new OptionDataAccess())
            {
                try
                {
                    backupPath = optionDataAccess.GetBackupPath();
                }
                catch (Exception ex)
                {
                    Util.WriteLog(ex.Message, Util.EXCEPTION_LOG_TITLE);
                }
                return(backupPath);
            }
        }
Beispiel #29
0
        static void Main(string[] args)
        {
            var traditional = new TraditionalDataAccess();
            var withOption  = new OptionDataAccess();

            while (true)
            {
                Console.Write("Input, please: ");
                var data = Console.ReadLine();
                if (String.IsNullOrEmpty(data))
                {
                    continue;
                }

                Console.WriteLine();
                Console.WriteLine("TRADTIONAL:");
                HandleInput(data, traditional);
                Console.WriteLine("----------------------------------------------");
                Console.WriteLine("WITH OPTION:");

                HandleInput(data, withOption);
            }
        }
Beispiel #30
0
        public int UpdateMachineInfo(int getOriMachineAddr, int getOriMachineType, int getChMachineAddr, int getChMachineType, int getChMachineVol)
        {
            using (OptionDataAccess optionDataAccess = new OptionDataAccess())
            {
                try
                {
                    return(optionDataAccess.UpdateMachineInfo(getOriMachineAddr, getOriMachineType, getChMachineAddr, getChMachineType, getChMachineVol));
                }
                catch (Exception e)
                {
                    Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);

                    if (e.Message.IndexOf("重复键") > 0)
                    {
                        return(-1);
                    }
                    else
                    {
                        return(0);
                    }
                }
            }
        }