Exemplo n.º 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("班级号码应该为数字!");
                }
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
                    }
                }
            }
        }