Example #1
0
        public static int UpdateInformation(A2ZPROFESSIONDTO dto)
        {
            dto.ProfessionDescription = (dto.ProfessionDescription != null) ? dto.ProfessionDescription.Trim().Replace("'", "''") : "";
            int    rowEffect = 0;
            string strQuery  = "UPDATE A2ZPROFESSION set ProfessionCode='" + dto.ProfessionCode + "',ProfessionDescription='" + dto.ProfessionDescription + "' where ProfessionCode='" + dto.ProfessionCode + "'";

            rowEffect = Converter.GetInteger(BLL.CommonManager.Instance.ExecuteNonQuery(strQuery, "A2ZACGMS"));
            if (rowEffect == 0)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
Example #2
0
        public static A2ZPROFESSIONDTO GetInformation(Int16 Professioncode)
        {
            DataTable dt = BLL.CommonManager.Instance.GetDataTableByQuery("SELECT * FROM A2ZPROFESSION WHERE ProfessionCode = " + Professioncode, "A2ZACGMS");


            var p = new A2ZPROFESSIONDTO();

            if (dt.Rows.Count > 0)
            {
                p.ProfessionCode        = Converter.GetSmallInteger(dt.Rows[0]["ProfessionCode"]);
                p.ProfessionDescription = Converter.GetString(dt.Rows[0]["ProfessionDescription"]);
                return(p);
            }
            p.ProfessionCode = 0;

            return(p);
        }
Example #3
0
        public static int InsertInformation(A2ZPROFESSIONDTO dto)
        {
            dto.ProfessionDescription = (dto.ProfessionDescription != null) ? dto.ProfessionDescription.Trim().Replace("'", "''") : "";
            int    rowEffect = 0;
            string strQuery  = @"INSERT into A2ZPROFESSION(ProfessionCode,ProfessionDescription)values('" + dto.ProfessionCode + "','" + dto.ProfessionDescription + "')";

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

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