Пример #1
0
        public static int UpdateInformation(A2ZDISTRICTDTO dto)
        {
            dto.DistrictDescription = (dto.DistrictDescription != null) ? dto.DistrictDescription.Trim().Replace("'", "''") : "";
            int    rowEffect = 0;
            string strQuery  = "UPDATE A2ZDISTRICT set DiviCode='" + dto.DivisionCode + "',DistCode='" + dto.DistrictCode + "',DiviOrgCode='" + dto.DivisionOrgCode + "',DistOrgCode='" + dto.DistrictOrgCode + "',DistDescription='" + dto.DistrictDescription + "' where DiviCode ='" + dto.DivisionCode + "'and DistCode='" + dto.DistrictCode + "'";

            rowEffect = Converter.GetInteger(BLL.CommonManager.Instance.ExecuteNonQuery(strQuery, "A2ZHKMCUS"));
            if (rowEffect == 0)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
Пример #2
0
        public static int InsertInformation(A2ZDISTRICTDTO dto)
        {
            dto.DistrictDescription = (dto.DistrictDescription != null) ? dto.DistrictDescription.Trim().Replace("'", "''") : "";
            int    rowEffect = 0;
            string strQuery  = @"INSERT into A2ZDISTRICT(DiviCode,DistCode,DiviOrgCode,DistOrgCode,DistDescription)values('" + dto.DivisionCode + "','" + dto.DistrictCode + "','" + dto.DivisionOrgCode + "','" + dto.DistrictOrgCode + "','" + dto.DistrictDescription + "')";

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

            if (rowEffect == 0)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
Пример #3
0
        public static A2ZDISTRICTDTO GetInfo(int DisCode)
        {
            DataTable dt = BLL.CommonManager.Instance.GetDataTableByQuery("SELECT * FROM A2ZDISTRICT WHERE DistOrgCode = '" + DisCode + "'", "A2ZHKMCUS");


            var p = new A2ZDISTRICTDTO();

            if (dt.Rows.Count > 0)
            {
                p.DivisionCode        = Converter.GetInteger(dt.Rows[0]["DiviCode"]);
                p.DistrictCode        = Converter.GetInteger(dt.Rows[0]["DistCode"]);
                p.DivisionOrgCode     = Converter.GetInteger(dt.Rows[0]["DiviOrgCode"]);
                p.DistrictOrgCode     = Converter.GetInteger(dt.Rows[0]["DistOrgCode"]);
                p.DistrictDescription = Converter.GetString(dt.Rows[0]["DistDescription"]);
                return(p);
            }
            p.DivisionCode = 0;
            p.DistrictCode = 0;
            return(p);
        }