Ejemplo n.º 1
0
        public static bool rd_update_insql(Reader r)
        {
            string sql = string.Format(
                "Update dbo.reader set rdPwd='{0}',rdType='{1}',rdName='{2}',rdSex='{3}',rdDept='{4}',rdStatus='{5}',rdPhoto='{6}',rdDateReg='{7}',rdEmail='{8}',rdPhone='{9}',rdQQ='{10}',rdBorrowQty='{11}',rdAdminRoles='{12}' where rdID='{13}'",
                r.rdPwd, r.rdType, r.rdName, r.rdSex, r.rdDept, r.rdStatus, r.rdPhoto, ReaderDAL.match(r.rdDateReg), r.rdEmail, r.rdPhone, r.rdQQ, r.rdBorrowQty, r.rdAdminRoles, r.rdID);

            //Console.WriteLine(sql);
            return(Sq_h.run_rn(sql) == 1 ? true : false);
        }
Ejemplo n.º 2
0
        public static bool ex_delete_insql(Borrow br)
        {
            try
            {
                Sq_h.run_rn(string.Format(
                                "Delete from dbo.borrow where BorrowID = '{0}')",
                                br.BorrowID));
                return(true);
            }
            catch (SqlException e)
            {
                return(false);

                throw new Exception(e.Message);
            }
        }
Ejemplo n.º 3
0
        public static bool ex_update_insql(Borrow br)
        {
            try
            {
                Sq_h.run_rn(string.Format(
                                "Update dbo.borrow set rdID = '{0}',bkID = '{1}',IdContinueTimes = '{2}',ldDateOut = '{3}',ldDateRetPlan = '{4}',ldDateRetAct  = '{5}',ldOverDay  = '{6}',ldOverMoney  = '{7}',ldPunishMoney = '{8}',IsHasReturn = '{9}',OperatorLend = '{10}',OperatorRet = '{11}' where BorrowID = '{12}'",
                                br.rdID, br.bkID, br.IdContinueTimes, Sq_h.match(br.ldDateOut), Sq_h.match(br.ldDateRetPlan), Sq_h.match(br.ldDateRetAct), br.ldOverDay, br.ldOverMoney, br.ldPunishMoney, br.IsHasReturn, br.OperatorLend, br.OperatorLend, br.BorrowID));
                return(true);
            }
            catch (SqlException e)
            {
                return(false);

                throw new Exception(e.Message);
            }
        }
Ejemplo n.º 4
0
        public static bool ex_insert_insql(Borrow br)
        {
            try
            {
                Sq_h.run_rn(string.Format(
                                "Insert into dbo.borrow (BorrowID,rdID,bkID,IdContinueTimes,ldDateOut,ldDateRetPlan,ldDateRetAct,ldOverDay,ldOverMoney,ldPunishMoney,IsHasReturn,OperatorLend,OperatorRet) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}')",
                                br.BorrowID, br.rdID, br.bkID, br.IdContinueTimes, Sq_h.match(br.ldDateOut), Sq_h.match(br.ldDateRetPlan), Sq_h.match(br.ldDateRetAct), br.ldOverDay, br.ldOverMoney, br.ldPunishMoney, br.IsHasReturn, br.OperatorLend, br.OperatorRet));
                return(true);
            }
            catch (SqlException e)
            {
                return(false);

                throw new Exception(e.Message);
            }
        }
Ejemplo n.º 5
0
        public static bool ex_delete_insql(ReaderType rt)
        {
            try
            {
                Sq_h.run_rn(string.Format(
                                "Delete from dbo.ReaderType where rdType = '{0}')",
                                rt.rdType));
                return(true);
            }
            catch (SqlException e)
            {
                return(false);

                throw new Exception(e.Message);
            }
        }
Ejemplo n.º 6
0
        public static bool ex_delete_insql(Book bk)
        {
            try
            {
                Sq_h.run_rn(string.Format(
                                "Delete from dbo.book where bkID = '{0}'", bk.bkID
                                ));
                return(true);
            }
            catch (SqlException e)
            {
                return(false);

                throw new Exception(e.Message);
            }
        }
