Exemplo n.º 1
0
 public bool update_by_index()
 {
     try
     {
         SqlHealper sh = new SqlHealper();
         sh.ExecuteCMD("update tbl_P  set P_ID = '" + this.ID + "',P_Name = '" + this.Name + "',P_Sex = '" + this.Sex + "',P_Birthday = '" + this.Birthday.ToShortDateString() + "',P_Jobday = '" + this.Jobday.ToShortDateString() + "',P_Education = '" + this.Education + "',P_Department = '" + this.Department + "',P_Duty = '" + this.Duty + "',P_Jobtype = '" + this.Jobtype + "' where P_index = " + this.index.ToString());
     }
     catch {
         return(false);
     }
     return(true);
 }
Exemplo n.º 2
0
        public bool add()
        {
            try
            {
                SqlHealper sh = new SqlHealper();
                sh.ExecuteCMD(
                    "insert into tbl_U( U_ID, U_Name, U_Pwd, U_Role, U_Limit)" +
                    "values" +
                    "('" + this.ID + "','" + this.Name + "','" + this.Pwd + "'," + this.Role.ToString() + "," + this.Limit.ToString() + ")"
                    );
            }
            catch
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 3
0
        public bool add()
        {
            try
            {
                SqlHealper sh = new SqlHealper();
                sh.ExecuteCMD(
                    "insert into tbl_M" +
                    "(M_ID, M_Classify, M_MakePrice, M_SellPrice, M_Unit, M_Memo)" +
                    "values" +
                    "('" + this.ID + "','" + this.Classify + "','" + this.MakePrice + "','" + this.SellPrice + "','" + this.Unit + "','" + this.Memo + "')"
                    );
            }
            catch
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            string user = "", passwd = "", domain = "", database = "";

            XmlReader.Read(ref domain, ref user, ref passwd, ref database);
            Console.WriteLine("user = "******"passwd = " + passwd);
            Console.WriteLine("domain = " + domain);


            SqlHealper sh = new SqlHealper();

            sh.ExecuteCMD("update tbl_P set P_Jobtype='管理' where P_ID='test1'");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());

            Console.ReadLine();
        }
Exemplo n.º 5
0
        public bool add()
        {
            try
            {
                SqlHealper sh = new SqlHealper();
                sh.ExecuteCMD(
                    "INSERT INTO tbl_P(" +
                    "P_ID , P_Name , P_Sex , P_Birthday , P_Jobday , P_Education , P_Department , P_Duty , P_Jobtype " +
                    ")values(" +
                    "'" + this.ID + "','" + this.Name + "','" + this.Sex + "','" + this.Birthday.ToShortDateString() + "','" + this.Jobday.ToShortDateString() + "','" + this.Education + "','" + this.Department + "','" + this.Duty + "','" + this.Jobtype + "'" +
                    ")"
                    );
            }
            catch
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 6
0
 public bool update_by_index()
 {
     try
     {
         SqlHealper sh = new SqlHealper();
         sh.ExecuteCMD(
             "update tbl_U " +
             "set U_ID = '" + this.ID + "'," +
             "U_Name = '" + this.Name + "'," +
             "U_pwd = '" + this.Pwd + "'," +
             "U_role = '" + this.Role + "'," +
             "U_Limit = '" + this.Limit + "'" +
             " where U_index = " + this.index.ToString()
             );
     }
     catch
     {
         return(false);
     }
     return(true);
 }
Exemplo n.º 7
0
 public bool update_by_index()
 {
     try
     {
         SqlHealper sh = new SqlHealper();
         sh.ExecuteCMD(
             "update tbl_M " +
             "set M_ID = '" + this.ID + "'," +
             "M_Classify = '" + this.Classify + "'," +
             "M_MakePrice = '" + this.MakePrice + "'," +
             "M_SellPrice = '" + this.SellPrice + "'," +
             "M_Unit = '" + this.Unit + "'," +
             "M_Memo = '" + this.Memo + "' " +
             "where M_index = " + this.index
             );
     }
     catch
     {
         return(false);
     }
     return(true);
 }
Exemplo n.º 8
0
        public void delete_by_index()
        {
            SqlHealper sh = new SqlHealper();

            sh.ExecuteCMD("delete tbl_P where P_index = " + this.index.ToString());
        }
Exemplo n.º 9
0
        public static void delete_by_index(string index)
        {
            SqlHealper sh = new SqlHealper();

            sh.ExecuteCMD("delete tbl_U where U_index = " + index.ToString());
        }