public static int UpdateInformation(A2ZUPZILADTO dto) { dto.UpzilaDescription = (dto.UpzilaDescription != null) ? dto.UpzilaDescription.Trim().Replace("'", "''") : ""; int rowEffect = 0; string strQuery = "UPDATE A2ZUPZILA set DiviCode='" + dto.DivisionCode + "',DistCode='" + dto.DistrictCode + "',UpzilaCode='" + dto.UpzilaCode + "',DiviOrgCode='" + dto.DivisionOrgCode + "',DistOrgCode='" + dto.DistrictOrgCode + "',UpzilaOrgCode='" + dto.UpzilaOrgCode + "',UpzilaDescription='" + dto.UpzilaDescription + "' where DiviCode ='" + dto.DivisionCode + "'and DistCode='" + dto.DistrictCode + "'and UpzilaCode='" + dto.UpzilaCode + "'"; rowEffect = Converter.GetInteger(BLL.CommonManager.Instance.ExecuteNonQuery(strQuery, "A2ZHKGMS")); if (rowEffect == 0) { return(0); } else { return(1); } }
public static int InsertInformation(A2ZUPZILADTO dto) { dto.UpzilaDescription = (dto.UpzilaDescription != null) ? dto.UpzilaDescription.Trim().Replace("'", "''") : ""; int rowEffect = 0; string strQuery = @"INSERT into A2ZUPZILA(DiviCode,DistCode,UpzilaCode,DiviOrgCode,DistOrgCode,UpzilaOrgCode,UpzilaDescription)values('" + dto.DivisionCode + "','" + dto.DistrictCode + "','" + dto.UpzilaCode + "','" + dto.DivisionOrgCode + "','" + dto.DistrictOrgCode + "','" + dto.UpzilaOrgCode + "','" + dto.UpzilaDescription + "')"; rowEffect = Converter.GetInteger(BLL.CommonManager.Instance.ExecuteNonQuery(strQuery, "A2ZHKGMS")); if (rowEffect == 0) { return(0); } else { return(1); } }
public static A2ZUPZILADTO GetInfo(int UpzilaCode) { DataTable dt = BLL.CommonManager.Instance.GetDataTableByQuery("SELECT * FROM A2ZUPZILA WHERE UpzilaOrgCode = '" + UpzilaCode + "'", "A2ZHKGMS"); var p = new A2ZUPZILADTO(); if (dt.Rows.Count > 0) { p.UpzilaCode = Converter.GetInteger(dt.Rows[0]["UpzilaCode"]); p.UpzilaDescription = Converter.GetString(dt.Rows[0]["UpzilaDescription"]); return(p); } p.DivisionCode = 0; p.DistrictCode = 0; p.UpzilaCode = 0; return(p); }