示例#1
0
        public static int UpdateInformation(A2ZITEMSDTO dto)
        {
            dto.ItemsName = (dto.ItemsName != null) ? dto.ItemsName.Trim().Replace("'", "''") : "";
            int    rowEffect = 0;
            string strQuery  = "UPDATE A2ZITEMSCODE set ItemsCode='" + dto.ItemsCode + "',ItemsName='" + dto.ItemsName + "' where ItemsCode='" + dto.ItemsCode + "'";

            rowEffect = Converter.GetInteger(BLL.CommonManager.Instance.ExecuteNonQuery(strQuery, "A2ZACOMS"));
            if (rowEffect == 0)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
示例#2
0
        public static A2ZITEMSDTO GetInformation(int ItemsCode)
        {
            DataTable dt = BLL.CommonManager.Instance.GetDataTableByQuery("SELECT * FROM A2ZITEMSCODE WHERE ItemsCode = " + ItemsCode, "A2ZACOMS");


            var p = new A2ZITEMSDTO();

            if (dt.Rows.Count > 0)
            {
                p.ItemsCode = Converter.GetInteger(dt.Rows[0]["ItemsCode"]);
                p.ItemsName = Converter.GetString(dt.Rows[0]["ItemsName"]);
                return(p);
            }
            p.ItemsCode = 0;

            return(p);
        }
示例#3
0
        public static int InsertInformation(A2ZITEMSDTO dto)
        {
            dto.ItemsName = (dto.ItemsName != null) ? dto.ItemsName.Trim().Replace("'", "''") : "";
            int    rowEffect = 0;
            string strQuery  = @"INSERT into A2ZITEMSCODE(ItemsCode,ItemsName)values('" + dto.ItemsCode + "','" + dto.ItemsName + "')";

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

            if (rowEffect == 0)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }