Example #1
0
        public static int UpdateInformation(A2ZRELIGIONDTO dto)
        {
            dto.RelegionDescription = (dto.RelegionDescription != null) ? dto.RelegionDescription.Trim().Replace("'", "''") : "";
            int    rowEffect = 0;
            string strQuery  = "UPDATE A2ZRELIGION set RelegionCode='" + dto.RelegionCode + "',RelegionDescription='" + dto.RelegionDescription + "' where RelegionCode='" + dto.RelegionCode + "'";

            rowEffect = Converter.GetInteger(BLL.CommonManager.Instance.ExecuteNonQuery(strQuery, "A2ZHKCUBS"));
            if (rowEffect == 0)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
Example #2
0
        public static A2ZRELIGIONDTO GetInformation(Int16 Religioncode)
        {
            DataTable dt = BLL.CommonManager.Instance.GetDataTableByQuery("SELECT * FROM A2ZRELIGION WHERE RelegionCode = " + Religioncode, "A2ZHKCUBS");


            var p = new A2ZRELIGIONDTO();

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

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

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

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