示例#1
0
        public static int UpdateInformation(A2ZWEEKHOLIDAYDTO dto)
        {
            dto.HolWeekDayName1 = (dto.HolWeekDayName1 != null) ? dto.HolWeekDayName1.Trim().Replace("'", "''") : "";
            dto.HolWeekDayName2 = (dto.HolWeekDayName2 != null) ? dto.HolWeekDayName2.Trim().Replace("'", "''") : "";
            int    rowEffect = 0;
            string strQuery  = "UPDATE A2ZWEEKHOLIDAY set HolWeekDay1='" + dto.HolWeekDay1 + "',HolWeekDay2='" + dto.HolWeekDay2 + "',HolWeekDayName1='" + dto.HolWeekDayName1 + "',HolWeekDayName2='" + dto.HolWeekDayName2 + "'";

            rowEffect = Converter.GetInteger(BLL.CommonManager.Instance.ExecuteNonQuery(strQuery, "A2ZHKCUBS"));
            if (rowEffect == 0)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
示例#2
0
        public static int InsertInformation(A2ZWEEKHOLIDAYDTO dto)
        {
            dto.HolWeekDayName1 = (dto.HolWeekDayName1 != null) ? dto.HolWeekDayName1.Trim().Replace("'", "''") : "";
            dto.HolWeekDayName2 = (dto.HolWeekDayName2 != null) ? dto.HolWeekDayName2.Trim().Replace("'", "''") : "";
            int    rowEffect = 0;
            string strQuery  = @"INSERT into A2ZWEEKHOLIDAY(HolWeekDay1,HolWeekDay2,HolWeekDayName1,HolWeekDayName2)values('" + dto.HolWeekDay1 + "','" + dto.HolWeekDay2 + "', '" + dto.HolWeekDayName1 + "','" + dto.HolWeekDayName2 + "')";

            rowEffect = Converter.GetInteger(BLL.CommonManager.Instance.ExecuteNonQuery(strQuery, "A2ZHKCUBS"));

            if (rowEffect == 0)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
示例#3
0
        public static A2ZWEEKHOLIDAYDTO GetInformation()
        {
            DataTable dt = BLL.CommonManager.Instance.GetDataTableByQuery("SELECT * FROM A2ZWEEKHOLIDAY", "A2ZHKCUBS");


            var p = new A2ZWEEKHOLIDAYDTO();

            if (dt.Rows.Count > 0)
            {
                p.HolWeekDay1     = Converter.GetSmallInteger(dt.Rows[0]["HolWeekDay1"]);
                p.HolWeekDay2     = Converter.GetSmallInteger(dt.Rows[0]["HolWeekDay2"]);
                p.HolWeekDayName1 = Converter.GetString(dt.Rows[0]["HolWeekDayName1"]);
                p.HolWeekDayName2 = Converter.GetString(dt.Rows[0]["HolWeekDayName2"]);
                p.Record          = 1;
                return(p);
            }
            p.Record = 0;

            return(p);
        }