Ejemplo n.º 7
0
        public static bool ex_update_insql(ReaderType rt)
        {
            try
            {
                Sq_h.run_rn(string.Format(
                                "Update dbo.readertype set rdTypeName = '{0}' , CanLendQty = '{1}',CanLendDay = '{2}',CanContinueTimes = '{3}',PunishRate = '{4}',DateValid = '{5}',where rdType = '{6}'",
                                rt.rdTypeName, rt.CanLendQty, rt.CanLendDay, rt.CanContinueTimes, (float)Convert.ToSingle(rt.PunishRate), rt.DateValid, rt.rdType
                                ));
                return(true);
            }
            catch (SqlException e)
            {
                return(false);

                throw new Exception(e.Message);
            }
        }
Ejemplo n.º 8
0
        public static bool ex_insert_insql(ReaderType rt)
        {
            try
            {
                Sq_h.run_rn(string.Format(
                                "Insert into dbo.readertype (rdType,rdTypeName,CanLendQty,CanLendDay,CanContinueTimes,PunishRate,DateValid) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}')",
                                rt.rdType, rt.rdTypeName, rt.CanLendQty, rt.CanLendDay, rt.CanContinueTimes, rt.PunishRate, rt.DateValid
                                ));
                return(true);
            }
            catch (SqlException e)
            {
                return(false);

                throw new Exception(e.Message);
            }
        }
Ejemplo n.º 9
0
        public static bool ex_update_insql(Book bk)
        {
            try
            {
                Sq_h.run_rn(string.Format(
                                "Update dbo.book Set bkCode='{0}',bkName='{1}',bkAuthor='{2}',bkPress ='{3}',bkDatePress='{4}',bkLanguage='{5}',bkPages='{6}',bkPrice='{7}', bkDateIn='{8}',bkBrief='{9}',bkCover='{10}',bkStatus = '{11}' where bkID = '{12}'",
                                bk.bkCode, bk.bkName, bk.bkAuthor, bk.bkPress, Sq_h.match(bk.bkDatePress), bk.bkLanguage, bk.bkPages, bk.bkPrice, Sq_h.match(bk.bkDateIn), bk.bkBrief, bk.bkCover, bk.bkStatus, bk.bkID
                                ));
                return(true);
            }
            catch (SqlException e)
            {
                return(false);

                throw new Exception(e.Message);
            }
        }
Ejemplo n.º 10
0
        public static bool ex_insert_insql(Book bk)
        {
            try
            {
                Sq_h.run_rn(string.Format(
                                "Insert into dbo.book (bkID,bkCode,bkName,bkAuthor,bkPress ,bkDatePress,bkLanguage,bkPages,bkPrice, bkDateIn,bkBrief,bkCover,bkStatus) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}')",
                                bk.bkID, bk.bkCode, bk.bkName, bk.bkAuthor, bk.bkPress, Sq_h.match(bk.bkDatePress), bk.bkLanguage, bk.bkPages, bk.bkPrice, Sq_h.match(bk.bkDateIn), bk.bkBrief, bk.bkCover, bk.bkStatus
                                ));
                return(true);
            }
            catch (SqlException e)
            {
                return(false);

                throw new Exception(e.Message);
            }
        }
Ejemplo n.º 11
0
        public static bool rd_insert_insql(Reader r)
        {
            string sql = "Insert into dbo.reader (rdID,rdPwd,rdType,rdName,rdSex,rdDept,rdStatus,rdPhoto,rdDateReg,rdEmail,rdPhone,rdQQ,rdBorrowQty,rdAdminRoles) values ('"
                         + r.rdID + "','"
                         + r.rdPwd + "','"
                         + r.rdType + "','"
                         + r.rdName + "','"
                         + r.rdSex + "','"
                         + r.rdDept + "','"
                         + r.rdStatus + "','"
                         + r.rdPhoto + "','"
                         + ReaderDAL.match(r.rdDateReg) + "','"
                         + r.rdEmail + "','"
                         + r.rdPhone + "','"
                         + r.rdQQ + "','"
                         + r.rdBorrowQty + "','"
                         + r.rdAdminRoles
                         + "')";

            return(Sq_h.run_rn(sql) == 1 ? true : false);
        }
Ejemplo n.º 12
0
        public static bool rd_delete_insql(Reader r)
        {
            string sql = "Delete from dbo.reader where rdID = '" + r.rdID + "'";

            return(Sq_h.run_rn(sql) != 1 ? false : true);
        }